¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :width="1250" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | @ok="handleOk" |
| | | cancelText="å
³é" |
| | | @cancel="handleCancel" |
| | | :confirmLoading="confirmLoading" |
| | | > |
| | | <!-- :title="title" --> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-divider |
| | | orientation="center" |
| | | style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;" |
| | | > ç产设å¤ä¸çº§ä¿å
»éªæ¶å </a-divider> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="设å¤åç§°" |
| | | > |
| | | <span v-if="this.model != null">{{ this.model.equipmentName }}</span> |
| | | <span v-else>-</span> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="设å¤åå·" |
| | | > |
| | | <span v-if="this.model != null">{{ this.model.equipmentModel }}</span> |
| | | <span v-else>-</span> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="ç»ä¸ç¼ç " |
| | | > |
| | | <span v-if="this.model != null">{{ this.model.equipmentNum }}</span> |
| | | <span v-else>-</span> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </a-spin> |
| | | <a-table |
| | | ref="table" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="false" |
| | | > |
| | | <!-- @change="handleTableChange" --> |
| | | <!-- :pagination="ipagination" --> |
| | | <template |
| | | v-for="col in columns" |
| | | :slot="col.dataIndex" |
| | | slot-scope='text, record, index' |
| | | > |
| | | <div :key="col.dataIndex"> |
| | | <a-input |
| | | :value="text" |
| | | v-if="col.dataIndex == 'position'" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | :disabled="false" |
| | | placeholder="请è¾å
¥ä¿å
»é¨ä½" |
| | | /> |
| | | <a-textarea |
| | | :value="text" |
| | | v-if="col.dataIndex == 'content'" |
| | | :maxLength="500" |
| | | auto-size |
| | | placeholder="请è¾å
¥ä¿å
Ȍ
容" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | /> |
| | | <a-textarea |
| | | :value="text" |
| | | v-if="col.dataIndex == 'standard'" |
| | | :maxLength="500" |
| | | auto-size |
| | | placeholder="请è¾å
¥ä¿å
»æ å" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | :disabled="false" |
| | | /> |
| | | <a-input |
| | | :value="text" |
| | | v-if="col.dataIndex == 'firstInspect'" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | :disabled="false" |
| | | placeholder="请è¾å
¥ç¬¬ä¸æ¬¡æ£" |
| | | /> |
| | | <a-input |
| | | :value="text" |
| | | v-if="col.dataIndex == 'secondInspect'" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | :disabled="false" |
| | | placeholder="请è¾å
¥ç¬¬äºæ¬¡æ£" |
| | | /> |
| | | |
| | | </div> |
| | | </template> |
| | | </a-table> |
| | | <div :style="{height: '60px',width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="æ£æ¥äººå" |
| | | > |
| | | <span v-if="this.model != null">{{ this.model.inspectUser}}</span> |
| | | <span v-else>-</span> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="æ£æ¥æ¥æ" |
| | | > |
| | | <span v-if="this.model != null">{{ this.model.inspectDate }}</span> |
| | | <span v-else>-</span> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </div> |
| | | <a-button |
| | | style="width: 100%; margin-top: 0px; margin-bottom: 8px" |
| | | type="dashed" |
| | | icon="plus" |
| | | @click="addHour" |
| | | >æ·»å å
容</a-button> |
| | | <template slot="footer"> |
| | | <a-button |
| | | :style="{marginRight: '8px'}" |
| | | @click="handleCancel()" |
| | | >å
³é</a-button> |
| | | <a-button |
| | | @click="handleOk()" |
| | | type="primary" |
| | | :loading="confirmLoading" |
| | | :disabled="disableSubmit || confirmLoading" |
| | | >ç¡®å®</a-button> |
| | | </template> |
| | | </a-modal> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction, postAction, requestPut } from '@/api/manage' |
| | | import pick from 'lodash.pick' |
| | | import JMultiSelectTag from '@/components/dict/JMultiSelectTag' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { ACCESS_TOKEN } from '@/store/mutation-types' |
| | | import { getFileAccessHttpUrl } from '@/api/manage'; |
| | | |
| | | export default { |
| | | name: "Maintenance3ReceiptModal", |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | JMultiSelectTag, |
| | | Tooltip, |
| | | }, |
| | | data() { |
| | | return { |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | width: 50, |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¨ä½', |
| | | align: 'center', |
| | | dataIndex: 'position', |
| | | scopedSlots: { customRender: 'position' } |
| | | }, |
| | | { |
| | | title: 'ä¿å
Ȍ
容', |
| | | align: 'center', |
| | | dataIndex: 'content', |
| | | scopedSlots: { customRender: 'content' } |
| | | }, |
| | | { |
| | | title: 'éªæ¶æ å', |
| | | align: 'center', |
| | | dataIndex: 'standard', |
| | | scopedSlots: { customRender: 'standard' } |
| | | }, |
| | | { |
| | | title: 'ç¬¬ä¸æ¬¡æ£', |
| | | align: 'center', |
| | | dataIndex: 'firstInspect', |
| | | scopedSlots: { customRender: 'firstInspect' } |
| | | }, |
| | | { |
| | | title: 'ç¬¬äºæ¬¡æ£', |
| | | align: 'center', |
| | | dataIndex: 'secondInspect', |
| | | scopedSlots: { customRender: 'secondInspect' } |
| | | }, |
| | | ], |
| | | title: "æä½", |
| | | visible: false, |
| | | disableSubmit: false, |
| | | codeDisable: true, |
| | | dataSource: [], |
| | | model: {}, |
| | | departs: [], |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | }, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | url: { |
| | | add: "/eam/maintenanceThreeAcceptance/add", |
| | | getMaintenance3Receipt: "/eam/maintenanceThreeAcceptance/getMaintenanceThreeAcceptanceList", |
| | | list: "/eam/dailyMaintenanceOrder/getMaintenanceCycleByStandardId", |
| | | }, |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | addHour() { |
| | | this.dataSource.push({ id: '', maintenanceOrderId: this.model.id, position: '', content: '', standard: '', firstInspect: '', secondInspect: '' }) |
| | | }, |
| | | |
| | | edit(record) { |
| | | let that = this; |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | this.getMaintenance3Receipt() |
| | | that.$nextTick(() => { |
| | | // that.form.setFieldsValue(pick(that.model, 'num', 'teamId', 'remark')); |
| | | }); |
| | | |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close(); |
| | | }, |
| | | |
| | | getMaintenance3Receipt() { |
| | | getAction(this.url.getMaintenance3Receipt, { maintenanceOrderId: this.model.id }).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleOk() { |
| | | |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | that.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | this.$confirm({ |
| | | title: 'ç产设å¤ä¸çº§ä¿å
»éªæ¶å', |
| | | content: 'æç¤ºï¼è¯·è°¨æ
æä½ï¼', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk() { |
| | | let formData = Object.assign(that.model, values); |
| | | formData.maintenanceOrderId = that.model.id |
| | | formData.maintenanceThreeAcceptances = that.dataSource |
| | | that.confirmLoading = true; |
| | | postAction(that.url.add, formData).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.$emit('ok', new Date()); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | }, |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleChange(value, key, column, index) { |
| | | let that = this; |
| | | const temp = [...that.dataSource]; |
| | | const target = temp.filter(item => key === item.key)[index]; |
| | | if (target) { |
| | | if (column.dataIndex == 'position') { |
| | | target[column.dataIndex] = value.target.value; |
| | | } |
| | | if (column.dataIndex == 'content') { |
| | | target[column.dataIndex] = value.target.value; |
| | | } |
| | | if ('standard' == column.dataIndex) { |
| | | target['standard'] = value.target.value; |
| | | } |
| | | if (column.dataIndex == 'firstInspect') { |
| | | target[column.dataIndex] = value.target.value; |
| | | } |
| | | if (column.dataIndex == 'secondInspect') { |
| | | target[column.dataIndex] = value.target.value; |
| | | } |
| | | //æ¾ç¤ºå¸¦è¿æ¥çæ°æ® |
| | | that.dataSource = temp; |
| | | } |
| | | }, |
| | | |
| | | }, |
| | | } |
| | | </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; |
| | | } |
| | | .hightColor { |
| | | height: 10%; |
| | | font-weight: bold; |
| | | font-size: 20px; |
| | | color: #1b1e1e; |
| | | } |
| | | .frozenRowClass { |
| | | color: #c9c9c9; |
| | | } |
| | | .fontweight { |
| | | font-weight: bold; |
| | | } |
| | | .hight { |
| | | color: #f5222d; |
| | | } |
| | | /deep/ .red { |
| | | color: red; |
| | | } |
| | | |
| | | .line { |
| | | width: 1px; |
| | | height: 300px; |
| | | background-color: #000; |
| | | border: none; |
| | | float: left; |
| | | } |
| | | </style> |