From 585fb0bbd4a7bc7f8f333ecba7c5fecd2ee5cbc2 Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期四, 28 三月 2024 09:46:44 +0800 Subject: [PATCH] Merge branch 'master' of http://117.34.109.166:18448/r/vue_mdc_430 into develop --- src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue | 201 +++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 166 insertions(+), 35 deletions(-) diff --git a/src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue b/src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue index fb46035..7ba8ef5 100644 --- a/src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue +++ b/src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue @@ -64,13 +64,25 @@ </a-form-item> </a-col> <a-col :span="8"> - <a-form-item + <!-- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="淇濆吇鏃ユ湡" > <span v-if="this.model != null">{{ this.model.actualEndTime }}</span> <span v-else>-</span> + </a-form-item> --> + <a-form-item + label="淇濆吇鏃ユ湡" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <j-date + v-model="model.maintenanceDate" + placeholder="璇烽�夋嫨淇濆吇鏃ユ湡" + :showTime="true" + dateFormat="YYYY-MM-DD" + /> </a-form-item> </a-col> </a-row> @@ -84,9 +96,17 @@ :columns="columns" :dataSource="dataSource" :pagination="false" - > + /> + <a-table + ref="table" + bordered + size="middle" + rowKey='id' + :columns="columns" + :dataSource="dataSourceOperation" + :pagination="false" + /> - </a-table> <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> <div class="ant-descriptions-title">闂鍙婄浉搴斿鐞嗘帾鏂芥弿杩帮細</div> <a-textarea @@ -152,12 +172,39 @@ 鍏抽棴 </a-button> - <a-button + <!-- <a-button @click="handleOk()" type="primary" :loading="confirmLoading" :disabled="disableSubmit || confirmLoading" - >纭畾</a-button> + >纭畾</a-button> --> + <a-popconfirm + @confirm="() => handleReject()" + title="纭灏嗗綋鍓嶄簩淇濆畬宸ョЩ浜ゅ崟椹冲洖锛�" + :disabled="this.model.confirmStatus == '0' || this.model.confirmStatus == '2'|| this.model.confirmStatus == '7'" + > + <a-button + :loading='confirmLoading' + :style="{marginRight: '8px'}" + :disabled="this.model.confirmStatus == '0' || this.model.confirmStatus == '2'|| this.model.confirmStatus == '7'" + > + 椹冲洖 + </a-button> + </a-popconfirm> + <a-popconfirm + @confirm="() => handleOk()" + title="纭灏嗗綋鍓嶄簩淇濆畬宸ョЩ浜ゅ崟瀹℃牳閫氳繃锛�" + :disabled="this.model.confirmStatus == '7'" + > + <a-button + type='primary' + :loading='confirmLoading' + :style="{marginRight: '8px'}" + :disabled="this.model.confirmStatus == '7'" + > + 閫氳繃 + </a-button> + </a-popconfirm> </template> </a-modal> @@ -183,8 +230,15 @@ data() { return { columns: [ + { - title: '#', + title: '绫诲瀷', + align: 'center', + width: 260, + dataIndex: 'maintenanceRole' + }, + { + title: '搴忓彿', dataIndex: '', key: 'rowIndex', align: 'center', @@ -193,36 +247,33 @@ }, width: 50, }, - { - title: '绫诲瀷', - align: 'center', - dataIndex: 'maintenanceRole' - }, + // { + // title: '閮ㄤ綅', + // align: 'center', + // dataIndex: 'location' + // }, { - title: '閮ㄤ綅', - align: 'center', - dataIndex: 'location' - }, - { - title: '淇濆吇椤圭洰', + title: '淇濆吇鍐呭', align: 'center', dataIndex: 'maintenanceProjectName' }, - { - title: '淇濆吇鏍囧噯', - align: 'center', - dataIndex: 'standard' - }, + // { + // title: '淇濆吇鏍囧噯', + // align: 'center', + // dataIndex: 'standard' + // }, { title: '鎵ц鎯呭喌', align: 'center', - dataIndex: 'maintenanceOrderDetailUda2' + dataIndex: 'maintenanceOrderDetailUda2', + width: 150, }, { title: '鎵ц浜�', align: 'center', dataIndex: 'maintenanceOrderDetailUda1', + width: 150, }, ], @@ -231,6 +282,7 @@ disableSubmit: false, codeDisable: true, dataSource: [], + dataSourceOperation: [], model: {}, // departs: [], labelCol: { @@ -270,18 +322,26 @@ this.form.resetFields(); this.model = Object.assign({}, record); this.visible = true; - if (record.dailyMaintenanceDetails != undefined) { - const temp = [...record.dailyMaintenanceDetails]; + // if (record.dailyMaintenanceDetails != undefined) { + // const temp = [...record.dailyMaintenanceDetails]; + // that.dataSource = temp; + // } + if (record.operationUserDetails != undefined) { + const temp = [...record.operationUserDetails]; + that.dataSourceOperation = temp; + } + if (record.repairUserDetails != undefined) { + const temp = [...record.repairUserDetails]; that.dataSource = temp; } - that.$nextTick(() => { - that.form.setFieldsValue(pick(that.model, 'num', 'teamId', 'remark')); - }); - if (record.id) { - this.codeDisable = true; - } else { - this.codeDisable = false; - } + // that.$nextTick(() => { + // that.form.setFieldsValue(pick(that.model, 'num', 'teamId', 'remark')); + // }); + // if (record.id) { + // this.codeDisable = true; + // } else { + // this.codeDisable = false; + // } }, @@ -294,13 +354,25 @@ this.close(); }, - handleOk() { + + handleReject() { const that = this; this.form.validateFields((err, values) => { if (!err) { that.confirmLoading = true; let formData = Object.assign(this.model, values); - requestPut(this.url.edit, formData, { id: this.model.id }).then((res) => { + if (this.model.confirmStatus == '1') { + formData.confirmStatus = '2' + } else if (this.model.confirmStatus == '3') { + formData.confirmStatus = '4' + } else if (this.model.confirmStatus == '5') { + formData.confirmStatus = '6' + } else if (this.model.confirmStatus == '6') { + formData.confirmStatus = '4' + } else if (this.model.confirmStatus == '4') { + formData.confirmStatus = '2' + } + requestPut(this.url.edit, formData, { id: this.model.id, maintenanceDate: this.model.maintenanceDate }).then((res) => { if (res.success) { that.$message.success(res.message); that.$emit('ok'); @@ -315,6 +387,65 @@ }) }, + + handleOk() { + const that = this; + that.form.validateFields((err, values) => { + if (!err) { + this.confirmLoading = true; + let formData = Object.assign(this.model, values); + if (this.model.confirmStatus == '0') { + formData.confirmStatus = '1' + } else if (this.model.confirmStatus == '2') { + formData.confirmStatus = '1' + } else if (this.model.confirmStatus == '1') { + formData.confirmStatus = '3' + } else if (this.model.confirmStatus == '4') { + formData.confirmStatus = '3' + } else if (this.model.confirmStatus == '3') { + formData.confirmStatus = '5' + } else if (this.model.confirmStatus == '6') { + formData.confirmStatus = '5' + } else if (this.model.confirmStatus == '5') { + formData.confirmStatus = '7' + } + requestPut(this.url.edit, formData, { id: this.model.id, maintenanceDate: this.model.maintenanceDate }).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + } + }) + }, + + + // handleOk() { + // const that = this; + // this.form.validateFields((err, values) => { + // if (!err) { + // that.confirmLoading = true; + // let formData = Object.assign(this.model, values); + // requestPut(this.url.edit, formData, { id: this.model.id }).then((res) => { + // if (res.success) { + // that.$message.success(res.message); + // that.$emit('ok'); + // } else { + // that.$message.warning(res.message); + // } + // }).finally(() => { + // that.confirmLoading = false; + // that.close(); + // }) + // } + // }) + // }, + handleDelete(text, record, index) { this.dataSource.splice(index, 1); }, -- Gitblit v1.9.3