| | |
| | | type="primary" |
| | | icon="plus" |
| | | >æ°å¢</a-button> |
| | | |
| | | <a-button |
| | | @click="handleInto" |
| | | type="primary" |
| | | icon="plus" |
| | | >å
¥åº</a-button> |
| | | <!-- <a-button |
| | | type="primary" |
| | | icon="download" |
| | |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></eamSpareParts-modal> |
| | | |
| | | <eamSpare-part-into-modal |
| | | ref="intoModalForm" |
| | | @ok="modalFormOk" |
| | | ></eamSpare-part-into-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | |
| | | import '@assets/less/TableExpand.less' |
| | | import EamSparePartsModal from './modules/EamSpareParts/EamSparePartsModal.vue' |
| | | import EamSparePartInventoryList from './modules/EamSpareParts/EamSparePartInventoryList.vue' |
| | | import EamSparePartIntoModal from './modules/EamSpareParts/EamSparePartIntoModal.vue' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | EamSparePartsModal, |
| | | EamSparePartInventoryList |
| | | EamSparePartInventoryList, |
| | | EamSparePartIntoModal |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | dataIndex: 'inventoryWarning' |
| | | }, |
| | | { |
| | | title: 'åºåæ»æ°', |
| | | align: "center", |
| | | dataIndex: 'totalQuantity' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: "center", |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | handleInto() { |
| | | this.$refs.intoModalForm.add(); |
| | | this.$refs.intoModalForm.title = "å
¥åº"; |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.onClearSelected() |
| | | this.loadData(1); |
| | | }, |
| | | searchQuery() { |
| | | this.onClearSelected() |
| | | this.loadData(1); |
| | | }, |
| | | clickThenSelect(record) { |
| | | return { |
| | | on: { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="1500" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | centered |
| | | :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"> |
| | | <j-vxe-table |
| | | ref="editableDetailTable" |
| | | :rowNumber="true" |
| | | :rowSelection="true" |
| | | :bordered="true" |
| | | :alwaysEdit="true" |
| | | :toolbar="true" |
| | | keep-source |
| | | :height="300" |
| | | :loading="detail.loading" |
| | | :dataSource="detail.dataSource" |
| | | :columns="detail.columns" |
| | | style="margin-top: 8px;" |
| | | /> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction, httpAction } from '@/api/manage' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | |
| | | export default { |
| | | name: 'EamSparePartIntoModal', |
| | | mixins: [JVxeTableModelMixin], |
| | | components: {}, |
| | | 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, |
| | | validatorRules: {}, |
| | | url: { |
| | | add: '/eam/eamSparePartInventory/add', |
| | | edit: '/eam/eamSparePartInventory/edit', |
| | | }, |
| | | detail: { |
| | | loading: false, |
| | | dataSource: [], |
| | | columns: [ |
| | | { |
| | | title: 'æ¥æºç±»å', |
| | | key: 'sparePartIntoType', |
| | | type: JVXETypes.hidden, |
| | | width: '12%', |
| | | align: 'center', |
| | | defaultValue: '1', |
| | | validateRules: [ |
| | | { required: true, message: 'å¤ä»¶ä¸è½ä¸ºç©ºï¼' } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶', |
| | | key: 'sparePartId', |
| | | type: JVXETypes.select, |
| | | width: '12%', |
| | | align: 'center', |
| | | dictCode: 'eam_spare_parts,part_name,id, del_flag!=\'1\'', |
| | | validateRules: [ |
| | | { required: true, message: 'å¤ä»¶ä¸è½ä¸ºç©ºï¼' } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'æ¹æ¬¡å·', |
| | | key: 'batchNum', |
| | | type: JVXETypes.input, |
| | | width: '10%', |
| | | align: 'center', |
| | | validateRules: [ |
| | | { required: true, message: 'æ¹æ¬¡å·ä¸è½ä¸ºç©ºï¼' } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'æ°é', |
| | | key: 'inventory', |
| | | type: JVXETypes.inputNumber, |
| | | width: '10%', |
| | | align: 'center', |
| | | validateRules: [ |
| | | { required: true, message: 'æ°éä¸è½ä¸ºç©ºï¼' } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'åºåæ¥æ(çäº§æ¥æ)', |
| | | key: 'manufactureDate', |
| | | type: JVXETypes.datetime, |
| | | width: '16%', |
| | | align: 'center', |
| | | validateRules: [ |
| | | { required: false, message: 'åºåæ¥æ(çäº§æ¥æ)ä¸è½ä¸ºç©ºï¼' } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'ä¾åºå', |
| | | key: 'supplier', |
| | | type: JVXETypes.textarea, |
| | | width: '15%', |
| | | align: 'center', |
| | | validateRules: [ |
| | | { required: false, message: 'ä¾åºåä¸è½ä¸ºç©ºï¼' } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'æªæ¢æææ', |
| | | key: 'expirationOfValidity', |
| | | type: JVXETypes.datetime, |
| | | width: '16%', |
| | | align: 'center', |
| | | validateRules: [ |
| | | { required: false, message: 'æªæ¢æææä¸è½ä¸ºç©ºï¼' } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'åæ¾ä½ç½®', |
| | | key: 'location', |
| | | type: JVXETypes.textarea, |
| | | width: '13%', |
| | | align: 'center', |
| | | validateRules: [ |
| | | { required: false, message: 'åæ¾ä½ç½®ä¸è½ä¸ºç©ºï¼' } |
| | | ] |
| | | }, |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.model = {} |
| | | this.detail.dataSource = [] |
| | | this.visible = true |
| | | }, |
| | | |
| | | |
| | | async handleOk() { |
| | | const that = this |
| | | let errMap = await that.$refs.editableDetailTable.validateTable() |
| | | if (errMap) { |
| | | this.$message.warning('æ°æ®æ ¡éªå¤±è´¥ï¼') |
| | | return |
| | | } |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | let tableData = that.$refs.editableDetailTable.getTableData() |
| | | let removeData = that.$refs.editableDetailTable.getDeleteData() |
| | | that.model.eamSparePartInventories = [...tableData] |
| | | that.model.removeDetailList = [...removeData] |
| | | |
| | | that.confirmLoading = that.spinning = true |
| | | let httpurl = '' |
| | | let method = '' |
| | | if (!this.model.id) { |
| | | httpurl += this.url.add |
| | | method = 'post' |
| | | } else { |
| | | httpurl += this.url.edit |
| | | method = 'put' |
| | | } |
| | | httpAction(httpurl, this.model, method).then((res) => { |
| | | |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.$emit('ok') |
| | | that.close() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = that.spinning = false |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.$refs.form.clearValidate() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | </style> |
| | |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | // { |
| | | // title: 'å¤åå¤ä»¶ID', |
| | | // align: "center", |
| | | // dataIndex: 'sparePartId' |
| | | // }, |
| | | { |
| | | title: 'æ¥æºç±»å', |
| | | align: "center", |
| | | dataIndex: 'sparePartIntoType_dictText' |
| | | }, |
| | | { |
| | | title: 'æ¹æ¬¡å·', |
| | | align: "center", |
| | |
| | | align: "center", |
| | | dataIndex: 'location' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: "center", |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | // { |
| | | // title: 'æä½', |
| | | // dataIndex: 'action', |
| | | // align: "center", |
| | | // scopedSlots: { customRender: 'action' }, |
| | | // } |
| | | ], |
| | | url: { |
| | | list: "/eam/eamSparePartInventory/list", |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="800" |
| | | :width="900" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |