From cb72d2778e1e6e783e0a96b4d154c289357b26aa Mon Sep 17 00:00:00 2001 From: houjie <714924425@qq.com> Date: 星期二, 29 八月 2023 14:32:27 +0800 Subject: [PATCH] 备件模块/添加编码规则 --- src/views/spare/modules/sparePartReceive/SparePartReceiveForm.vue | 13 + src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue | 260 +++++++++++++++++++------------- src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue | 10 + src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue | 13 + src/views/spare/modules/sparePartReceive/SpareSelectList.vue | 19 - src/views/spare/modules/sparePart/SparePart2List.vue | 6 src/views/spare/modules/sparePartCancellingStocks/SparePartCancellingStocksModal.vue | 10 + src/views/spare/modules/sparePartScrap/SpareSelectList.vue | 133 +++++++-------- src/views/spare/modules/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue | 12 + 9 files changed, 278 insertions(+), 198 deletions(-) diff --git a/src/views/spare/modules/sparePart/SparePart2List.vue b/src/views/spare/modules/sparePart/SparePart2List.vue index 3e04e11..f18402c 100644 --- a/src/views/spare/modules/sparePart/SparePart2List.vue +++ b/src/views/spare/modules/sparePart/SparePart2List.vue @@ -76,7 +76,7 @@ <a-icon type="down" /> </a-button> <a-menu slot="overlay" > - <a-menu-item @click="batchDel" v-has="'sparePartList:delete'"> + <a-menu-item @click="batchDel"> <a-icon type="delete" />鍒犻櫎 </a-menu-item> </a-menu> @@ -113,11 +113,11 @@ 鏇村 <a-icon type="down" /> </a> - <a-menu slot="overlay"> + <a-menu slot="overlay" v-has="'sparePartList:delete'"> <!-- <a-menu-item> <a @click="handleEdit(record)">缂栬緫</a> </a-menu-item> --> - <a-menu-item> + <a-menu-item > <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)" diff --git a/src/views/spare/modules/sparePartCancellingStocks/SparePartCancellingStocksModal.vue b/src/views/spare/modules/sparePartCancellingStocks/SparePartCancellingStocksModal.vue index c75fab6..5e2810f 100644 --- a/src/views/spare/modules/sparePartCancellingStocks/SparePartCancellingStocksModal.vue +++ b/src/views/spare/modules/sparePartCancellingStocks/SparePartCancellingStocksModal.vue @@ -19,7 +19,7 @@ :wrapperCol='wrapperCol' > <a-input - :disabled="disableSubmit" + :disabled="true" placeholder='璇疯緭鍗曟嵁鍙�' v-decorator="['num', validatorRules.num]" /> @@ -319,6 +319,7 @@ url: { add: '/spare/sparePartCancellingStocks/add', getSysDeparts: "/eam/equipment/getSysDeparts", + getNum: '/eam/sysIdentity/getNumNew', loadOptions: '/sys/sysDepart/loadDepartTreeOptions', edit: '/spare/sparePartCancellingStocks/edit' }, @@ -418,6 +419,13 @@ this.codeDisable = true } else { this.codeDisable = false + this.$nextTick(() => { + getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => { + if (res.success) { + this.form.setFieldsValue({ num: res.message }); + } + }) + }); } }, diff --git a/src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue b/src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue index 65cdd60..9542396 100644 --- a/src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue +++ b/src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue @@ -20,7 +20,7 @@ > <a-input placeholder="璇疯緭鐢宠鍗曠紪鐮�" - :disabled="disableSubmit" + :disabled="true" v-decorator="['num', validatorRules.num]" /> </a-form-item> @@ -313,6 +313,7 @@ add: "/spare/sparePartOutbound/add", loadOptions: '/sys/sysDepart/loadDepartTreeOptions', getSysDeparts: "/eam/equipment/getSysDeparts", + getNum: '/eam/sysIdentity/getNumNew', edit: "/spare/sparePartOutbound/edit", }, @@ -401,6 +402,13 @@ this.codeDisable = true; } else { this.codeDisable = false; + this.$nextTick(() => { + getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => { + if (res.success) { + this.form.setFieldsValue({ num: res.message }); + } + }) + }); } }, initOptions() { diff --git a/src/views/spare/modules/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue b/src/views/spare/modules/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue index 930239a..ed23d13 100644 --- a/src/views/spare/modules/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue +++ b/src/views/spare/modules/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue @@ -20,7 +20,7 @@ > <a-input placeholder='璇疯緭鍏ュ簱鍗曠紪鍙�' - :disabled="disableSubmit" + :disabled="true" v-decorator="['num', validatorRules.num]" /> </a-form-item> @@ -353,7 +353,8 @@ getSuppliers: '/spare/sparePartPurchaseStorageDeatil/getSuppliers', getWarehouseAreas: '/spare/sparePartPurchaseStorageDeatil/getWarehouseAreas', getWarehouseLocations: '/spare/sparePartPurchaseStorageDeatil/getWarehouseLocations', - getWarehouses: '/base/warehouse/queryById' + getWarehouses: '/base/warehouse/queryById', + getNum: '/eam/sysIdentity/getNumNew', }, dataSource: [] @@ -430,6 +431,13 @@ this.codeDisable = true } else { this.codeDisable = false + this.$nextTick(() => { + getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => { + if (res.success) { + this.form.setFieldsValue({ num: res.message }); + } + }) + }); } }, initOptions() { diff --git a/src/views/spare/modules/sparePartReceive/SparePartReceiveForm.vue b/src/views/spare/modules/sparePartReceive/SparePartReceiveForm.vue index f64c147..eb4cd6c 100644 --- a/src/views/spare/modules/sparePartReceive/SparePartReceiveForm.vue +++ b/src/views/spare/modules/sparePartReceive/SparePartReceiveForm.vue @@ -6,7 +6,7 @@ <a-row> <a-col :span='12'> <a-form-model-item label='鍗曟嵁鍙�' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='num'> - <a-input v-model='model.num' placeholder='璇疯緭鍏ュ崟鎹彿'></a-input> + <a-input v-model='model.num' placeholder='璇疯緭鍏ュ崟鎹彿' :disabled="true"></a-input> </a-form-model-item> </a-col> <a-col :span='12'> @@ -345,6 +345,7 @@ edit: '/spare/sparePartReceive/edit', getSysDeparts: "/eam/equipment/getSysDeparts", loadOptions: '/sys/sysDepart/loadDepartTreeOptions', + getNum: '/eam/sysIdentity/getNumNew', sparesReceiveDetail: { list: '/spare/sparePartReceive/querySparePartReceiveDeatilByMainId' } @@ -373,8 +374,18 @@ }, created() { this.initOptions(); + this.initNum() }, methods: { + initNum() { + getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => { + if (res.success) { + this.model.num = res.message + + /* this.model.setFieldsValue({ num: res.message }); */ + } + }) + }, getSysDeparts() { getAction(this.url.getSysDeparts).then((res) => { if (res.success) { diff --git a/src/views/spare/modules/sparePartReceive/SpareSelectList.vue b/src/views/spare/modules/sparePartReceive/SpareSelectList.vue index 8724e64..d0dd846 100644 --- a/src/views/spare/modules/sparePartReceive/SpareSelectList.vue +++ b/src/views/spare/modules/sparePartReceive/SpareSelectList.vue @@ -71,63 +71,54 @@ { title: '澶囦欢缂栫爜', align: 'center', - fixed: 'left', dataIndex: 'spareNum', - width: 150, ellipsis: true }, { title: '澶囦欢鍚嶇О', align: 'center', - fixed: 'left', dataIndex: 'spareName', - width: 150, ellipsis: true }, { title: '鍨嬪彿', align: 'center', dataIndex: 'model', - fixed: 'left', - width: 150 + }, { title: '瑙勬牸', align: 'center', dataIndex: 'specification', - width: 150, ellipsis: true }, { title: '鎵规鍙�', align: 'center', dataIndex: 'batchNum', - width: 150, + }, { title: '鍒堕�犲晢', align: 'center', dataIndex: 'constructorName', - width: 150, }, { title: '鍑哄巶鏃ユ湡', align: 'center', dataIndex: 'manufactureDate', - width: 150, + }, { title: '鏈夋晥鏈�', align: 'center', dataIndex: 'validityPeriod', - width: 150, + }, { title: '鍗曚綅', align: 'center', dataIndex: 'mainUnitId_dictText', - width: 150, - }, /* { title: '杈呭崟浣�', align: 'center', @@ -138,7 +129,7 @@ { title: '鏁伴噺', align: 'center', dataIndex: 'mainQuantity', - width: 150 + }, /* { title: '杈呮暟閲�', diff --git a/src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue b/src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue index f101143..2af4bf8 100644 --- a/src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue +++ b/src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue @@ -6,7 +6,7 @@ <a-row> <a-col :span='12'> <a-form-model-item label='鍗曟嵁鍙�' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='num'> - <a-input v-model='model.num' placeholder='璇疯緭鍏ュ崟鎹彿'></a-input> + <a-input v-model='model.num' placeholder='璇疯緭鍏ュ崟鎹彿' :disabled="true"></a-input> </a-form-model-item> </a-col> <a-col :span='12'> @@ -397,6 +397,7 @@ getSysDeparts: "/eam/equipment/getSysDeparts", loadOptions: '/sys/sysDepart/loadDepartTreeOptions', queryById: '/spare/sparePartScrap/queryById', + getNum: '/eam/sysIdentity/getNumNew', sparesScrapDetail: { list: '/spare/sparePartScrap/querySparesScrapDetailByMainId' } @@ -425,8 +426,18 @@ }, created() { this.initOptions() + this.initNum() }, methods: { + initNum() { + getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => { + if (res.success) { + this.model.num = res.message + + /* this.model.setFieldsValue({ num: res.message }); */ + } + }) + }, initOptions() { getAction(this.url.loadOptions).then(res => { if (res.success) { diff --git a/src/views/spare/modules/sparePartScrap/SpareSelectList.vue b/src/views/spare/modules/sparePartScrap/SpareSelectList.vue index 6c1776c..dc28da4 100644 --- a/src/views/spare/modules/sparePartScrap/SpareSelectList.vue +++ b/src/views/spare/modules/sparePartScrap/SpareSelectList.vue @@ -1,19 +1,19 @@ <template> <!--鏀寔鍏ㄥ睆缂╂斁--> - <a-modal :visible='visible' :title='title' switchFullscreen @ok='handleSubmit' @cancel='close' style='top:50px' - cancelText='鍏抽棴' :width='1800'> - <a-card :bordered='false'> - <div class='table-page-search-wrapper'> - <a-form layout='inline' @keyup.enter.native='searchQuery'> - <a-row :gutter='24'> - <a-col :md='6' :sm='4'> - <a-form-item label='澶囦欢缂栫爜'> - <a-input placeholder='璇疯緭鍏ュ浠剁紪鐮�' v-model='queryParam.num'/> + <a-modal :visible="visible" :title="title" switchFullscreen @ok="handleSubmit" @cancel="close" style="top:50px" + cancelText="鍏抽棴" :width="1800"> + <a-card :bordered="false"> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="6" :sm="4"> + <a-form-item label="澶囦欢缂栫爜"> + <a-input placeholder="璇疯緭鍏ュ浠剁紪鐮�" v-model="queryParam.num" /> </a-form-item> </a-col> - <a-col :md='6' :sm='4'> - <a-form-item label='澶囦欢鍚嶇О'> - <a-input placeholder='璇疯緭鍏ュ浠跺悕绉�' v-model='queryParam.name'/> + <a-col :md="6" :sm="4"> + <a-form-item label="澶囦欢鍚嶇О"> + <a-input placeholder="璇疯緭鍏ュ浠跺悕绉�" v-model="queryParam.name" /> </a-form-item> </a-col> <!-- <a-col :md='6' :sm='4'> @@ -22,28 +22,28 @@ dictCode='tooling_category_flag' placeholder='璇烽�夋嫨瀛樿揣鍒嗙被' /> </a-form-item> </a-col> --> - <a-col :md='3'> - <span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'> - <a-button type='primary' @click='searchQuery' icon='search'>鏌ヨ</a-button> - <a-button @click='searchReset' icon='reload' style='margin-left: 10px'>閲嶇疆</a-button> + <a-col :md="3"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button @click="searchReset" icon="reload" style="margin-left: 10px">閲嶇疆</a-button> </span> </a-col> </a-row> </a-form> </div> - <a-row :gutter='24'> - <a-col :md='24' :sm='12'> - <a-table ref='table' - :scroll='{ x: true }' - size='middle' rowKey='id' + <a-row :gutter="24"> + <a-col :md="24" :sm="12"> + <a-table ref="table" + :scroll="{ x: true }" + size="middle" rowKey="id" bordered - :columns='columns' - :dataSource='dataSource' - :pagination='ipagination' - :rowSelection='rowSelection' + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :rowSelection="rowSelection" - :loading='loading' - @change='handleTableChange'> + :loading="loading" + @change="handleTableChange"> </a-table> </a-col> </a-row> @@ -79,87 +79,80 @@ align: 'center', fixed: 'left', dataIndex: 'spareNum', - width: 150, ellipsis: true }, { title: '澶囦欢鍚嶇О', align: 'center', - fixed: 'left', - dataIndex: 'spareName', - width: 150, + dataIndex: 'spareName' }, { title: '瑙勬牸', align: 'center', - dataIndex: 'specification', - width: 150, + dataIndex: 'specification' + }, { title: '鍨嬪彿', align: 'center', - dataIndex: 'model', - width: 150 + dataIndex: 'model' }, { title: '鎵规鍙�', align: 'center', - - dataIndex: 'batchNum', - width: 150, + dataIndex: 'batchNum' }, { title: '鍒堕�犲晢', align: 'center', - dataIndex: 'constructorName', - width: 150, + dataIndex: 'constructorName' }, { title: '鍑哄巶鏃ユ湡', align: 'center', - dataIndex: 'manufactureDate', - width: 150, - }, - { title: '鏈夋晥鏈�', - align: 'center', - dataIndex: 'validityPeriod', - width: 150, + dataIndex: 'manufactureDate' }, - { title: '鍗曚綅', + { + title: '鏈夋晥鏈�', align: 'center', - dataIndex: 'mainUnitId_dictText', - width: 150, + dataIndex: 'validityPeriod' }, - /* { title: '杈呭崟浣�', + { + title: '鍗曚綅', align: 'center', - dataIndex: 'auxiliaryUnitId_dictText', - width: 150 - - }, */ - { title: '搴撳瓨鏁伴噺', - align: 'center', - dataIndex: 'mainQuantity', - width: 150 + dataIndex: 'mainUnitId_dictText' }, - /* { title: '搴撳瓨杈呮暟閲�', - align: 'center', - dataIndex: 'auxiliaryQuantity', - width: 150 + /* { title: '杈呭崟浣�', + align: 'center', + dataIndex: 'auxiliaryUnitId_dictText', + width: 150 - }, */ - /* { - title: '鎹㈢畻姣斾緥', + }, */ + { + title: '搴撳瓨鏁伴噺', align: 'center', - dataIndex: 'conversionRatio' - } */ + dataIndex: 'mainQuantity' + + } + /* { title: '搴撳瓨杈呮暟閲�', + align: 'center', + dataIndex: 'auxiliaryQuantity', + width: 150 + + }, */ + /* { + title: '鎹㈢畻姣斾緥', + align: 'center', + dataIndex: 'conversionRatio' + } */ ], selectedRowKeys: [], oldSelectRows: [], @@ -187,7 +180,7 @@ loading: false, url: { list: '/spare/sparePartScrap/getSpareList' - }, + } } }, computed: { @@ -287,7 +280,7 @@ }, searchQuery() { this.loadData(1) - }, + } } } diff --git a/src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue b/src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue index 29ded9d..c8e3d28 100644 --- a/src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue +++ b/src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue @@ -1,46 +1,46 @@ <template> - <a-spin :spinning='confirmLoading'> - <j-form-container :disabled='formDisabled'> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> <!-- 涓昏〃鍗曞尯鍩� --> - <a-form-model ref='form' :model='model' :rules='validatorRules' slot='detail'> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> <a-row> - <a-col :span='12'> - <a-form-model-item label='鍗曟嵁鍙�' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='num'> - <a-input v-model='model.num' placeholder='璇疯緭鍏ュ崟鎹彿'></a-input> + <a-col :span="12"> + <a-form-model-item label="鍗曟嵁鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num"> + <a-input v-model="model.num" placeholder="璇疯緭鍏ュ崟鎹彿" :disabled="true"></a-input> </a-form-model-item> </a-col> - <a-col :span='12'> - <a-form-model-item label='鐢宠閮ㄩ棬' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='departId'> + <a-col :span="12"> + <a-form-model-item label="鐢宠閮ㄩ棬" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departId"> <!-- <a-input v-model="model.departId" placeholder="璇疯緭鍏ラ鐢ㄩ儴闂↖D" ></a-input>--> -<!-- <j-dict-select-tag - allow-clear - :placeholder="'璇烽�夋嫨鐢宠閮ㄩ棬'" - v-model='model.departId' - dictCode="sys_depart,depart_name,id,del_flag!='1'" - />--> + <!-- <j-dict-select-tag + allow-clear + :placeholder="'璇烽�夋嫨鐢宠閮ㄩ棬'" + v-model='model.departId' + dictCode="sys_depart,depart_name,id,del_flag!='1'" + />--> <a-tree-select style="width: 100%" :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :tree-data="treeData" placeholder="璇烽�夋嫨鐢宠閮ㄩ棬" tree-default-expand-all - v-model='model.departId' + v-model="model.departId" /> -<!-- <a-select - :placeholder="'璇烽�夋嫨鐢宠閮ㄩ棬'" - :options="this.departs" - style="width: 100%" - v-model='model.departId' - />--> + <!-- <a-select + :placeholder="'璇烽�夋嫨鐢宠閮ㄩ棬'" + :options="this.departs" + style="width: 100%" + v-model='model.departId' + />--> </a-form-model-item> </a-col> - <a-col :span='12'> - <a-form-model-item label='澶囨敞' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='remark'> + <a-col :span="12"> + <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> <!-- <a-input v-model="model.userId" placeholder="璇疯緭鍏ラ鐢ㄤ汉鍛業D" ></a-input>--> <a-textarea allow-clear :placeholder="'璇疯緭鍏ュ娉�'" - v-model='model.remark' + v-model="model.remark" /> </a-form-model-item> </a-col> @@ -49,26 +49,26 @@ </a-form-model> </j-form-container> <!-- 瀛愯〃鍗曞尯鍩� --> - <a-tabs v-model='activeKey' @change='handleChangeTabs'> - <a-tab-pane tab='澶囦欢鎶ュ簾鏄庣粏琛�' :key='refKeys[0]' :forceRender='true'> + <a-tabs v-model="activeKey" @change="handleChangeTabs"> + <a-tab-pane tab="澶囦欢鎶ュ簾鏄庣粏琛�" :key="refKeys[0]" :forceRender="true"> <j-vxe-table keep-source - :ref='refKeys[0]' - :loading='sparesScrapRequirementDetailTable.loading' - :columns='sparesScrapRequirementDetailTable.columns' - :dataSource='sparesScrapRequirementDetailTable.dataSource' - :maxHeight='300' - :disabled='formDisabled' - :alwaysEdit='true' - :rowNumber='true' - :bordered='bordered' - :rowSelection='true' - :toolbar='true' - :toolbarConfig='toolbarConfig' + :ref="refKeys[0]" + :loading="sparesScrapRequirementDetailTable.loading" + :columns="sparesScrapRequirementDetailTable.columns" + :dataSource="sparesScrapRequirementDetailTable.dataSource" + :maxHeight="300" + :disabled="formDisabled" + :alwaysEdit="true" + :rowNumber="true" + :bordered="bordered" + :rowSelection="true" + :toolbar="true" + :toolbarConfig="toolbarConfig" > - <template slot='toolbarPrefix'> - <a-button type='primary' @click='selectEquipmentList' :disabled='formDisabled'>閫夋嫨澶囦欢 + <template slot="toolbarPrefix"> + <a-button type="primary" @click="selectEquipmentList" :disabled="formDisabled">閫夋嫨澶囦欢 </a-button> </template> <!-- <template slot='toolbarPrefix'> @@ -78,8 +78,7 @@ </j-vxe-table> </a-tab-pane> </a-tabs> - <spare-select-list ref='SparesSelectModal'></spare-select-list> - <!-- <spare-requirement-select-modal ref='SpareRequirementSelecModal'></spare-requirement-select-modal>--> + <spare-select-list ref="SparesSelectModal"></spare-select-list> </a-spin> </template> @@ -91,7 +90,6 @@ import JFormContainer from '@comp/jeecg/JFormContainer' import SpareSelectList from './SpareSelectList' import { getAction } from '@api/manage' -/*import SpareRequirementSelectModal from './SpareRequirementSelectModal'*/ export default { name: 'SparePartScrapRequirementForm', mixins: [JVxeTableModelMixin], @@ -102,8 +100,8 @@ }, data() { return { - treeData:[], - bordered:true, + treeData: [], + bordered: true, departs: [], labelCol: { xs: { span: 24 }, @@ -145,7 +143,7 @@ title: '澶囦欢缂栫爜', key: 'spareNum', fixed: 'left', - align:'center', + align: 'center', type: JVXETypes.normal, width: '200px', placeholder: '璇疯緭鍏�${title}', @@ -154,7 +152,7 @@ { title: '澶囦欢鍚嶇О', key: 'spareName', - align:'center', + align: 'center', fixed: 'left', type: JVXETypes.normal, width: '200px', @@ -165,7 +163,7 @@ title: '鍨嬪彿', key: 'model', type: JVXETypes.normal, - align:'center', + align: 'center', width: '200px', placeholder: '璇疯緭鍏�${title}', defaultValue: '' @@ -174,7 +172,7 @@ title: '瑙勬牸', key: 'specification', type: JVXETypes.normal, - align:'center', + align: 'center', width: '200px', placeholder: '璇疯緭鍏�${title}', defaultValue: '' @@ -184,7 +182,7 @@ title: '鍗曚綅', key: 'mainUnitIdName', type: JVXETypes.normal, - align:'center', + align: 'center', width: '200px', placeholder: '璇疯緭鍏�${title}', defaultValue: '' @@ -193,50 +191,50 @@ title: '鍗曚綅', key: 'mainUnitId', type: JVXETypes.hidden, - align:'center', + align: 'center', width: '200px', placeholder: '璇疯緭鍏�${title}', defaultValue: '' }, - /* { - title: '杈呭崟浣�', - key: 'auxiliaryUnitIdName', - align:'center', - type: JVXETypes.normal, - width: '200px', - placeholder: '璇疯緭鍏�${title}', - defaultValue: '' - }, - { - title: '杈呭崟浣�', - key: 'auxiliaryUnitId', - type: JVXETypes.hidden, - align:'center', - width: '200px', - placeholder: '璇疯緭鍏�${title}', - defaultValue: '' - }, */ + /* { + title: '杈呭崟浣�', + key: 'auxiliaryUnitIdName', + align:'center', + type: JVXETypes.normal, + width: '200px', + placeholder: '璇疯緭鍏�${title}', + defaultValue: '' + }, + { + title: '杈呭崟浣�', + key: 'auxiliaryUnitId', + type: JVXETypes.hidden, + align:'center', + width: '200px', + placeholder: '璇疯緭鍏�${title}', + defaultValue: '' + }, */ { title: '涓绘暟閲�', key: 'mainQuantity', type: JVXETypes.inputNumber, - align:'center', + align: 'center', width: '200px', placeholder: '璇疯緭鍏�${title}', defaultValue: 0, -/* Function({cellValue, row, column}){ - console.log(cellValue) - console.log(row) - console.log(column) - if (cellValue != null) { - let conversionRatio = row.conversionRatio - console.log(conversionRatio) - row.auxiliaryQuantity = Math.abs(cellValue * conversionRatio) + /* Function({cellValue, row, column}){ + console.log(cellValue) + console.log(row) + console.log(column) + if (cellValue != null) { + let conversionRatio = row.conversionRatio + console.log(conversionRatio) + row.auxiliaryQuantity = Math.abs(cellValue * conversionRatio) - } - console.log(cellValue) - return cellValue - }, */ + } + console.log(cellValue) + return cellValue + }, */ validateRules: [ { required: true, @@ -254,20 +252,20 @@ ] }, - /* { - title: '杈呮暟閲�', - key: 'auxiliaryQuantity', - type: JVXETypes.normal, - width: '200px', - align:'center', - placeholder: '璇疯緭鍏�${title}', - defaultValue: 0 - }, */ + /* { + title: '杈呮暟閲�', + key: 'auxiliaryQuantity', + type: JVXETypes.normal, + width: '200px', + align:'center', + placeholder: '璇疯緭鍏�${title}', + defaultValue: 0 + }, */ { title: '澶囦欢id', key: 'sparePartId', type: JVXETypes.hidden, - align:'center', + align: 'center', width: '200px', placeholder: '璇疯緭鍏�${title}', defaultValue: '' @@ -276,7 +274,7 @@ title: '鎹㈢畻姣斾緥', key: 'conversionRatio', type: JVXETypes.hidden, - align:'center', + align: 'center', width: '200px', placeholder: '璇疯緭鍏�${title}', defaultValue: '' @@ -286,7 +284,7 @@ title: '闇�姹傛棩鏈�', key: 'requirementTime', type: JVXETypes.date, - align:'center', + align: 'center', width: '200px', placeholder: '璇疯緭鍏�${title}', defaultValue: '', @@ -305,7 +303,8 @@ edit: '/spare/sparePartRequirement/edit', queryById: '/spare/sparePartRequirement/queryById', loadOptions: '/sys/sysDepart/loadDepartTreeOptions', - getSysDeparts: "/eam/equipment/getSysDeparts", + getSysDeparts: '/eam/equipment/getSysDeparts', + getNum: '/eam/sysIdentity/getNumNew', sparesScrapRequirementDetail: { list: '/spare/sparePartRequirement/querySparesScrapRequirementDetailByMainId' } @@ -339,8 +338,59 @@ }, created() { this.initOptions() + this.initNum() }, methods: { + + /* edit(record) { + this.form.resetFields(); + this.model = Object.assign({}, record); + this.visible = true; + this.disableSubmit = false; + this.auxiliaryUnits = record.auxiliaryUnits + this.$nextTick(() => { + this.form.setFieldsValue(pick(this.model, + 'num', + 'name', + 'specification', + 'model', + 'constructorId', + 'mainUnitId', + 'auxiliaryUnitId', + 'conversionRatio', + 'validityPeriod', + 'validityPeriodUnitId', + 'inventoryUpperLimit', + 'inventoryLowerLimit', + 'economicOrderQuantity', + 'purchaseLeadTime', + 'inventoryWarnLimit', + 'remark')); + }); + if (record.id) { + this.codeDisable = true; + } else { + this.codeDisable = false; + this.$nextTick(() => { + getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => { + if (res.success) { + this.form.setFieldsValue({ num: res.message }); + } + }) + }); + } + }, */ + + initNum() { + getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => { + if (res.success) { + this.model.num = res.message + + /* this.model.setFieldsValue({ num: res.message }); */ + } + }) + }, + initOptions() { getAction(this.url.loadOptions).then(res => { if (res.success) { @@ -426,8 +476,8 @@ //鏍¢獙鎵�鏈変竴瀵逛竴瀛愯〃琛ㄥ崟 validateSubForm(allValues) { let tableData = this.$refs.sparesScrapRequirementDetail.getTableData() - if(tableData.length == 0){ - this.$message.warning("璇锋坊鍔犲姞鎶ュ簾鏄庣粏!"); + if (tableData.length == 0) { + this.$message.warning('璇锋坊鍔犲姞鎶ュ簾鏄庣粏!') return } return new Promise((resolve, reject) => { @@ -458,14 +508,14 @@ this.visible = false this.$emit('close') this.$refs.form.clearValidate() - }, -/* changeAuxiliaryQuantity(target){ - console.log(target.columnIndex) - let num=target.columnIndex - if (target.columnIndex ===num){ - target.row.auxiliaryQuantity=Math.abs(target.row.conversionRatio*target.row.mainQuantity) - } - } */ + } + /* changeAuxiliaryQuantity(target){ + console.log(target.columnIndex) + let num=target.columnIndex + if (target.columnIndex ===num){ + target.row.auxiliaryQuantity=Math.abs(target.row.conversionRatio*target.row.mainQuantity) + } + } */ } } </script> -- Gitblit v1.9.3