¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="1200" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | centered |
| | | :visible="visible" |
| | | :mask-closable="false" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | |
| | | <a-spin :spinning="spinning"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="standardCode" label="å·¥å
·ç¼å·"> |
| | | <a-input-search v-model="model.toolId" placeholder="è¯·éæ©å·¥å
·ç¼å·" :disabled="disableSubmit" |
| | | @search="selectTools" enter-button |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="classify_id" label="å·¥å
·åç±»ç¼ç "> |
| | | <a-input placeholder="请è¾å
¥å·¥å
·åç±»åç§°" v-model="model.classifyId" readOnly :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="paramaTableName" label="å·¥å
·åæ°æ è¯"> |
| | | <a-input placeholder="éæ©è®¾å¤åèªå¨å¸¦åº" readOnly v-model="model.paramaTableName" readOnly |
| | | :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å·¥å
፱Ȍ"> |
| | | <a-input placeholder="éæ©è®¾å¤åèªå¨å¸¦åº" v-model="model.applicationType" readOnly |
| | | :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="responsiblePerson" label="责任人"> |
| | | <j-dict-select-tag type="list" v-model="model.responsiblePerson" dictCode="sys_user,realname,id" |
| | | placeholder="è¯·éæ©è´£ä»»äºº" :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å磨æ¶é´" prop="sharpeningTime"> |
| | | <j-date placeholder="è¯·éæ©å磨æ¶é´" date-format="YYYY-MM-DD HH:mm:ss" v-model="model.sharpeningTime" |
| | | style="width: 100%" :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="åç£¨ç»æå建议" prop="sharpeningResult"> |
| | | <a-textarea placeholder="鿩填ååç£¨ç»æå建议" v-model="model.sharpeningResult" |
| | | :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="åå·/å¾å·"> |
| | | <a-input placeholder="鿩填ååå·/å¾å·" v-model="model.toolModel" :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="ä»åºåå¸" prop="inspectionDate"> |
| | | <a-input placeholder="鿩填åä»åºç份åå¸" v-model="model.provinceCity" readOnly |
| | | :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="åºåº/åºå·"> |
| | | <a-input placeholder="鿩填ååºåº/åºå·" v-model="model.warehouseId" readOnly :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="åå¨ä½ç½®" prop="storageLocation"> |
| | | <a-input placeholder="鿩填ååå¨ä½ç½®" v-model="model.positionCode" readOnly |
| | | :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="计é主åä½"> |
| | | <a-input placeholder="请填å计é主åä½" v-model="model.mainUnit" readOnly :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="åå¨ä½ç½®" prop="storageLocation"> |
| | | <a-input placeholder="鿩填ååå¨ä½ç½®" v-model="model.positionCode" readOnly |
| | | :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="夿³¨"> |
| | | <a-textarea v-model="model.remark" rows="3" placeholder="请è¾å
¥å¤æ³¨" :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | <template slot="footer"> |
| | | <a-button :style="{ marginRight: '8px' }" @click="handleCancel()"> |
| | | å
³é |
| | | </a-button> |
| | | |
| | | <a-button @click="handleOk()" :disabled="disableSubmit" type="primary" :loading="confirmLoading">ç¡®å®</a-button> |
| | | </template> |
| | | <tools-modal ref="toolListModel"></tools-modal> |
| | | |
| | | |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction, postAction, requestPut } from '@/api/manage' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import ToolsModal from '@views/tms/requirement/modules/ToolsModal.vue' |
| | | |
| | | export default { |
| | | name: 'ToolsSharpeningModal', |
| | | mixins: [JVxeTableModelMixin], |
| | | components: { |
| | | ToolsModal |
| | | }, |
| | | data() { |
| | | return { |
| | | title: 'æä½', |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 15 } |
| | | }, |
| | | confirmLoading: false, |
| | | spinning: false, |
| | | disabled: false, |
| | | disableSubmit: false, |
| | | validatorRules: { |
| | | |
| | | sharpeningTime: [ |
| | | { required: true, message: 'è¯·éæ©åç£¨æ¥æ!' } |
| | | ], |
| | | responsiblePerson: [ |
| | | { required: true, message: 'è¯·éæ©è´£ä»»äºº!' } |
| | | ], |
| | | sharpeningResult: [ |
| | | { required: true, message: '请è¾å
¥åç£¨ç»æå建议!' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/tms/toolSharpening/add', |
| | | edit: '/tms/toolSharpening/edit', |
| | | queryDetailList: '/tms/toolSharpening/listToolSharpening' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | console.log('selectionRows', data) |
| | | if (data && data.length > 0) { |
| | | const item = data[0] |
| | | // ä½¿ç¨ $set ç¡®ä¿ model ç屿§æ¯ååºå¼ç |
| | | this.$set(this.model, 'toolId', item.toolCode) |
| | | this.$set(this.model, 'toolCode', item.id) |
| | | this.$set(this.model, 'classifyId', item.classifyId) |
| | | this.$set(this.model, 'paramaTableName', item.paramaTableName_dictText) |
| | | this.$set(this.model, 'applicationType', item.applicationType_dictText) |
| | | this.$set(this.model, 'toolModel', item.toolModel) |
| | | this.$set(this.model, 'provinceCity', item.provinceCity) |
| | | this.$set(this.model, 'warehouseId', item.warehouseId) |
| | | this.$set(this.model, 'positionCode', item.positionCode) |
| | | this.$set(this.model, 'mainUnit', item.mainUnit) |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | methods: { |
| | | |
| | | selectTools: function() { |
| | | this.$refs.toolListModel.showModals() |
| | | this.$refs.toolListModel.title = '鿩工å
·ä¿¡æ¯' |
| | | this.$refs.toolListModel.disableSubmit = false |
| | | }, |
| | | |
| | | add() { |
| | | this.addShow = false |
| | | this.edit() |
| | | }, |
| | | |
| | | edit(record) { |
| | | console.log(record) |
| | | // this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | getAction(this.url.queryDetailList, { |
| | | id: record.id, |
| | | pageNo: 1, |
| | | pageSize: 99999 |
| | | }).then((res) => { |
| | | if (res.success) { |
| | | const readOnlyData = res.result.records[0] || {} |
| | | this.model = Object.assign({}, this.model, { |
| | | paramaTableName: readOnlyData.paramaTableName_dictText, |
| | | applicationType: readOnlyData.applicationType_dictText, |
| | | provinceCity: readOnlyData.provinceCity, |
| | | warehouseId: readOnlyData.warehouseId, |
| | | positionCode: readOnlyData.positionCode, |
| | | mainUnit: readOnlyData.mainUnit, |
| | | toolModel: readOnlyData.toolModel |
| | | }) |
| | | |
| | | } else { |
| | | this.dataSource = null |
| | | } |
| | | }) |
| | | }, |
| | | handleOk() { |
| | | const that = this |
| | | that.confirmLoading = true |
| | | |
| | | // â
触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | let formData = Object.assign(this.model) |
| | | |
| | | 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') |
| | | that.close() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | }) |
| | | } else { |
| | | that.$message.warning('请填åå¿
å¡«åæ®µ') |
| | | that.confirmLoading = false |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.$refs.form.clearValidate() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |