¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |