From 92ff846fb659c62037a32b1d8c15eae9df9d9b54 Mon Sep 17 00:00:00 2001 From: zenglf <18502938215@163.com> Date: 星期一, 18 九月 2023 13:24:30 +0800 Subject: [PATCH] Merge branch 'develop' of http://117.34.109.166:18448/r/vue_mdc_430 --- src/views/eam/repairOrderFinishedReport/modules/RepairOrderActualHoursReportModel.vue | 296 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 296 insertions(+), 0 deletions(-) diff --git a/src/views/eam/repairOrderFinishedReport/modules/RepairOrderActualHoursReportModel.vue b/src/views/eam/repairOrderFinishedReport/modules/RepairOrderActualHoursReportModel.vue new file mode 100644 index 0000000..2e0c6b4 --- /dev/null +++ b/src/views/eam/repairOrderFinishedReport/modules/RepairOrderActualHoursReportModel.vue @@ -0,0 +1,296 @@ +<template> + <a-modal + :title="title" + :width="1200" + :visible="visible" + :maskClosable="false" + @ok="handleOk" + cancelText="鍏抽棴" + @cancel="handleCancel" + :confirmLoading="confirmLoading" + > + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row :gutter="24"> + <a-col :span="24/2"> + <a-form-item + label="浜哄憳缂栫爜" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input-search + :disabled="disableSubmit" + placeholder="璇烽�夋嫨浜哄憳锛�" + enter-button + @search="onSearchUserList()" + :read-only="true" + v-decorator="['userNum', validatorRules.userNum]" + /> + </a-form-item> + </a-col> + <a-col :span="24/2"> + <a-form-item + label="浜哄憳鍚嶇О" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + :disabled="true" + enter-button + :read-only="true" + v-decorator="['userName', validatorRules.userName]" + /> + </a-form-item> + </a-col> + <!-- <a-col :span="24/2"> + <a-form-item + label="鎵�灞炵彮缁�" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + :disabled="true" + enter-button + :read-only="true" + v-decorator="['teamName', validatorRules.teamName]" + /> + </a-form-item> + </a-col> --> + <a-col :span="24/2"> + <a-form-item label="瀹炴椂宸ユ椂" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input v-decorator="['actualHour', validatorRules.actualHour]" placeholder="璇疯緭鍏ュ疄鏃跺伐鏃�" ></a-input> + </a-form-item> + </a-col> + <a-col :span="12" hidden> + <a-form-item + label="浜哄憳Id" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + :disabled="true" + :placeholder="disableSubmit?'':'璇疯緭鍏ヤ汉鍛�'" + v-decorator="['userId', validatorRules.userId ]" + /> + </a-form-item> + </a-col> + <a-col :span="12" hidden> + <a-form-item + label="鐝粍Id" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + :disabled="true" + :placeholder="disableSubmit?'':'璇疯緭鍏ョ彮缁�'" + v-decorator="['teamId', validatorRules.teamId ]" + /> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + + <template slot="footer"> + <a-button + :style="{marginRight: '8px'}" + @click="handleCancel()" + > + 鍏抽棴 + </a-button> + + <a-button + @click="handleOk()" + type="primary" + :loading="confirmLoading" + >纭畾</a-button> + </template> + + <j-select-user-teaml-modal + ref='userList' + @sendUserRecord='sendUserRecord' + ></j-select-user-teaml-modal> + + </a-modal> + +</template> + +<script> +import { getAction, postAction, requestPut } from '@/api/manage' +import pick from 'lodash.pick' +import JMultiSelectTag from '@/components/dict/JMultiSelectTag' +import { duplicateCheck } from '@/api/api' +import Tooltip from 'ant-design-vue/es/tooltip' +// import JImageUpload from '@/components/jeecg/JImage2Upload' +import JSelectUserTeamlModal from '../../repairOrderFinishedReport/modules/JSelectUserTeamlModal' +import Vue from 'vue' + +export default { + name: "RepairOrderActualMaterialReportModal", + components: { + JMultiSelectTag, + Tooltip, + JSelectUserTeamlModal + }, + data() { + return { + title: "鎿嶄綔", + visible: false, + disableSubmit: false, + codeDisable: true, + model: {}, + departs: [], + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + userNum: { + rules: [ + { required: true, message: '璇烽�夋嫨浜哄憳!' }, + ] + }, + }, + url: { + add: '/eam/reportAfterRepair/addActualWorkHours', + edit: '/eam/repairOrderActualHours/edit' + }, + + dataSource: [], + } + }, + + props: { + reportAfterRepairId:{ + type:String, + default:'', + required:false + }, + }, + + created() { + }, + + mounted() { + this.$bus.$on('selectionRows', (data) => { + for (let i = 0; i < data.length; i++) { + this.dataSource.push({ + id: data[i].id, + num: data[i].num, + }) + } + + }) + }, + + methods: { + + add() { + this.edit({}) + }, + edit(record) { + let that = this; + that.dataSource = []; + that.form.resetFields(); + that.model = Object.assign({}, record); + that.visible = true; + that.$nextTick(() => { + that.form.setFieldsValue(pick(that.model, 'userId','userNum', 'userName','teamId', 'teamName','actualHour')); + }); + if (record.id) { + this.codeDisable = true; + } else { + this.codeDisable = false; + } + }, + + onSearchUserList() { + this.$refs.userList.list(); + this.$refs.userList.title = "閫夋嫨浜哄憳淇℃伅"; + }, + sendUserRecord(data) { + this.dataSource = []; + let record = data.record; + this.form.setFieldsValue({ + userId: record.id, + userNum:record.userCode, + userName:record.realName, + teamName: record.teamName, + teamId: record.teamId, + actualHour: record.actualHour, + }); + }, + + close() { + this.$emit('close'); + this.visible = false; + }, + + handleCancel() { + this.close(); + }, + + handleOk() { + const that = this; + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true; + let formData = Object.assign(this.model, values); + formData.reportAfterRepairId = this.reportAfterRepairId; + let obj; + if (!this.model.id) { + obj = postAction(this.url.add, formData); + } else { + obj = requestPut(this.url.edit, formData, { id: this.model.id }); + } + obj.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(); + }) + } + }) + }, + + }, +} +</script> + +<style lang="less" scoped> +/deep/ .frozenRowClass { + color: #c9c9c9; +} +.fontweight { + font-weight: bold; +} +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} +</style> \ No newline at end of file -- Gitblit v1.9.3