| | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢ç©æä¿¡æ¯-æµè¯</a-button>--> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-spin :spinning="loading"> |
| | | <div> |
| | | <!-- 主表ååºå --> |
| | | <a-table |
| | |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio'}" |
| | | :customRow="customTableRow" |
| | | @change="handleTableChange"> |
| | | <!--ç¶ææ 个æ§å±ç¤º--> |
| | | <span |
| | |
| | | </a-table> |
| | | </div> |
| | | <!-- å表ååºå --> |
| | | <a-tabs v-model="activeKey" @change="handleChangeTabs"> |
| | | <a-tab-pane tab="åºåæç»" :key="refKeys[0]" :forceRender="true"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 10px;"> |
| | | <a-tag color="green" style="font-weight: bold;"> |
| | | åºåæ»éï¼{{ totalInventoryQuantity }} |
| | | </a-tag> |
| | | </div> |
| | | <j-vxe-table |
| | | keep-source |
| | | :ref="refKeys[0]" |
| | | :loading="lswMaterialInventoryTable.loading" |
| | | :columns="lswMaterialInventoryTable.columns" |
| | | :dataSource="lswMaterialInventoryTable.dataSource" |
| | | :maxHeight="300" |
| | | :rowNumber="true" |
| | | :rowSelection="true" |
| | | :toolbar="false" |
| | | /> |
| | | <a-tabs v-model="activeKey"> |
| | | <a-tab-pane tab="åºåæç»" key="lswMaterialInventory" :forceRender="true"> |
| | | <lsw-material-inventory-list ref="lswMaterialInventory" /> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | </a-spin> |
| | |
| | | <script> |
| | | |
| | | import { getAction } from '@/api/manage' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | import JFormContainer from '@/components/jeecg/JFormContainer' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import LswMaterialModal from '@views/lsw/modules/LswMaterialModal.vue' |
| | | import LswMaterialInventoryList from './LswMaterialInventoryList.vue' |
| | | |
| | | export default { |
| | | name: 'LswMaterialForm', |
| | | mixins: [JVxeTableModelMixin, JeecgListMixin], |
| | | name: 'LswMaterialView', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | LswMaterialModal, |
| | | JFormContainer |
| | | LswMaterialInventoryList |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | validatorRules: {}, |
| | | selectedRowKeys: [], // åå§å为空æ°ç»ï¼åéæ¶åå¨å个keyï¼ |
| | | selectedRowData: null, |
| | | refKeys: ['lswMaterialInventory'], |
| | | tableKeys: ['lswMaterialInventory'], |
| | | activeKey: 'lswMaterialInventory', |
| | | columns: [ |
| | | { |
| | |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | // ç©æåºåä¿¡æ¯ |
| | | lswMaterialInventoryTable: { |
| | | loading: false, |
| | | dataSource: [], |
| | | columns: [ |
| | | { |
| | | title: 'æ¹æ¬¡å·', |
| | | key: 'batchNumber', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: 'åºåç±»å', |
| | | key: 'inventoryCategory', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: 'æ°é', |
| | | key: 'quantity', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: 'åºåå°', |
| | | key: 'warehouseName', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: 'åºåç¶æ', |
| | | key: 'inventoryStatus', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '' |
| | | } |
| | | ] |
| | | }, |
| | | url: { |
| | | //searchlikeQuery |
| | | list: '/lsw/lswMaterial/list', |
| | | edit: '/lsw/lswMaterial/edit', |
| | | active: '/lsw/lswMaterial/active', |
| | | inactive: '/lsw/lswMaterial/inactive', |
| | | queryById: '/lsw/lswMaterial/queryById', |
| | | lswMaterialInventory: { |
| | | list: '/lsw/lswMaterial/queryLswMaterialInventoryByMainId' |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | formDisabled() { |
| | | return this.disabled |
| | | }, |
| | | totalInventoryQuantity() { |
| | | if (!this.lswMaterialInventoryTable.dataSource || this.lswMaterialInventoryTable.dataSource.length === 0) { |
| | | return '0' |
| | | } |
| | | return this.lswMaterialInventoryTable.dataSource.reduce((sum, item) => { |
| | | const quantity = Number(item.quantity) || 0 |
| | | return sum + quantity |
| | | }, 0) |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | |
| | | return '' |
| | | }, |
| | | async onSelectChange(selectedRowKeys) { |
| | | this.lswMaterialInventoryTable.loading = true |
| | | // å鿍¡å¼ä¸ï¼selectedRowKeys æ¯æ°ç»ï¼ä½é¿åº¦æå¤ä¸º1 |
| | | console.log('ç¹å»äº---->') |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.lswMaterialInventoryTable.dataSource = [] |
| | | // è·åéä¸è¡ç宿´æ°æ® |
| | | if (selectedRowKeys.length > 0) { |
| | | const selectedId = selectedRowKeys[0] // éä¸è¡çid |
| | | const lswMaterialInventoryResult = await getAction(this.url.lswMaterialInventory.list, { 'id': selectedId }) |
| | | this.lswMaterialInventoryTable.dataSource = lswMaterialInventoryResult.result |
| | | this.lswMaterialInventoryTable.loading = false |
| | | if (selectedRowKeys.length === 1) { |
| | | //å è½½åºåä¿¡æ¯ |
| | | this.$refs.lswMaterialInventory.queryParam.materialId = this.selectedRowKeys[0] |
| | | this.$refs.lswMaterialInventory.loadData(1) |
| | | this.$refs.lswMaterialInventory.statisticsInventory(this.selectedRowKeys[0]) |
| | | }else { |
| | | //åºåä¿¡æ¯æ¸
空 |
| | | this.$refs.lswMaterialInventory.queryParam.materialId = 'null' |
| | | this.$refs.lswMaterialInventory.loadData(1) |
| | | this.$refs.lswMaterialInventory.statisticsInventory('null') |
| | | } |
| | | }, |
| | | handleActive(record) { |
| | |
| | | that.$message.warning(res.message) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | /** |
| | | * èªå®ä¹è¡¨æ ¼è¡ |
| | | * @param record è¡¨æ ¼è¡ä¿¡æ¯ |
| | | * @returns {{style: {cursor: string}, on: {click: *}}} æ ·å¼å¯¹è±¡ä¸äºä»¶æ¹æ³ |
| | | */ |
| | | customTableRow(record) { |
| | | return { |
| | | style: { |
| | | cursor: 'pointer' |
| | | }, |
| | | on: { |
| | | click: () => { |
| | | this.onSelectChange([record.id]) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery" > |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="线边åº"> |
| | | <j-dict-select-tag placeholder="è¯·éæ©çº¿è¾¹åº" v-model="queryParam.warehouseId" |
| | | dictCode="base_line_side_warehouse,warehouse_name,id,del_flag=0 and warehouse_status='1'"></j-dict-select-tag> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="å
¥åºç±»å"> |
| | | <j-dict-select-tag placeholder="è¯·éæ©å
¥åºç±»å" v-model="queryParam.inboundCategory" dictCode="material_inbound_category"></j-dict-select-tag> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ç©æç¼ç "> |
| | | <j-input placeholder="请è¾å
¥ç©æç¼ç " v-model="queryParam.materialNumber"></j-input> |
| | | </a-form-item> |
| | |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>å é¤</a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ <a-icon type="down" /></a-button> |
| | | </a-dropdown> |
| | | <a-button @click="handleAdd('HEAT_TREATMENT_INBOUND')" type="primary" icon="plus">çå¤çå
¥åº</a-button> |
| | | <a-button @click="handleAdd('SMALL_INNER_RING')" type="primary" icon="plus">å°å
åå
¥åº</a-button> |
| | | <a-button @click="handleAdd('MATERIAL_INNER_TRANSFER')" type="primary" icon="plus">é¢çè°æ¨</a-button> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></div> |
| | | </template> |
| | | <template slot="imgSlot" slot-scope="text,record"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ å¾ç</span> |
| | | <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | |
| | | } |
| | | }, |
| | | { |
| | | title:'产线', |
| | | title:'æ¥æºç¼ç ', |
| | | align:"center", |
| | | dataIndex: 'factoryId_dictText' |
| | | dataIndex: 'originalCode' |
| | | }, |
| | | { |
| | | title:'åºåå°', |
| | | title:'æ¥æºåç§°', |
| | | align:"center", |
| | | dataIndex: 'originalName' |
| | | }, |
| | | { |
| | | title:'线边åº', |
| | | align:"center", |
| | | dataIndex: 'warehouseId_dictText' |
| | | }, |
| | |
| | | dataIndex: 'quantity' |
| | | }, |
| | | { |
| | | title:'æ¥æ¶äºº', |
| | | title:'å
¥åºç±»å', |
| | | align:"center", |
| | | dataIndex: 'inboundCategory_dictText' |
| | | }, |
| | | { |
| | | title:'å
¥åºäºº', |
| | | align:"center", |
| | | dataIndex: 'receiver' |
| | | }, |
| | | { |
| | | title:'æ¥æ¶æ¶é´', |
| | | title:'å
¥åºæ¶é´', |
| | | align:"center", |
| | | dataIndex: 'receiveTime' |
| | | }, |
| | | // { |
| | | // title: 'æä½', |
| | | // dataIndex: 'action', |
| | | // align:"center", |
| | | // fixed:"right", |
| | | // width:147, |
| | | // scopedSlots: { customRender: 'action' } |
| | | // } |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/lswmaterialinbound/lswMaterialInbound/list", |
| | | delete: "/lswmaterialinbound/lswMaterialInbound/delete", |
| | | deleteBatch: "/lswmaterialinbound/lswMaterialInbound/deleteBatch", |
| | | exportXlsUrl: "/lswmaterialinbound/lswMaterialInbound/exportXls", |
| | | importExcelUrl: "lswmaterialinbound/lswMaterialInbound/importExcel", |
| | | list: "/lsw/materialInbound/list", |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | }, |
| | | methods: { |
| | | initDictConfig(){ |
| | | |
| | | handleAdd(inboundCategory) { |
| | | this.$refs.modalForm.add(inboundCategory); |
| | | this.$refs.modalForm.title = "æ°å¢"; |
| | | this.$refs.modalForm.disableSubmit = false; |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'int',value:'delFlag',text:'å 餿 è®°',dictCode:''}) |
| | | fieldList.push({type:'string',value:'factoryId',text:'产线ID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'warehouseId',text:'åºåå°ID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'materialNumber',text:'ç©æç¼ç ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'materialName',text:'ç©æåç§°',dictCode:''}) |
| | | fieldList.push({type:'string',value:'batchNumber',text:'æ¹æ¬¡å·',dictCode:''}) |
| | | fieldList.push({type:'int',value:'quantity',text:'å
¥åºæ°é',dictCode:''}) |
| | | fieldList.push({type:'string',value:'receiver',text:'æ¥æ¶äºº',dictCode:''}) |
| | | fieldList.push({type:'datetime',value:'receiveTime',text:'æ¥æ¶æ¶é´'}) |
| | | this.superFieldList = fieldList |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | </a-row> |
| | | </a-form> |
| | | <div style="display: flex; align-items: center; margin-bottom: 10px;"> |
| | | <a-tag color="blue" style="font-weight: bold; font-size: large;"> |
| | | åºåç»è®¡ï¼{{ inventoryStatisticsInfo}} |
| | | </a-tag> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <a-button type="primary" icon="download" @click="handleExportXls('ç©æåºåä¿¡æ¯')">导åº</a-button> |
| | | <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | | </a-upload> |
| | | <!-- é«çº§æ¥è¯¢åºå --> |
| | | <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>å é¤</a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ <a-icon type="down" /></a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></div> |
| | | </template> |
| | | <template slot="imgSlot" slot-scope="text,record"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ å¾ç</span> |
| | | <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <lsw-material-inventory-modal ref="modalForm" @ok="modalFormOk"></lsw-material-inventory-modal> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | </a-table> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import LswMaterialInventoryModal from './modules/LswMaterialInventoryModal' |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import LswMaterialInventoryModal from './modules/LswMaterialInventoryModal' |
| | | import { getAction } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'LswMaterialInventoryList', |
| | | mixins:[JeecgListMixin, mixinDevice], |
| | | components: { |
| | | LswMaterialInventoryModal |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'ç©æåºåä¿¡æ¯ç®¡ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title:'ç©æID', |
| | | align:"center", |
| | | dataIndex: 'materialId' |
| | | }, |
| | | { |
| | | title:'æ¹æ¬¡å·', |
| | | align:"center", |
| | | dataIndex: 'batchNumber' |
| | | }, |
| | | { |
| | | title:'åºåç±»å', |
| | | align:"center", |
| | | dataIndex: 'inventoryCategory' |
| | | }, |
| | | { |
| | | title:'æ°é', |
| | | align:"center", |
| | | dataIndex: 'quantity' |
| | | }, |
| | | { |
| | | title:'åºåå°ID', |
| | | align:"center", |
| | | dataIndex: 'warehouseId' |
| | | }, |
| | | { |
| | | title:'åºåç¶æ', |
| | | align:"center", |
| | | dataIndex: 'inventoryStatus' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | export default { |
| | | name: 'LswMaterialInventoryList', |
| | | mixins: [JeecgListMixin, mixinDevice], |
| | | components: { |
| | | LswMaterialInventoryModal |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'ç©æåºåä¿¡æ¯ç®¡ç页é¢', |
| | | inventoryStatisticsInfo: "0", |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/lswmaterialinventory/lswMaterialInventory/list", |
| | | delete: "/lswmaterialinventory/lswMaterialInventory/delete", |
| | | deleteBatch: "/lswmaterialinventory/lswMaterialInventory/deleteBatch", |
| | | exportXlsUrl: "/lswmaterialinventory/lswMaterialInventory/exportXls", |
| | | importExcelUrl: "lswmaterialinventory/lswMaterialInventory/importExcel", |
| | | |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | { |
| | | title: 'æ¹æ¬¡å·', |
| | | align: 'center', |
| | | dataIndex: 'batchNumber' |
| | | }, |
| | | { |
| | | title: 'åºåç±»å', |
| | | align: 'center', |
| | | dataIndex: 'inventoryCategory_dictText' |
| | | }, |
| | | { |
| | | title: 'æ°é', |
| | | align: 'center', |
| | | dataIndex: 'quantity' |
| | | }, |
| | | { |
| | | title: 'åºåå°', |
| | | align: 'center', |
| | | dataIndex: 'warehouseId_dictText' |
| | | }, |
| | | { |
| | | title: 'åºåç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'inventoryStatus_dictText' |
| | | }, |
| | | ], |
| | | url: { |
| | | list: '/lsw/materialInventory/list', |
| | | statistics: '/lsw/materialInventory/statisticsInventory', |
| | | }, |
| | | }, |
| | | methods: { |
| | | initDictConfig(){ |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'string',value:'materialId',text:'ç©æID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'batchNumber',text:'æ¹æ¬¡å·',dictCode:''}) |
| | | fieldList.push({type:'string',value:'inventoryCategory',text:'åºåç±»å',dictCode:''}) |
| | | fieldList.push({type:'string',value:'quantity',text:'æ°é',dictCode:''}) |
| | | fieldList.push({type:'string',value:'warehouseId',text:'åºåå°ID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'inventoryStatus',text:'åºåç¶æ',dictCode:''}) |
| | | this.superFieldList = fieldList |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | }, |
| | | methods: { |
| | | statisticsInventory(materialId) { |
| | | getAction(this.url.statistics, {materialId : materialId}).then(res => { |
| | | if(res.success) { |
| | | this.inventoryStatisticsInfo = res.result; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
| | |
| | | <j-form-container :disabled="formDisabled"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
| | | <a-row> |
| | | <a-form-model-item label="产线" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="" |
| | | > |
| | | <j-select-factory |
| | | :disabled="disabled" |
| | | v-model="model.factoryId" |
| | | :multi="true" |
| | | @back="backFactoryInfo" |
| | | :backProduction="true" |
| | | :treeProductOpera="true" |
| | | ></j-select-factory> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model-item> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="åºåå°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseId"> |
| | | <j-search-select-tag v-model="model.warehouseId" placeholder="è¯·éæ©åºåå°" |
| | | dict="base_line_side_warehouse,warehouse_name,id"></j-search-select-tag> |
| | | <a-form-model-item label="æ¥æºç¼ç " :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originalCode"> |
| | | <a-input v-model="model.originalCode" placeholder="请è¾å
¥æ¥æºç¼ç "></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="æ¥æºåç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originalName"> |
| | | <a-input v-model="model.originalName" placeholder="请è¾å
¥æ¥æºåç§°"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="线边åº" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseId"> |
| | | <j-search-select-tag v-model="model.warehouseId" placeholder="è¯·éæ©çº¿è¾¹åº" |
| | | :dict-options="warehouseDictOptions" @change="warehouseSelectChange"></j-search-select-tag> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="ç©æç¼ç " :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber"> |
| | | <a-input v-model="model.materialNumber" placeholder="请è¾å
¥ç©æç¼ç "></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="ç©æåç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName"> |
| | | <a-input v-model="model.materialName" placeholder="请è¾å
¥ç©æåç§°"></a-input> |
| | | <j-search-select-tag :dict-options="materialDictOptions" v-model="model.materialNumber" placeholder="è¯·éæ©ç©æç¼ç " @change="materialSelectChange"></j-search-select-tag> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | |
| | | <a-input-number v-model="model.quantity" placeholder="请è¾å
¥å
¥åºæ°é" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </j-form-container> |
| | | <j-form-container disabled> |
| | | <a-form-model ref="form1" :model="model" slot="detail"> |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="æ¥æ¶äºº" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver"> |
| | | <j-select-user-by-dep v-model="model.receiver" placeholder="请è¾å
¥æ¥æ¶äºº"></j-select-user-by-dep> |
| | | <a-form-model-item label="ç©æåç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName"> |
| | | <a-input v-model="model.materialName"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="æ¥æ¶æ¶é´" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveTime"> |
| | | <j-date placeholder="è¯·éæ©æ¥æ¶æ¶é´" v-model="model.receiveTime" :show-time="true" |
| | | date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> |
| | | <a-form-model-item label="å
¥åºç±»å" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inboundCategory"> |
| | | <j-search-select-tag v-model="model.inboundCategory" dict="material_inbound_category"></j-search-select-tag> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | |
| | | <script> |
| | | |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | import JDate from '@/components/jeecg/JDate' |
| | | import pick from 'lodash.pick' |
| | | import moment from 'moment' |
| | | import { duplicateCheck } from '@/api/api'//é夿 ¡éª |
| | | import JTreeDict from '@/components/jeecg/JTreeDict'//åç±»åå
¸æ 形䏿ç»ä»¶ |
| | | import JSelectFactory from '../../../../src/components/jeecgbiz/JSelectFactory.vue' |
| | | import { getAction, httpAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'LswMaterialInboundForm', |
| | | components: { |
| | | JDate, |
| | | JTreeDict, |
| | | JSelectFactory |
| | | }, |
| | | props: { |
| | | //表åç¦ç¨ |
| | |
| | | sm: { span: 16 } |
| | | }, |
| | | confirmLoading: false, |
| | | warehouseDictOptions: [], |
| | | materialDictOptions: [], |
| | | validatorRules: { |
| | | factoryId: [ |
| | | { required: true, message: '产线æ¯å¿
é项', trigger: 'change' } |
| | | originalCode: [ |
| | | { required: true, message: 'æ¥æºç¼ç æ¯å¿
é项', trigger: 'change' } |
| | | ], |
| | | originalName: [ |
| | | { required: true, message: 'æ¥æºåç§°æ¯å¿
é项', trigger: 'change' } |
| | | ], |
| | | warehouseId: [ |
| | | { required: true, message: 'åºåå°æ¯å¿
é项', trigger: 'change' } |
| | | { required: true, message: 'çº¿è¾¹åºæ¯å¿
é项', trigger: 'change' } |
| | | ], |
| | | materialNumber: [ |
| | | { required: true, message: 'ç©æç¼ç æ¯å¿
é项', trigger: 'change' } |
| | |
| | | quantity: [ |
| | | { required: true, message: 'å
¥åºæ°éæ¯å¿
é项', trigger: 'change' } |
| | | ], |
| | | receiver: [ |
| | | { required: true, message: 'æ¥æ¶äººæ¯å¿
é项', trigger: 'change' } |
| | | ], |
| | | receiveTime: [ |
| | | { required: true, message: 'æ¥æ¶æ¶é´æ¯å¿
é项', trigger: 'change' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/lswmaterialinbound/lswMaterialInbound/add', |
| | | edit: '/lswmaterialinbound/lswMaterialInbound/edit', |
| | | queryById: '/lswmaterialinbound/lswMaterialInbound/queryById' |
| | | add: '/lsw/materialInbound/add', |
| | | edit: '/lsw/materialInbound/edit', |
| | | queryById: '/lsw/materialInbound/queryById', |
| | | queryByProductionType: '/base/lineSideWarehouse/queryByProductionType', |
| | | queryByMaterialCategory: '/lsw/lswMaterial/queryByMaterialCategory', |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
| | | }, |
| | | methods: { |
| | | backFactoryInfo(info) { |
| | | this.model.factoryIds = this.model.factoryId |
| | | this.nextFactoryOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | | }, |
| | | add() { |
| | | add(inboundCategory) { |
| | | this.warehouseDictOptions = []; |
| | | this.materialDictOptions = []; |
| | | if(inboundCategory === 'HEAT_TREATMENT_INBOUND') { |
| | | this.loadWarehouseDictOptions('OUTERFLANGE,INNERFLANGE'); |
| | | this.loadMaterialDictOptions('BLANK'); |
| | | }else if(inboundCategory === 'SMALL_INNER_RING') { |
| | | this.loadWarehouseDictOptions('ASSEMBLE'); |
| | | this.loadMaterialDictOptions('SMALL_INNER_RING'); |
| | | } else if(inboundCategory === 'MATERIAL_INNER_TRANSFER') { |
| | | this.loadWarehouseDictOptions('ASSEMBLE'); |
| | | this.loadMaterialDictOptions('STEEL_BALL'); |
| | | } |
| | | this.modelDefault.inboundCategory = inboundCategory; |
| | | this.edit(this.modelDefault) |
| | | }, |
| | | edit(record) { |
| | |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | loadWarehouseDictOptions(productionType) { |
| | | let params = {productionType : productionType} |
| | | getAction(this.url.queryByProductionType, params).then(res => { |
| | | if(res.success) { |
| | | this.warehouseDictOptions = res.result.map(warehouse => ({...warehouse, value : warehouse.id, text: warehouse.warehouseName + '(' + warehouse.warehouseCode+')'})); |
| | | } |
| | | }) |
| | | }, |
| | | loadMaterialDictOptions(materialCategory) { |
| | | let params = {materialCategory : materialCategory} |
| | | getAction(this.url.queryByMaterialCategory, params).then(res => { |
| | | if(res.success) { |
| | | this.materialDictOptions = res.result.map(material => ({...material, value : material.materialNumber, text: material.materialNumber})); |
| | | } |
| | | }) |
| | | }, |
| | | warehouseSelectChange(value) { |
| | | let warehouse = this.warehouseDictOptions.find(option => option.value === value) |
| | | if(warehouse) { |
| | | this.model.factoryId = warehouse.factoryId |
| | | }else { |
| | | this.model.factoryId = undefined; |
| | | } |
| | | }, |
| | | materialSelectChange(value) { |
| | | let material = this.materialDictOptions.find(option => option.value === value) |
| | | if(material) { |
| | | this.model.materialName = material.materialName |
| | | }else { |
| | | this.model.materialName = undefined; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | add () { |
| | | add (inboundCategory) { |
| | | this.visible=true |
| | | this.$nextTick(()=>{ |
| | | this.$refs.realForm.add(); |
| | | this.$refs.realForm.add(inboundCategory); |
| | | }) |
| | | }, |
| | | edit (record) { |
| | |
| | | </span> |
| | | <span v-if="record.workOrderStatus === 'PUBLISHED' && record.completenessCheckFlag === '1' && record.equipmentInspectionFlag === '0'"> |
| | | <a-divider type="vertical" /> |
| | | <a @click="handleCompletenessCheck(record)">设å¤ç¹æ£</a> |
| | | <a @click="handleEquipmentInspection(record)">设å¤ç¹æ£</a> |
| | | </span> |
| | | <span v-if="record.workOrderStatus === 'PUBLISHED' && record.completenessCheckFlag === '1' && record.equipmentInspectionFlag === '1' && record.processInspectionFlag === '0'"> |
| | | <a-divider type="vertical" /> |
| | |
| | | <MesProductionWorkOrderRepublishModal ref="MesProductionWorkOrderRepublishModal" @ok="modalFormOk"></MesProductionWorkOrderRepublishModal> |
| | | <MesProductionWorkOrderReportModal ref="MesProductionWorkOrderReportModal" @ok="modalFormOk"></MesProductionWorkOrderReportModal> |
| | | <MesProductionWorkOrderCompletenessCheckModal ref="MesProductionWorkOrderCompletenessCheckModal" @ok="modalFormOk"></MesProductionWorkOrderCompletenessCheckModal> |
| | | <MesProductionWorkOrderEquipmentInspectionModal ref="MesProductionWorkOrderEquipmentInspectionModal" @ok="modalFormOk"></MesProductionWorkOrderEquipmentInspectionModal> |
| | | </a-card> |
| | | </template> |
| | | |
| | |
| | | import MesProductionWorkOrderRepublishModal from '@views/mes/modules/MesProductionWorkOrderRepublishModal.vue' |
| | | import MesProductionWorkOrderReportModal from '@views/mes/modules/MesProductionWorkOrderReportModal.vue' |
| | | import MesProductionWorkOrderCompletenessCheckModal from '@views/mes/modules/MesProductionWorkOrderCompletenessCheckModal.vue' |
| | | import MesProductionWorkOrderEquipmentInspectionModal from '@views/mes/modules/MesProductionWorkOrderEquipmentInspectionModal.vue' |
| | | import JSelectFactory from '@comp/jeecgbiz/JSelectFactory.vue' |
| | | import moment from 'moment/moment' |
| | | |
| | |
| | | MesProductionWorkOrderScheduleModal, |
| | | MesProductionWorkOrderRepublishModal, |
| | | MesProductionWorkOrderReportModal, |
| | | MesProductionWorkOrderCompletenessCheckModal |
| | | MesProductionWorkOrderCompletenessCheckModal, |
| | | MesProductionWorkOrderEquipmentInspectionModal |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | handleCompletenessCheck(record) { |
| | | this.$refs.MesProductionWorkOrderCompletenessCheckModal.check(record) |
| | | }, |
| | | handleEquipmentInspection(record) { |
| | | this.$refs.MesProductionWorkOrderEquipmentInspectionModal.inspect(record) |
| | | }, |
| | | async handleUnLoadingDetail(row){ |
| | | console.log('row---->',row) |
| | | const unloadingResult = await getAction(this.url.queryUnloadingByLoadingId,{'loadingId':row.id}) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
| | | @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="8"> |
| | | <a-form-model-item prop="standardCode" label="å·¥åå·"> |
| | | <a-input placeholder="å·¥åå·èªå¨çæ" v-model="model.orderNum" readOnly/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item prop="equipmentId" label="设å¤ç¼å·"> |
| | | <a-select placeholder="è¯·éæ©è®¾å¤" v-model="model.equipmentId" :options="inspectionEquipmentOptions" @change="handleEquipmentChange"></a-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item prop="standardName" label="æ ååç§°"> |
| | | <a-input placeholder="éæ©è®¾å¤åèªå¨å¸¦åº" readOnly v-model="model.standardName"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-model-item prop="standardCode" label="æ åç¼ç "> |
| | | <a-input placeholder="éæ©è®¾å¤åèªå¨å¸¦åº" readOnly v-model="model.standardCode"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="ä¿å
»å¨æ"> |
| | | <a-input placeholder="éæ©è®¾å¤åèªå¨å¸¦åº" v-model="model.maintenancePeriod" readOnly/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <vxe-table |
| | | ref="table" |
| | | border |
| | | show-overflow |
| | | show-header-overflow |
| | | :scroll-x="{enabled: true}" |
| | | :data="dataSource" |
| | | :edit-config="{trigger: 'click', mode: 'cell'}" |
| | | :edit-rules="editRules" |
| | | > |
| | | <vxe-table-column title="åºå·" field="itemCode" width="50" align="center"></vxe-table-column> |
| | | <vxe-table-column title="é¨ä½" field="itemPart" align="center"></vxe-table-column> |
| | | <vxe-table-column title="ä¿å
»é¡¹ç®" field="itemName" align="center"></vxe-table-column> |
| | | <vxe-table-column title="æ£æ¥æ åæè¦æ±" field="itemDemand" align="center"></vxe-table-column> |
| | | <vxe-table-column title="ä¿å
»è¦æ±" field="itemDemandAlias" align="center"></vxe-table-column> |
| | | <vxe-table-column title="æ£æ¥æ¹æ³" field="checkMethod" align="center"></vxe-table-column> |
| | | <vxe-table-column title="ç¹æ£ç»æ" field="inspectionResult" align="center" |
| | | :edit-render="{name: '$select', options: inspectionResultOptions}"> |
| | | <template #default="{ row }"> |
| | | <span v-if="row.inspectionResult">{{ getInspectionResultLabel(row.inspectionResult) }}</span> |
| | | <span v-else class="placeholder-text">è¯·éæ©ç¹æ£ç»æ</span> |
| | | </template> |
| | | </vxe-table-column> |
| | | <vxe-table-column title="å¼å¸¸æè¿°" field="exceptionDescription" align="center" |
| | | :edit-render="{name: '$input', placeholder: '请è¾å
¥å¼å¸¸æè¿°'}"> |
| | | <template #default="{ row }"> |
| | | <span v-if="row.inspectionResult === '2' && !row.exceptionDescription" class="placeholder-text">请è¾å
¥å¼å¸¸æè¿°</span> |
| | | <span v-else-if="row.exceptionDescription">{{ row.exceptionDescription }}</span> |
| | | </template> |
| | | <template #edit="{ row }"> |
| | | <vxe-input v-if="row.inspectionResult === '2'" v-model="row.exceptionDescription" placeholder="请è¾å
¥å¼å¸¸æè¿°" /> |
| | | </template> |
| | | </vxe-table-column> |
| | | </vxe-table> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { postAction, getAction, putAction } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'MesProductionWorkOrderReportModal', |
| | | data () { |
| | | return { |
| | | title: '设å¤ç¹æ£', |
| | | width: 1200, |
| | | visible: false, |
| | | loading: false, |
| | | disableSubmit: false, |
| | | model: {}, |
| | | spinning: false, |
| | | validatorRules: { |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | }, |
| | | inspectionResultOptions: [ |
| | | { |
| | | label: 'æ£å¸¸', |
| | | value: '1' |
| | | }, |
| | | { |
| | | label: 'å¼å¸¸', |
| | | value: '2' |
| | | } |
| | | ], |
| | | dataSource: [], |
| | | editRules: { |
| | | inspectionResult: [ |
| | | { required: true, message: 'æ£æ¥ç»æå¿
须鿩' } |
| | | ], |
| | | exceptionDescription: [ |
| | | { |
| | | required: true, |
| | | message: 'å¼å¸¸æè¿°ä¸è½ä¸ºç©º', |
| | | validator: ({ cellValue, row }) => { |
| | | // å½ç¹æ£ç»æä¸ºå¼å¸¸æ¶ï¼å¼å¸¸æè¿°å¿
å¡« |
| | | if (row.inspectionResult === '2') { |
| | | return cellValue && cellValue.trim() !== '' ? true : new Error('å¼å¸¸æè¿°å¿
须填å'); |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | url: { |
| | | report: '/mesworkreporting/mesWorkReporting/add', |
| | | listInspectionEquipment: '/eam/equipment/listProductionLineInspectionEquipment', |
| | | queryByEquipmentId: '/eam/maintenanceStandard/queryByEquipmentId', |
| | | addInspectionOrder: '/eam/eamInspectionOrder/add', |
| | | updateOrderInspectionStatus: '/mes/mesProductionWorkOrder/edit' |
| | | }, |
| | | inspectionEquipmentOptions: [], |
| | | workOrderId: null |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled(){ |
| | | return this.disabled |
| | | } |
| | | }, |
| | | methods: { |
| | | getInspectionResultLabel(value) { |
| | | const option = this.inspectionResultOptions.find(item => item.value === value); |
| | | return option ? option.label : value; |
| | | }, |
| | | inspect (record) { |
| | | this.resetFormData() |
| | | this.workOrderId = record.id |
| | | getAction(this.url.listInspectionEquipment, {orderId: record.id}).then(res => { |
| | | if (res.success) { |
| | | this.inspectionEquipmentOptions = res.result |
| | | } |
| | | }) |
| | | this.visible = true |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleEquipmentChange(id) { |
| | | getAction(this.url.queryByEquipmentId, {equipmentId: id}).then(res => { |
| | | if (res.success) { |
| | | console.log(res.result) |
| | | this.model = { |
| | | ...this.model, |
| | | standardId: res.result.id, |
| | | standardName: res.result.standardName, |
| | | standardCode: res.result.standardCode, |
| | | maintenancePeriod: res.result.maintenancePeriod |
| | | } |
| | | this.dataSource = res.result.maintenanceStandardDetailList |
| | | } |
| | | }) |
| | | }, |
| | | handleOk () { |
| | | this.$refs.table.validate((valid) => { |
| | | if (valid) { |
| | | this.$message.error("è¯·å®æææå¿
å¡«ä¿¡æ¯ååæäº¤ï¼") |
| | | } else { |
| | | let tableData = this.$refs.table.getTableData().fullData |
| | | const data = { |
| | | ...this.model, |
| | | workOrderId: this.workOrderId, |
| | | tableDetailList: tableData |
| | | } |
| | | postAction(this.url.addInspectionOrder, data).then(res=> { |
| | | if (res.success) { |
| | | this.$message.success(res.message) |
| | | getAction(this.url.listInspectionEquipment, {orderId: this.workOrderId}).then(res => { |
| | | if (res.success) { |
| | | if (res.result && res.result.length > 0) { |
| | | // è¿æè®¾å¤éè¦ç¹æ£ï¼æ¸
空表ååè¡¨æ ¼æ°æ® |
| | | this.inspectionEquipmentOptions = res.result |
| | | this.resetFormData() |
| | | } else { |
| | | // 没æéè¦ç¹æ£ç设å¤ï¼æ´æ°ç¹æ£ç¶æ |
| | | putAction(this.url.updateOrderInspectionStatus, {id: this.workOrderId, equipmentInspectionFlag: '1'}).then(res => { |
| | | if (res.success) { |
| | | this.$message.success('设å¤ç¹æ£å®æ') |
| | | this.submitCallback() |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | this.submitCallback() |
| | | } |
| | | } |
| | | }) |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | resetFormData() { |
| | | this.$refs.form.resetFields() |
| | | this.model = {} |
| | | this.dataSource = [] |
| | | }, |
| | | submitCallback(){ |
| | | this.$emit('ok'); |
| | | this.visible = false; |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | .placeholder-text { |
| | | color: #999; |
| | | font-style: italic; |
| | | } |
| | | |
| | | </style> |