From a751e547d67c4f8e2c6fddf958c1559f792515bd Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期五, 27 六月 2025 16:11:50 +0800 Subject: [PATCH] 添加工作流 --- src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue | 231 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 185 insertions(+), 46 deletions(-) diff --git a/src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue b/src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue index 13d9c64..635e8e5 100644 --- a/src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue +++ b/src/views/eam/modules/dailyMaintenanceOrder/FinishDevolutionModal.vue @@ -7,14 +7,19 @@ cancelText="鍏抽棴" @cancel="handleCancel" :confirmLoading="confirmLoading" + title="闄勫綍2" > - <!-- :title="title" --> <a-spin :spinning="confirmLoading"> <a-form :form="form"> + <span + class="ant-descriptions-title" + style="font-size: large;font-size: 15px;float: right;" + >{{this.model.receiptsNum}}</span> <a-divider orientation="center" style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;" - > 鐢熶骇璁惧浜岀骇淇濆吇瀹屽伐绉讳氦鍗� </a-divider> + > {{this.model.receiptsName}} </a-divider> + <!-- 鐢熶骇璁惧浜岀骇淇濆吇瀹屽伐绉讳氦鍗� --> <a-row :gutter="24"> <a-col :span="8"> <a-form-item @@ -59,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.actualEndTime" + placeholder="璇烽�夋嫨淇濆吇鏃ユ湡" + :showTime="true" + dateFormat="YYYY-MM-DD" + /> </a-form-item> </a-col> </a-row> @@ -78,9 +95,18 @@ rowKey='id' :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 @@ -146,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> @@ -177,8 +230,15 @@ data() { return { columns: [ + { - title: '#', + title: '绫诲瀷', + align: 'center', + width: 260, + dataIndex: 'maintenanceRole' + }, + { + title: '搴忓彿', dataIndex: '', key: 'rowIndex', align: 'center', @@ -187,36 +247,33 @@ }, width: 50, }, - { - title: '绫诲瀷', - align: 'center', - dataIndex: 'maintenanceMethod1' - }, + // { + // title: '閮ㄤ綅', + // align: 'center', + // dataIndex: 'location' + // }, { - title: '閮ㄤ綅', + title: '淇濆吇鍐呭', align: 'center', - dataIndex: 'location' + dataIndex: 'maintenanceProjectName' }, - { - title: '淇濆吇椤圭洰', - align: 'center', - dataIndex: 'maintenanceProjectNum' - }, - { - title: '淇濆吇鏍囧噯', - align: 'center', - dataIndex: 'standard' - }, + // { + // title: '淇濆吇鏍囧噯', + // align: 'center', + // dataIndex: 'standard' + // }, { title: '鎵ц鎯呭喌', align: 'center', - dataIndex: 'maintenanceTool1' + dataIndex: 'maintenanceOrderDetailUda2', + width: 150, }, { title: '鎵ц浜�', align: 'center', - dataIndex: 'photo1', + dataIndex: 'maintenanceOrderDetailUda1', + width: 150, }, ], @@ -225,8 +282,9 @@ disableSubmit: false, codeDisable: true, dataSource: [], + dataSourceOperation: [], model: {}, - departs: [], + // departs: [], labelCol: { xs: { span: 24 }, sm: { span: 6 }, @@ -245,9 +303,9 @@ }, }, url: { - add: "/eam/dailyMaintenanceOrder/add", + // add: "/eam/dailyMaintenanceOrder/add", edit: "/eam/dailyMaintenanceOrder/approve", - getSysDeparts: "/eam/dailyMaintenanceOrder/getSysDeparts", + getSysFileName: "/eam/sysFileName/getSysFileName", list: "/eam/dailyMaintenanceOrder/getMaintenanceCycleByStandardId", }, @@ -258,22 +316,32 @@ edit(record) { let that = this; - this.getSysDeparts() + if (record.receipts == "" || record.receipts == null) { + this.getSysFileName() + } 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; + // } }, @@ -286,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'); @@ -307,15 +387,74 @@ }) }, + + 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); }, - getSysDeparts() { - getAction(this.url.getSysDeparts).then((res) => { + getSysFileName() { + getAction(this.url.getSysFileName, { name: '15' }).then((res) => { if (res.success) { - this.departs = res.result + this.model = Object.assign(this.model, res.result[0]); } }) }, -- Gitblit v1.9.3