From d2dbe43ffe3855f4795356edaa61f1d283b74186 Mon Sep 17 00:00:00 2001 From: guoweilong Date: Thu, 6 Jun 2024 08:42:42 +0800 Subject: [PATCH] feat:点火施工维护 --- App.vue | 64 +++++++++++++++++++++++++++++++++------------------------------- api/charge.js | 21 +++++++++++++++------ components/popUpComponent/popUpComponent.vue | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- components/popUpFillIn/popUpFillIn.vue | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------- pages.json | 16 ++++++++++++++++ pages/charge/constructionMaintenance/detail.vue | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/charge/constructionMaintenance/index.vue | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------- pages/charge/ignitionMaintenance/detail.vue | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/charge/ignitionMaintenance/index.vue | 290 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------- pages/charge/visitsAndFees/createaVisit.vue | 710 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------- pages/charge/visitsAndFees/index.vue | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------- store/mudules/tabBar.js | 2 ++ 12 files changed, 1528 insertions(+), 354 deletions(-) create mode 100644 pages/charge/constructionMaintenance/detail.vue create mode 100644 pages/charge/ignitionMaintenance/detail.vue diff --git a/App.vue b/App.vue index a032cd6..e9837fe 100644 --- a/App.vue +++ b/App.vue @@ -1,38 +1,40 @@ diff --git a/api/charge.js b/api/charge.js index 2a7490a..0479269 100644 --- a/api/charge.js +++ b/api/charge.js @@ -21,15 +21,24 @@ export const getVlgOrCmty = params => http.get('/schsf/mcBasicCmty/vlgOrCmty', { /* 查询用户 */ export const getMcVisitUser = params => http.get('/schsf/mcVisitUser/list', { params }) /* 发布一级审核 */ -export const submitAuditOne = data => http.post('/schsf/mcVisit/ticket/submitAuditOne', { data }) +export const submitAuditOne = data => http.post('/schsf/mcVisit/ticket/submitAuditOne', data ) /* 发布二级审核 */ -export const submitAuditTwo = data => http.post('/schsf/mcVisit/ticket/submitAuditTwo', { data }) +export const submitAuditTwo = data => http.post('/schsf/mcVisit/ticket/submitAuditTwo', data ) /* 发起异动 */ -export const modification = data => http.post('/schsf/mcVisit/modification', { data }) +export const modification = data => http.post('/schsf/mcVisit/modification', data ) /* 异动一级审批 */ -export const submitModificationOne = data => http.post('/schsf/mcVisit/modification/submitAuditOne', { data }) +export const submitModificationOne = data => http.post('/schsf/mcVisit/modification/submitAuditOne', data ) /* 异动二级审批 */ -export const submitModificationTwo = data => http.post('/schsf/mcVisit/modification/submitAuditTwo', { data }) +export const submitModificationTwo = data => http.post('/schsf/mcVisit/modification/submitAuditTwo', data ) /* 查询节点处理人 */ export const getStatusNodeUserList = id => http.get(`/schsf/mcVisit/statusNodeUserList/${id}`) - +/* 点火维护查询列表 */ +export const getMcIgnitionList = params => http.get('/schsf/mcIgnition/list', { params }) +/* 点火维护 */ +export const mcIgnitionMaintenance = data => http.post('/schsf/mcIgnition/maintenance', data ) +/* 施工列表 */ +export const getMcConstructionList = params => http.get('/schsf/mcConstruction/list', {params} ) +/* 工程维护 */ +export const mcConstructionEngineering = data => http.post('/schsf/mcConstruction/engineering', data ) +/* 运营维护 */ +export const mcConstructionOperation = data => http.post('/schsf/mcConstruction/operations', data ) diff --git a/components/popUpComponent/popUpComponent.vue b/components/popUpComponent/popUpComponent.vue index 24f780d..63071b1 100644 --- a/components/popUpComponent/popUpComponent.vue +++ b/components/popUpComponent/popUpComponent.vue @@ -22,17 +22,34 @@ + + diff --git a/pages/charge/constructionMaintenance/index.vue b/pages/charge/constructionMaintenance/index.vue index a9f7eac..f4453c6 100644 --- a/pages/charge/constructionMaintenance/index.vue +++ b/pages/charge/constructionMaintenance/index.vue @@ -16,28 +16,28 @@ - + - 项目公司:咸宁中燃城镇燃气有限公司 + 项目公司:{{item.companyName || '--'}} - 村(小区):南湖壹号 + 村(小区):{{item.vlgOrCmty || '--'}} - 项目类型:扫雷行动项目(市政中压已覆盖) + 项目类型:{{item.projectTypeName || '--'}} - + 查看详情 - + 工程维护 @@ -45,12 +45,17 @@ 当前审批节点:项目公司_市场负责人 --> + + + + diff --git a/pages/charge/ignitionMaintenance/index.vue b/pages/charge/ignitionMaintenance/index.vue index dd75c17..6e23e4e 100644 --- a/pages/charge/ignitionMaintenance/index.vue +++ b/pages/charge/ignitionMaintenance/index.vue @@ -1,147 +1,195 @@ diff --git a/pages/charge/visitsAndFees/createaVisit.vue b/pages/charge/visitsAndFees/createaVisit.vue index 81166cd..44683d2 100644 --- a/pages/charge/visitsAndFees/createaVisit.vue +++ b/pages/charge/visitsAndFees/createaVisit.vue @@ -1,7 +1,7 @@ @@ -194,8 +202,14 @@ import chargeFile from '@/api/chargeFile' import config from '@/common/config.js' import { + getMcFileList, getCurrentFiscalYear, - getCompanyCascader + getCompanyCascader, + getVlgOrCmty, + getMcVisitUser, + addMcVisit, + editMcVisit, + modification } from '@/api/charge.js' export default { components: {}, @@ -205,16 +219,177 @@ data() { return { title: "创建拜访/收费", + btnText: '立即发起', + operationStatus: '', model: { fiscalYear: "", + billingPersonName: "", jobNature: "", + entryTime: "", + company: "", + vlgOrCmty: "", + userName: "", + userPhone: "", + companyCode: "", + address: "", + userDetailedAddress: "", + isVisited: "", + isIntent: "", + houseCondition: "", + currentCookingEnergy: "", + currentHeatingEnergy: "", + familyMembers: "", + fridgeStatus: "", + acStatus: "", + tvStatus: "", + washerStatus: "", + waterHeaterStatus: "", + pvSystemStatus: "", + visitDetailedAddress: "", + fieldPhotoFile: "", + hasDm: "", + dmAge: "", + dmIncomeSrc: "", + dmPhone: "", + isCharged: "", + userCode: "", + userIdCard: "", + invoiceNo: "", + chargeAmt: "", + paymentMeth: "", + chargeType: "", + remark: "", + attachmentFile: "", }, copyModel: {}, - rules: {}, + rules: { + billingPersonName: [{ + required: true, + message: '请输入收费人员', + trigger: ['blur', 'change'] + }], + jobNature: [{ + required: true, + message: '请选择工作性质', + trigger: ['blur', 'change'] + }], + entryTime: [{ + required: true, + message: '请选择入户时间', + trigger: ['blur', 'change'] + }], + company: [{ + required: true, + message: '请选择项目公司', + trigger: ['blur', 'change'] + }], + vlgOrCmty: [{ + required: true, + message: '请选择村(小区)', + trigger: ['blur', 'change'] + }], + userName: [{ + required: true, + message: '请选择户名', + trigger: ['blur', 'change'] + }], + userPhone: [{ + required: true, + message: '请填写联系电话', + trigger: ['blur', 'change'] + }], + address: [{ + required: true, + message: '请输入省市区街道', + trigger: ['blur', 'change'] + }], + userDetailedAddress: [{ + required: true, + message: '请填写详细地址', + trigger: ['blur', 'change'] + }], + isVisited: [{ + required: true, + message: '请选择是否拜访', + trigger: ['blur', 'change'] + }], + isIntent: [{ + required: true, + message: '请选择是否有意向', + trigger: ['blur', 'change'] + }], + houseCondition: [{ + required: true, + message: '请选择房屋情况', + trigger: ['blur', 'change'] + }], + currentCookingEnergy: [{ + required: true, + message: '请选择做饭能源', + trigger: ['blur', 'change'] + }], + hasDm: [{ + required: true, + message: '请选择是否决策人信息', + trigger: ['blur', 'change'] + }], + dmAge: [{ + required: true, + message: '请输入决策人年龄', + trigger: ['blur', 'change'] + }], + dmIncomeSrc: [{ + required: true, + message: '选择收入来源', + trigger: ['blur', 'change'] + }], + dmPhone: [{ + required: true, + message: '请填写决策人联系电话', + trigger: ['blur', 'change'] + }], + isCharged: [{ + required: true, + message: '请选择是否收费', + trigger: ['blur', 'change'] + }], + userCode: [{ + required: true, + message: '请填写用户编号', + trigger: ['blur', 'change'] + }], + userIdCard: [{ + required: true, + message: '请填写身份证号', + trigger: ['blur', 'change'] + }], + invoiceNo: [{ + required: true, + message: '请填写票据单号', + trigger: ['blur', 'change'] + }], + chargeAmt: [{ + required: true, + message: '请填写收费金额', + trigger: ['blur', 'change'] + }], + paymentMeth: [{ + required: true, + message: '请选择缴费方式', + trigger: ['blur', 'change'] + }], + chargeType: [{ + required: true, + message: '请选择收费类型', + trigger: ['blur', 'change'] + }], + }, pickerShow: false, + gsShow: false, datetimeShow: false, dataTimeValue: Number(new Date()), columns: [], + gsColumns: [], regionName: [], groupName: [], companyName: [], @@ -222,14 +397,14 @@ currentName: "", //弹窗后赋值name companyOption: [], fileList: [], - attachmentList:[], + attachmentList: [], // 基本信息 basisData: [{ label: '财年', placeholder: "请选择财年", type: "date", required: true, - key: "fiscalYear" + key: "fiscalYear", }, { label: '收费人员', placeholder: "请输入", @@ -250,25 +425,11 @@ required: true, key: "entryTime" }, { - label: '区域', - placeholder: "请选择", - type: "select", - required: true, - key: "regionName" - }, - { - label: '集团', - placeholder: "请选择", - type: "select", - required: true, - key: "groupName" - }, - { - label: '公司', + label: '项目公司', placeholder: "请选择", type: "select", required: true, - key: "companyName" + key: "company" }, { label: '村(小区)', placeholder: "请选择", @@ -306,141 +467,164 @@ type: "radio", required: true, key: "isVisited", + show: true, }, { label: '是否有意向', // placeholder: "请选择", required: true, type: "radio", - key: "isIntent" + key: "isIntent", + show: true, }, { label: '房屋情况', placeholder: "请选择", required: true, type: "select", key: "houseCondition", - dict: "sys_mc_visit_house" + dict: "sys_mc_visit_house", + show: true, }, { label: '现用做饭能源', placeholder: "请选择", required: true, type: "select", key: "currentCookingEnergy", - dict: "sys_mc_visit_energy" + dict: "sys_mc_visit_energy", + show: true, }, { label: '现用取暖能源', placeholder: "请选择", type: "select", key: "currentHeatingEnergy", - dict: "sys_mc_visit_energy" + dict: "sys_mc_visit_energy", + show: true, }, { label: '家庭人口情况', placeholder: "请选择", type: "select", key: "familyMembers", - dict: "sys_mc_visit_members" + dict: "sys_mc_visit_members", + show: true, }, { label: '电冰箱', placeholder: "请选择", type: "select", key: "fridgeStatus", - dict: 'sys_mc_visit_appliance_status' + dict: 'sys_mc_visit_appliance_status', + show: true, }, { label: '空调', placeholder: "请选择", type: "select", key: "acStatus", - dict: 'sys_mc_visit_appliance_status' + dict: 'sys_mc_visit_appliance_status', + show: true, }, { label: '电视', placeholder: "请选择", type: "select", key: "tvStatus", - dict: 'sys_mc_visit_appliance_status' + dict: 'sys_mc_visit_appliance_status', + show: true, }, { label: '洗衣机', placeholder: "请选择", type: "select", key: "washerStatus", - dict: 'sys_mc_visit_appliance_status' + dict: 'sys_mc_visit_appliance_status', + show: true, }, { label: '热水器', placeholder: "请选择", type: "select", key: "waterHeaterStatus", - dict: 'sys_mc_visit_appliance_status' + dict: 'sys_mc_visit_appliance_status', + show: true, }, { label: '光伏', placeholder: "请选择", type: "select", key: "pvSystemStatus", - dict: 'sys_mc_visit_appliance_status' + dict: 'sys_mc_visit_appliance_status', + show: true, }, { label: '当前地址', placeholder: "请输入", type: "input", - key: "visitDetailedAddress" + key: "visitDetailedAddress", + show: true, }, { label: '上传图片', placeholder: "请选择", type: "file", - key: 'fieldPhotoFile' + key: 'fieldPhotoFile', + show: true, }], // 决策人信息 decisionMakersData: [{ label: '是否获取决策人信息', type: "radio", required: true, - key: "hasDm" + key: "hasDm", + show: true, }, { label: '决策人年龄', placeholder: "请输入", required: true, type: "input", - key: "dmAge" + key: "dmAge", + show: true, }, { label: '决策人收入来源', placeholder: "请选择", required: true, type: "select", key: "dmIncomeSrc", - dict: 'sys_mc_visit_dm_income' + dict: 'sys_mc_visit_dm_income', + show: true, }, { label: '决策人联系方式', placeholder: "请输入", required: true, type: "input", - key: "dmPhone" + key: "dmPhone", + show: true, }], // 收费信息 chargeData: [{ label: '本次是否收费', type: "radio", required: true, - key: "isCharged" + key: "isCharged", + show: true, }, { label: '用户编号', placeholder: "请输入", required: true, type: "input", - key: "userCode" + key: "userCode", + show: true, }, { label: '身份证号', placeholder: "请输入", required: true, type: "input", - key: "userIdCard" + key: "userIdCard", + show: true, }, { label: '票据单号', placeholder: "请输入", required: true, type: "input", - key: "invoiceNo" + key: "invoiceNo", + show: true, }, { label: '收费金额', placeholder: "请输入", required: true, type: "input", - key: "chargeAmt" + key: "chargeAmt", + show: true, }, { label: '缴费方式', placeholder: "请选择", @@ -448,13 +632,15 @@ type: "select", key: "paymentMeth", dict: 'sys_mc_payment_meth', + show: true, }, { label: '收费类型', placeholder: "请选择", required: true, type: "select", key: "chargeType", - dict: "sys_mc_charge_type" + dict: "sys_mc_charge_type", + show: true, }], // 其他信息 otherData: [{ @@ -472,64 +658,261 @@ computed: { }, - onLoad() { + onLoad(data) { + console.log(data); + if (data.objData) { + let obj = JSON.parse(data.objData); + this.model = { + ...obj + }; + this.fillInData(); + } + if (data.operation) { + if (data.operation === 'yd') { + console.log('异动数据', JSON.parse(JSON.stringify(this.model))); + this.btnText = "发起异动"; + this.operationStatus = "YD" //异动 + } else if (data.operation === 'edit') { + this.btnText = "修改"; + console.log('修改数据', JSON.parse(JSON.stringify(this.model))); + this.operationStatus = "BJ" //编辑 + } else { + this.operationStatus = "TJ" //添加 + } + } this.init() }, methods: { + // 编辑或异动需要填充数据 + async fillInData() { + this.model.company = `${this.model.userProvince}` + this.model.address = + `${this.model.userProvince}${this.model.userCity}${this.model.userDistrict}${this.model.userStreet}` + this.model.isCharged = this.model.isCharged === 'Y' ? '是' : '否'; + this.model.isIntent = this.model.isIntent === 'Y' ? '是' : '否'; + this.model.isVisited = this.model.isVisited === 'Y' ? '是' : '否'; + this.model.hasDm = this.model.hasDm === 'Y' ? '是' : '否'; + if (this.model.isCharged === '否') { + this.chargeData.slice(1).map(item => { + item.show = false; + }) + } + if (this.model.isVisited === '否') { + this.visitData.slice(1).map(item => { + item.show = false; + }) + } + if (this.model.hasDm === '否') { + this.decisionMakersData.slice(1).map(item => { + item.show = false; + }) + } + let uuid = this.model.attachmentFile; + console.log(uuid); + if (uuid) { + let uuids = uuid.split(","); + let data = { + uuids: uuids + } + getMcFileList(data).then(res => { + if (res.code === 200) { + this.attachmentList = res.data + } + }) + } + + }, async init() { console.log(this.$store); // 查询财年 await this.getCurrentFiscalYear() await this.getCompanyCascader() - this.model.billingPersonName = uni.getStorageSync("nickName"); + let nickName = uni.getStorageSync("nickName"); + this.$set(this.model, 'billingPersonName', nickName) + // console.log(this.model.billingPersonName); }, async getCurrentFiscalYear() { - this.model.fiscalYear = (await getCurrentFiscalYear()).data; + let fiscalYear = (await getCurrentFiscalYear()).data; + this.$set(this.model, 'fiscalYear', fiscalYear); console.log("当前财年", this.model.fiscalYear); }, async getCompanyCascader() { this.companyOption = (await getCompanyCascader()).data; + this.companyOption.forEach(item1 => { + this.regionName.push(item1); + item1.children.forEach(item2 => { + this.groupName.push(item2); + item2.children.forEach(item3 => { + this.companyName.push(item3); + }); + }); + }); console.log("当前公司类", this.companyOption); }, // 选择弹出层 - handleSelect(item) { + async handleSelect(item) { + if (this.operationStatus === 'YD') { + return + } console.log(item); - if (item.key === 'companyCode') { - this.companyOption.forEach(item1 => { - // console.log(111,item1); - this.regionName.push(item1); - item1.children.forEach(item2 => { - // console.log(222,item2); - this.groupName.push(item2); - item2.children.forEach(item3 => { - // console.log(333,item3); - this.companyName.push(item3); - }); - }); - }); - // console.log("data1", data1); - // console.log("data2", data2); - // console.log("data3", data3); - this.columns = [this.regionName, this.groupName, this.companyName]; + this.currentName = item.key; + if (item.key === 'company') { + this.gsColumns = [this.regionName, this.groupName, this.companyName]; + this.gsShow = true; + return console.log("数据", this.columns); + } else if (item.key === 'vlgOrCmty') { + if (!this.model.company) { + uni.$u.toast('请先选择项目公司'); + return + } + let data = { + fiscalYear: this.model.fiscalYear, + regionName: this.model.regionName, + groupName: this.model.groupName, + companyName: this.model.companyName, + companyCode: this.model.companyCode + } + const result = await getVlgOrCmty(data); + let col = result.data.map(item => ({ + value: item.vlgOrCmty, + label: item.vlgOrCmty + })); + this.columns = [col]; + } else if (item.key === 'userName') { + if (!this.model.vlgOrCmty) { + uni.$u.toast('请先选择村(小区)'); + return + } + let data = { + companyCode: this.model.companyCode, + vlgOrCmty: this.model.vlgOrCmty + } + const result = await getMcVisitUser(data); + let col = result.rows.map(item => ({ + value: item.userName, + label: item.userName, + obj: item + })); + this.columns = [col]; } else { let dict = item.dict; let dictArr = this.getDictDatas(dict); - this.currentName = item.key; this.columns = [dictArr]; } this.pickerShow = true; console.log(this.columns); // console.log("字典数组", dictArr); }, + handleSFSelect(item) { + this.currentName = item.key; + let dict = item.dict; + let dictArr = this.getDictDatas(dict); + this.columns = [dictArr]; + this.pickerShow = true; + }, + changeHandler(e) { + console.log(this.currentName); + const { + columnIndex, + value, + values, // values为当前变化列的数组内容 + index, + // 微信小程序无法将picker实例传出来,只能通过ref操作 + picker = this.$refs.uPicker + } = e + console.log(e); + // 当第一列值发生变化时,变化第二列(后一列)对应的选项 + let data2 = value[0].children; + let data3 = data2[0].children; + // picker为选择器this实例,变化第二列对应的选项 + this.gsColumns = [this.regionName, data2, data3] + console.log("选择后", this.gsColumns); + }, // 选择弹出层确认 confirm(e) { console.log("确认", e); - this.model[this.currentName] = e.value[0].value; + if (this.currentName === 'company') { + this.model[this.currentName] = `${e.value[2].label}`; + this.model.regionName = e.value[0]?.value; + this.model.groupName = e.value[1]?.value; + this.model.companyName = e.value[2]?.label; + this.model.companyCode = e.value[2]?.value; + } else if (this.currentName === 'userName') { + let data = e.value[0].obj + this.model[this.currentName] = e.value[0].value + this.model['userPhone'] = data.userPhone; + this.model['userProvince'] = data.province; + this.model['userCity'] = data.city; + this.model['userDistrict'] = data.district; + this.model['userStreet'] = data.street; + this.model['userDetailedAddress'] = data.detailedAddress; + this.model['address'] = `${data.province}${data.city}${data.district}${data.street}`; + } else { + this.model[this.currentName] = e.value[0].value + } this.pickerShow = false; }, + // 项目公司独立弹窗,防止共用报错 + gsConfirm(e) { + console.log("公司", e); + if (this.currentName === 'company') { + this.model[this.currentName] = `${e.value[2].label}`; + this.model.regionName = e.value[0]?.value; + this.model.groupName = e.value[1]?.value; + this.model.companyName = e.value[2]?.label; + this.model.companyCode = e.value[2]?.value; + } + this.gsShow = false; + }, + // 拜访单选 + bfChange(e) { + console.log(e); + if (e === '否') { + this.visitData.slice(1).map(item => { + item.show = false; + }) + } else { + this.visitData.map(item => { + item.show = true; + }) + } + }, + // 决策人单选 + jcrChange(e) { + if (e === '否') { + this.decisionMakersData.slice(1).map(item => { + item.show = false; + }) + } else { + this.decisionMakersData.map(item => { + item.show = true; + }) + } + }, + sfChange(e) { + if (e === '否') { + this.chargeData.slice(1).map(item => { + item.show = false; + }) + } else { + this.chargeData.map(item => { + item.show = true; + }) + } + }, + // 查询小区 + async getVlgOrCmty() { + console.log("查询小区数据", this.columns); + }, // 选择时间弹出层 handleDateTime(item) { + if (this.operationStatus === 'YD') { + return + } + if (item.key === 'fiscalYear') { + return + } this.currentName = item.key; this.datetimeShow = true; console.log(item); @@ -541,22 +924,6 @@ this.model[this.currentName] = time; this.datetimeShow = false; }, - changeHandler(e) { - console.log(e); - const { - columnIndex, - value, - values, // values为当前变化列的数组内容 - index, - // 微信小程序无法将picker实例传出来,只能通过ref操作 - picker = this.$refs.uPicker - } = e - // 当第一列值发生变化时,变化第二列(后一列)对应的选项 - // if (columnIndex === 0) { - // // picker为选择器this实例,变化第二列对应的选项 - // picker.setColumnValues(1, this.groupName[index]) - // } - }, // 删除图片 deletePic(event) { this.fileList.splice(event.index, 1) @@ -612,31 +979,108 @@ console.log("上传附件"); uni.chooseFile({ count: 1, //默认100 - extension:['.doc','.xlsx','.docx'], - success:async (res)=> { + extension: ['.doc', '.xlsx', '.docx'], + success: async (res) => { let tempUrl = res.tempFilePaths[0] console.log(res); const result = await chargeFile.uploadFile(tempUrl); this.attachmentList.push(result); console.log(result); - } + } }); }, // 重构提交数据,不影响表单数据 copyMethods() { this.copyModel.fieldPhotoFile = this.fileList.map(item => item.uuid).join(","); + this.copyModel.isCharged = this.copyModel.isCharged === '是' ? 'Y' : 'N'; + this.copyModel.isIntent = this.copyModel.isIntent === '是' ? 'Y' : 'N'; + this.copyModel.isVisited = this.copyModel.isVisited === '是' ? 'Y' : 'N'; + this.copyModel.hasDm = this.copyModel.hasDm === '是' ? 'Y' : 'N'; + this.copyModel.attachmentFile = this.attachmentList.map(item => item.uuid).join(","); }, - // 发起拜访 + // 发起拜访或异动或者修改 handleConfirm() { - this.copyModel = this.model; + this.copyModel = { + ...this.model + }; this.copyMethods(); console.log('提交数据', JSON.parse(JSON.stringify(this.copyModel))); - this.$modal.confirm('确认发起当前这条记录?', '温馨提示').then(() => { - console.log('确定'); - }).catch(() => { - console.log("取消"); - }); - } + // 提交 + if (this.operationStatus === 'TJ') { + this.$refs.uForm.validate().then(res => { + this.$modal.confirm('确认发起当前这条记录?', '温馨提示').then(async () => { + const result = await addMcVisit(this.copyModel); + console.log(result); + if (result.code === 200) { + uni.$u.toast('发起成功'); + setTimeout(() => { + this.$goBack(); + }, 1000) + } + }).catch(() => {}); + // uni.$u.toast('校验通过') + }).catch(errors => { + console.log('校验失败', errors); + // uni.$u.toast('校验失败') + }) + } else if (this.operationStatus === 'YD') { + this.handleYDConfirm(); + } else if (this.operationStatus === 'BJ') { + this.handleEditConfirm(); + } + }, + // 编辑提交 + handleEditConfirm() { + this.$refs.uForm.validate().then(res => { + this.$modal.confirm('确认修改这条记录?', '温馨提示').then(async () => { + const result = await editMcVisit(this.copyModel); + console.log(result); + if (result.code === 200) { + uni.$u.toast('修改成功'); + setTimeout(() => { + this.$goBack(); + }, 1000) + } + }).catch(() => {}); + // uni.$u.toast('校验通过') + }).catch(errors => { + console.log('校验失败', errors); + // uni.$u.toast('校验失败') + }) + }, + // 提交异动 + async handleYDConfirm() { + let that = this; + that.$refs.uForm.validate().then(res => { + that.$modal.confirm('确认发起异动?', '温馨提示').then(async () => { + let data = { + id: 60, + userIdCard: that.copyModel.userIdCard, + invoiceNo: that.copyModel.invoiceNo, + chargeAmt: that.copyModel.chargeAmt, + paymentMeth: that.copyModel.paymentMeth, + chargeType: that.copyModel.chargeType, + remark: that.copyModel.remark, + attachmentFile: that.copyModel.attachmentFile + } + console.log("异动数据", data); + const result = await modification(data); + console.log(result); + if (result.code === 200) { + uni.$u.toast('异动成功'); + setTimeout(() => { + that.$goBack(); + }, 1000) + } else { + uni.$u.toast(result.msg); + } + }).catch(() => {}); + // uni.$u.toast('校验通过') + }).catch(errors => { + console.log('校验失败', errors); + // uni.$u.toast('校验失败') + }) + }, } } diff --git a/pages/charge/visitsAndFees/index.vue b/pages/charge/visitsAndFees/index.vue index 2ea0c05..3594028 100644 --- a/pages/charge/visitsAndFees/index.vue +++ b/pages/charge/visitsAndFees/index.vue @@ -68,7 +68,7 @@ - 数据异动 + 数据异动 @@ -80,7 +80,7 @@ - 作废 + 作废 @@ -93,10 +93,10 @@ 查看详情 - + 拒绝 - + 同意 @@ -110,14 +110,40 @@ - + + + + + + + 作废 + + + + + + + 取消 + + + 确定 + + + +