¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title='title' |
| | | :width='width' |
| | | :visible='visible' |
| | | :confirmLoading='confirmLoading' |
| | | switchFullscreen |
| | | @ok='handleOk' |
| | | @cancel='handleCancel' |
| | | cancelText='å
³é'> |
| | | <a-spin :spinning='confirmLoading'> |
| | | <a-form-model ref='form' :model='model' :rules='validatorRules'> |
| | | |
| | | <a-row style='width: 100%'> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='å¤ä»¶ç¼ç ' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='spareNum'> |
| | | <a-input v-model='model.spareNum' placeholder='请è¾å
¥å¤ä»¶ç¼ç '></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='å¤ä»¶åç§°' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='spareNum'> |
| | | <a-input v-model='model.spareName' placeholder='请è¾å¤ä»¶åç§°'></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | <a-row style='width: 100%'> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='è§æ ¼' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='model'> |
| | | <a-input v-model='model.specification' placeholder='请è¾å
¥è§æ ¼'></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='åå·' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='model'> |
| | | <a-input v-model='model.model' placeholder='请è¾å
¥è§æ ¼åå·' /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row style='width: 100%'> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='åä½' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='mainUnitId'> |
| | | <!-- <a-input v-model='model.mainUnitId' placeholder='请è¾å
¥ä¸»åä½' />--> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :placeholder="'è¯·éæ©åä½'" |
| | | v-model='model.departId' |
| | | dictCode="mom_base_unit,name,id,del_flag!='1'" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <!-- <a-col :span='12'> |
| | | <a-form-model-item label='è¾
åä½' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='auxiliaryUnitId'> |
| | | <!– <a-input v-model='model.auxiliaryUnitId' placeholder='请è¾å
¥è¾
åä½' />–> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :placeholder="'è¯·éæ©è¾
åä½'" |
| | | v-model='model.departId' |
| | | dictCode="mom_base_unit,name,id,del_flag!='1'" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col>--> |
| | | </a-row> |
| | | <a-row style='width: 100%'> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='主æ°é' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='mainQuantity'> |
| | | <a-input-number v-model='model.mainQuantity' placeholder='请è¾å
¥ä¸»æ°é' /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='è¾
æ°é' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='auxiliaryQuantity'> |
| | | <a-input-number v-model='model.auxiliaryQuantity' placeholder='请è¾å
¥è¾
æ°é' style='width: 100%' /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'SpareRequirementSelectModal', |
| | | components: {}, |
| | | props: { |
| | | mainId: { |
| | | type: String, |
| | | required: false, |
| | | default: '' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | title: 'æä½', |
| | | width: 800, |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 } |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | physicalCountQuantity: [ |
| | | { required: false }, |
| | | { pattern: /^-?\d+\.?\d*$/, message: '请è¾å
¥æ°å!' } |
| | | ], |
| | | quantityVariance: [ |
| | | { required: false }, |
| | | { pattern: /^-?\d+\.?\d*$/, message: '请è¾å
¥æ°å!' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/spare/sparePartScrap/add', |
| | | edit: '/spare/sparePartScrap/edit' |
| | | } |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | //å¤ä»½modelåå§å¼ |
| | | /* this.modelDefault = JSON.parse(JSON.stringify(this.model))*/ |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit(this.model) |
| | | }, |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.$refs.form.clearValidate() |
| | | }, |
| | | |
| | | handleOk() { |
| | | this.$bus.$emit('dataSource', this.model) |
| | | this.searchReset(0) |
| | | this.close() |
| | | }, |
| | | |
| | | /* handleOk() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let httpurl = '' |
| | | let method = '' |
| | | if (!this.model.id) { |
| | | httpurl += this.url.add |
| | | method = 'post' |
| | | } else { |
| | | httpurl += this.url.edit |
| | | method = 'put' |
| | | } |
| | | this.model['sparePartScrapId'] = this.mainId |
| | | httpAction(httpurl, this.model, method).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() |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | },*/ |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | popupCallback(value, row) { |
| | | this.model = Object.assign(this.model, row) |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |