From 37d5d7292db5674ac33d859a8a08acfb7580e8d1 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期一, 28 七月 2025 21:03:41 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/tms/modules/TmsToolScrapForm.vue | 206 ++ src/views/tms/modules/TmsToolStocktakingDetailModal.vue | 143 + src/views/tms/TmsToolInboundList.vue | 312 +++ src/views/tms/modules/TmsToolScrapModal.vue | 145 + src/views/tms/TmsToolHistoryList.vue | 237 ++ src/views/tms/modules/TmsToolInboundInventoryForm.vue | 109 + src/views/tms/modules/TmsToolStocktakingInventoryChangeModal.vue | 60 src/views/tms/TmsToolInboundInventoryList.vue | 177 + src/views/tms/TmsToolReceiveDetailList.vue | 192 + src/views/tms/modules/TmsToolHistoryModal.vue | 60 src/views/tms/modules/TmsToolStocktakingModal.vue | 135 + src/views/tms/TmsToolScrapDetailList.vue | 187 + src/views/tms/modules/TmsToolsModal.vue | 60 src/views/tms/TmsToolStocktakingInventoryChangeList.vue | 195 + src/views/tms/modules/TmsToolReceiveDetailModal.vue | 138 + src/views/tms/TmsToolInboundDetailList.vue | 203 ++ src/views/tms/modules/TmsToolInboundInventoryModal.vue | 60 src/views/tms/modules/TmsToolReceiveModal.vue | 179 + src/views/tms/modules/TmsToolInventoryForm.vue | 119 + src/views/tms/TmsToolReceiveList.vue | 327 +++ src/views/tms/modules/TmsToolHistoryForm.vue | 134 + src/views/tms/modules/TmsToolInboundModal.vue | 326 +++ src/views/tms/modules/JSelectInboundToolModal.vue | 283 ++ src/views/tms/TmsToolInventoryList.vue | 209 ++ src/views/tms/modules/TmsToolStocktakingInventoryChangeForm.vue | 124 + src/views/tms/TmsToolScrapList.vue | 286 ++ src/views/tms/modules/TmsToolScrapDetailModal.vue | 133 + src/views/tms/modules/TmsToolsForm.vue | 171 + src/views/tms/TmsToolsList.vue | 252 ++ src/views/tms/modules/TmsToolInboundDetailModal.vue | 133 + src/views/tms/modules/TmsToolInventoryModal.vue | 60 src/views/tms/modules/TmsToolInboundForm.vue | 206 ++ src/views/tms/TmsToolStocktakingDetailList.vue | 197 + src/views/tms/TmsToolStocktakingList.vue | 262 ++ 34 files changed, 6,020 insertions(+), 0 deletions(-) diff --git a/src/views/tms/TmsToolHistoryList.vue b/src/views/tms/TmsToolHistoryList.vue new file mode 100644 index 0000000..0b7e111 --- /dev/null +++ b/src/views/tms/TmsToolHistoryList.vue @@ -0,0 +1,237 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <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="宸ヨ鏉$爜"> + <a-input placeholder="璇疯緭鍏ュ伐瑁呮潯鐮�" v-model="queryParam.toolBarcode"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鎿嶄綔浜�"> + <a-input placeholder="璇疯緭鍏ユ搷浣滀汉" v-model="queryParam.operator"></a-input> + </a-form-item> + </a-col> + <template v-if="toggleSearchStatus"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鎿嶄綔绫诲瀷"> + <a-input placeholder="璇疯緭鍏ユ搷浣滅被鍨�" v-model="queryParam.operateType"></a-input> + </a-form-item> + </a-col> + </template> + <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 @click="handleToggleSearch" style="margin-left: 8px"> + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> + </span> + </a-col> + </a-row> + </a-form> + </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> + + <tms-tool-history-modal ref="modalForm" @ok="modalFormOk"></tms-tool-history-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolHistoryModal from './modules/TmsToolHistoryModal' + + export default { + name: 'TmsToolHistoryList', + mixins:[JeecgListMixin, mixinDevice], + components: { + TmsToolHistoryModal + }, + data () { + return { + description: '宸ヨ灞ュ巻绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'搴撳瓨缂栧彿', + align:"center", + dataIndex: 'inventoryId' + }, + { + title:'宸ヨ鏉$爜', + align:"center", + dataIndex: 'toolBarcode' + }, + { + title:'鎿嶄綔浜�', + align:"center", + dataIndex: 'operator' + }, + { + title:'鎿嶄綔鏃堕棿', + align:"center", + dataIndex: 'operateTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'鎿嶄綔绫诲瀷', + align:"center", + dataIndex: 'operateType' + }, + { + title:'涓氬姟涓昏〃', + align:"center", + dataIndex: 'businessTable' + }, + // { + // title:'涓氬姟id', + // align:"center", + // dataIndex: 'businessId' + // }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/tms/tmsToolHistory/list", + delete: "/tms/tmsToolHistory/delete", + deleteBatch: "/tms/tmsToolHistory/deleteBatch", + exportXlsUrl: "/tms/tmsToolHistory/exportXls", + importExcelUrl: "tms/tmsToolHistory/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'inventoryId',text:'搴撳瓨ID',dictCode:''}) + fieldList.push({type:'string',value:'toolBarcode',text:'宸ヨ鏉$爜',dictCode:''}) + fieldList.push({type:'string',value:'operator',text:'鎿嶄綔浜�',dictCode:''}) + fieldList.push({type:'date',value:'operateTime',text:'鎿嶄綔鏃堕棿'}) + fieldList.push({type:'string',value:'operateType',text:'鎿嶄綔绫诲瀷',dictCode:''}) + fieldList.push({type:'string',value:'businessTable',text:'涓氬姟涓昏〃',dictCode:''}) + fieldList.push({type:'string',value:'businessId',text:'涓氬姟id',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/tms/TmsToolInboundDetailList.vue b/src/views/tms/TmsToolInboundDetailList.vue new file mode 100644 index 0000000..b9571be --- /dev/null +++ b/src/views/tms/TmsToolInboundDetailList.vue @@ -0,0 +1,203 @@ +<template> + <a-card :bordered="false" :class="'cust-erp-sub-tab'"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> +<!-- <div class="table-operator" v-if="mainId">--> +<!-- <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>--> +<!-- <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" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="null" + @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-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + + </a-table> + </div> + + <tmsToolInboundDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></tmsToolInboundDetail-modal> + </a-card> +</template> + +<script> + + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolInboundDetailModal from './modules/TmsToolInboundDetailModal' + + export default { + name: "TmsToolInboundDetailList", + mixins:[JeecgListMixin], + components: { TmsToolInboundDetailModal }, + props:{ + mainId:{ + type:String, + default:'', + required:false + } + }, + watch:{ + mainId:{ + immediate: true, + handler(val) { + if(!this.mainId){ + this.clearList() + }else{ + this.queryParam['orderId'] = val + this.loadData(1); + } + } + } + }, + data () { + return { + description: '宸ヨ鍏ュ簱绠$悊椤甸潰', + disableMixinCreated:true, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'宸ヨ鍚嶇О', + align:"center", + dataIndex: 'toolName' + }, + { + title:'宸ヨ鍒嗙被', + align:"center", + dataIndex: 'toolCategory' + }, + { + title:'宸ヨ缂栫爜', + align:"center", + dataIndex: 'toolCode' + }, + { + title:'鍨嬪彿', + align:"center", + dataIndex: 'toolModel' + }, + { + title:'瑙勬牸', + align:"center", + dataIndex: 'toolSpecification' + }, + { + title:'鍏ュ簱鏁伴噺', + align:"center", + dataIndex: 'receiveNumber' + }, + // { + // title: '鎿嶄綔', + // dataIndex: 'action', + // align:"center", + // fixed:"right", + // width:147, + // scopedSlots: { customRender: 'action' }, + // } + ], + url: { + list: "/tms/tmsToolInbound/listTmsToolInboundDetailByMainId", + delete: "/tms/tmsToolInbound/deleteTmsToolInboundDetail", + deleteBatch: "/tms/tmsToolInbound/deleteBatchTmsToolInboundDetail", + exportXlsUrl: "/tms/tmsToolInbound/exportTmsToolInboundDetail", + importUrl: "/tms/tmsToolInbound/importTmsToolInboundDetail", + }, + dictOptions:{ + orderStatus:[], + } + } + }, + created() { + }, + computed: { + importExcelUrl(){ + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; + } + }, + methods: { + clearList(){ + this.dataSource=[] + this.selectedRowKeys=[] + this.ipagination.current = 1 + } + + } + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> diff --git a/src/views/tms/TmsToolInboundInventoryList.vue b/src/views/tms/TmsToolInboundInventoryList.vue new file mode 100644 index 0000000..eae3bf6 --- /dev/null +++ b/src/views/tms/TmsToolInboundInventoryList.vue @@ -0,0 +1,177 @@ +<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> + <!-- 鏌ヨ鍖哄煙-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> + + <tms-tool-inbound-inventory-modal ref="modalForm" @ok="modalFormOk"></tms-tool-inbound-inventory-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolInboundInventoryModal from './modules/TmsToolInboundInventoryModal' + + export default { + name: 'TmsToolInboundInventoryList', + mixins:[JeecgListMixin, mixinDevice], + components: { + TmsToolInboundInventoryModal + }, + data () { + return { + description: '宸ヨ鍏ュ簱搴撳瓨鍏崇郴绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鍏ュ簱鍗旾D', + align:"center", + dataIndex: 'orderId' + }, + { + title:'搴撳瓨ID', + align:"center", + dataIndex: 'inventoryId' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/tms/tmsToolInboundInventory/list", + delete: "/tms/tmsToolInboundInventory/delete", + deleteBatch: "/tms/tmsToolInboundInventory/deleteBatch", + exportXlsUrl: "/tms/tmsToolInboundInventory/exportXls", + importExcelUrl: "tms/tmsToolInboundInventory/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'orderId',text:'鍏ュ簱鍗旾D',dictCode:''}) + fieldList.push({type:'string',value:'inventoryId',text:'搴撳瓨ID',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/tms/TmsToolInboundList.vue b/src/views/tms/TmsToolInboundList.vue new file mode 100644 index 0000000..45a1cd8 --- /dev/null +++ b/src/views/tms/TmsToolInboundList.vue @@ -0,0 +1,312 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <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="鍏ュ簱鍗曠姸鎬�"> + <a-input placeholder="璇疯緭鍏ュ叆搴撳崟鐘舵��" v-model="queryParam.orderStatus"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍏ュ簱浜�"> + <a-input placeholder="璇疯緭鍏ュ叆搴撲汉" v-model="queryParam.receiver"></a-input> + </a-form-item> + </a-col> + <template v-if="toggleSearchStatus"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍏ュ簱鏃堕棿"> + <j-date placeholder="璇烽�夋嫨鍏ュ簱鏃堕棿" v-model="queryParam.receiveTime"></j-date> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="纭浜�"> + <a-input placeholder="璇疯緭鍏ョ‘璁や汉" v-model="queryParam.confirmer"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="纭鏃堕棿"> + <j-date placeholder="璇烽�夋嫨纭鏃堕棿" v-model="queryParam.confirmTime"></j-date> + </a-form-item> + </a-col> + </template> + <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 @click="handleToggleSearch" style="margin-left: 8px"> + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> + </span> + </a-col> + </a-row> + </a-form> + </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>--> + </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" + bordered + rowKey="id" + class="j-table-force-nowrap" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" + :customRow="clickThenSelect" + @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="handleDetail(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="handleEdit(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> + + <a-tabs defaultActiveKey="1"> + <a-tab-pane tab="宸ヨ鍏ュ簱鏄庣粏" key="1" > + <TmsToolInboundDetailList ref="tmsToolInboundDetailList" :mainId="tmsToolInboundDetailMainId" /> + </a-tab-pane> + </a-tabs> + + <tmsToolInbound-modal ref="modalForm" @ok="modalFormOk"></tmsToolInbound-modal> + </a-card> +</template> + +<script> + + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolInboundModal from './modules/TmsToolInboundModal' + import { getAction } from '@/api/manage' + import TmsToolInboundDetailList from './TmsToolInboundDetailList' + import '@/assets/less/TableExpand.less' + + export default { + name: "TmsToolInboundList", + mixins:[JeecgListMixin], + components: { + TmsToolInboundDetailList, + TmsToolInboundModal + }, + data () { + return { + description: '宸ヨ鍏ュ簱绠$悊椤甸潰', + // 琛ㄥご + columns: [ + // { + // title:'鍏ュ簱鍗曠姸鎬�', + // align:"center", + // dataIndex: 'orderStatus_dictText', + // }, + { + title:'鍏ュ簱浜�', + align:"center", + dataIndex: 'receiver' + }, + { + title:'鍏ュ簱鏃堕棿', + align:"center", + dataIndex: 'receiveTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'鍏ュ簱璇存槑', + align:"center", + dataIndex: 'receiveComment' + }, + { + title:'纭浜�', + align:"center", + dataIndex: 'confirmer' + }, + { + title:'纭鏃堕棿', + align:"center", + dataIndex: 'confirmTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title:'纭鎰忚', + align:"center", + dataIndex: 'confirmComment' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/tms/tmsToolInbound/list", + delete: "/tms/tmsToolInbound/delete", + deleteBatch: "/tms/tmsToolInbound/deleteBatch", + exportXlsUrl: "/tms/tmsToolInbound/exportXls", + importExcelUrl: "tms/tmsToolInbound/importExcel", + }, + dictOptions:{ + orderStatus:[], + }, + /* 鍒嗛〉鍙傛暟 */ + ipagination:{ + current: 1, + pageSize: 5, + pageSizeOptions: ['5', '10', '50'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + selectedMainId:'', + superFieldList:[], + tmsToolInboundDetailMainId: '', + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + } + }, + methods: { + modalFormOk() { + this.$refs.tmsToolInboundDetailList.clearList() + this.loadData(); + }, + searchReset() { + this.queryParam = {} + this.onClearSelected() + this.$refs.tmsToolInboundDetailList.clearList() + this.loadData(1); + }, + initDictConfig(){ + }, + clickThenSelect(record) { + return { + on: { + click: () => { + this.onSelectChange(record.id.split(","), [record]); + } + } + } + }, + onClearSelected() { + this.selectedRowKeys = []; + this.selectionRows = []; + this.selectedMainId = '' + this.tmsToolInboundDetailMainId = '' + }, + onSelectChange(selectedRowKeys, selectionRows) { + this.selectedMainId=selectedRowKeys[0] + this.selectedRowKeys = selectedRowKeys; + this.selectionRows = selectionRows; + this.tmsToolInboundDetailMainId = selectionRows[0]['id'] + }, + loadData(arg) { + if(!this.url.list){ + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + this.onClearSelected() + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records; + this.ipagination.total = res.result.total; + } + if(res.code===510){ + this.$message.warning(res.message) + } + this.loading = false; + }) + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'orderStatus',text:'鍏ュ簱鍗曠姸鎬�',dictCode:''}) + fieldList.push({type:'string',value:'receiver',text:'鍏ュ簱浜�',dictCode:''}) + fieldList.push({type:'date',value:'receiveTime',text:'鍏ュ簱鏃堕棿'}) + fieldList.push({type:'string',value:'receiveComment',text:'鍏ュ簱璇存槑',dictCode:''}) + fieldList.push({type:'string',value:'confirmer',text:'纭浜�',dictCode:''}) + fieldList.push({type:'date',value:'confirmTime',text:'纭鏃堕棿'}) + fieldList.push({type:'string',value:'confirmComment',text:'纭鎰忚',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> \ No newline at end of file diff --git a/src/views/tms/TmsToolInventoryList.vue b/src/views/tms/TmsToolInventoryList.vue new file mode 100644 index 0000000..588a4b2 --- /dev/null +++ b/src/views/tms/TmsToolInventoryList.vue @@ -0,0 +1,209 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <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="宸ヨ鏉$爜"> + <a-input placeholder="璇疯緭鍏ュ伐瑁呮潯鐮�" v-model="queryParam.toolBarcode"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="搴撳瓨鐘舵��"> + <a-input placeholder="璇疯緭鍏ュ簱瀛樼姸鎬�" v-model="queryParam.inventoryStatus"></a-input> + </a-form-item> + </a-col> + <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 @click="handleToggleSearch" style="margin-left: 8px"> + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> + </span> + </a-col> + </a-row> + </a-form> + </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> + + <tms-tool-inventory-modal ref="modalForm" @ok="modalFormOk"></tms-tool-inventory-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolInventoryModal from './modules/TmsToolInventoryModal' + + export default { + name: 'TmsToolInventoryList', + mixins:[JeecgListMixin, mixinDevice], + components: { + TmsToolInventoryModal + }, + data () { + return { + description: '宸ヨ搴撳瓨绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'宸ヨ鍚嶇О', + align:"center", + dataIndex: 'toolId' + }, + { + title:'宸ヨ鏉$爜', + align:"center", + dataIndex: 'toolBarcode' + }, + { + title:'搴撳瓨鐘舵��', + align:"center", + dataIndex: 'inventoryStatus' + }, + { + title:'褰撳墠瀵垮懡(鐧惧垎姣�)', + align:"center", + dataIndex: 'currentLife' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/tms/tmsToolInventory/list", + delete: "/tms/tmsToolInventory/delete", + deleteBatch: "/tms/tmsToolInventory/deleteBatch", + exportXlsUrl: "/tms/tmsToolInventory/exportXls", + importExcelUrl: "tms/tmsToolInventory/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'toolId',text:'宸ヨID',dictCode:''}) + fieldList.push({type:'string',value:'toolBarcode',text:'宸ヨ鏉$爜',dictCode:''}) + fieldList.push({type:'string',value:'inventoryStatus',text:'搴撳瓨鐘舵��',dictCode:''}) + fieldList.push({type:'BigDecimal',value:'currentLife',text:'褰撳墠瀵垮懡(鐧惧垎姣�)',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/tms/TmsToolReceiveDetailList.vue b/src/views/tms/TmsToolReceiveDetailList.vue new file mode 100644 index 0000000..f7046a0 --- /dev/null +++ b/src/views/tms/TmsToolReceiveDetailList.vue @@ -0,0 +1,192 @@ +<template> + <a-card :bordered="false" :class="'cust-erp-sub-tab'"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" v-if="mainId"> + <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> + <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" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @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-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + + </a-table> + </div> + + <tmsToolReceiveDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></tmsToolReceiveDetail-modal> + </a-card> +</template> + +<script> + + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolReceiveDetailModal from './modules/TmsToolReceiveDetailModal' + + export default { + name: "TmsToolReceiveDetailList", + mixins:[JeecgListMixin], + components: { TmsToolReceiveDetailModal }, + props:{ + mainId:{ + type:String, + default:'', + required:false + } + }, + watch:{ + mainId:{ + immediate: true, + handler(val) { + if(!this.mainId){ + this.clearList() + }else{ + this.queryParam['orderId'] = val + this.loadData(1); + } + } + } + }, + data () { + return { + description: '宸ヨ棰嗙敤绠$悊椤甸潰', + disableMixinCreated:true, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'棰嗙敤鍗旾D', + align:"center", + dataIndex: 'orderId' + }, + { + title:'宸ヨID', + align:"center", + dataIndex: 'toolId' + }, + { + title:'搴撳瓨ID', + align:"center", + dataIndex: 'inventoryId' + }, + { + title:'浣跨敤瀵垮懡(鐧惧垎姣�)', + align:"center", + dataIndex: 'usedLife' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/tms/tmsToolReceive/listTmsToolReceiveDetailByMainId", + delete: "/tms/tmsToolReceive/deleteTmsToolReceiveDetail", + deleteBatch: "/tms/tmsToolReceive/deleteBatchTmsToolReceiveDetail", + exportXlsUrl: "/tms/tmsToolReceive/exportTmsToolReceiveDetail", + importUrl: "/tms/tmsToolReceive/importTmsToolReceiveDetail", + }, + dictOptions:{ + } + } + }, + created() { + }, + computed: { + importExcelUrl(){ + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; + } + }, + methods: { + clearList(){ + this.dataSource=[] + this.selectedRowKeys=[] + this.ipagination.current = 1 + } + + } + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> diff --git a/src/views/tms/TmsToolReceiveList.vue b/src/views/tms/TmsToolReceiveList.vue new file mode 100644 index 0000000..6132507 --- /dev/null +++ b/src/views/tms/TmsToolReceiveList.vue @@ -0,0 +1,327 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <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="棰嗙敤鍗曠姸鎬�"> + <a-input placeholder="璇疯緭鍏ラ鐢ㄥ崟鐘舵��" v-model="queryParam.orderStatus"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="棰嗙敤浜�"> + <a-input placeholder="璇疯緭鍏ラ鐢ㄤ汉" v-model="queryParam.receiver"></a-input> + </a-form-item> + </a-col> + <template v-if="toggleSearchStatus"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="棰嗙敤鏃堕棿"> + <j-date placeholder="璇烽�夋嫨棰嗙敤鏃堕棿" v-model="queryParam.receiveTime"></j-date> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="纭浜�"> + <a-input placeholder="璇疯緭鍏ョ‘璁や汉" v-model="queryParam.confirmer"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="纭鏃堕棿"> + <j-date placeholder="璇烽�夋嫨纭鏃堕棿" v-model="queryParam.confirmTime"></j-date> + </a-form-item> + </a-col> + </template> + <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 @click="handleToggleSearch" style="margin-left: 8px"> + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> + </span> + </a-col> + </a-row> + </a-form> + </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>--> + </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" + bordered + rowKey="id" + class="j-table-force-nowrap" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" + :customRow="clickThenSelect" + @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-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + +<!-- <a-tabs defaultActiveKey="1">--> +<!-- <a-tab-pane tab="宸ヨ棰嗙敤鏄庣粏" key="1" >--> +<!-- <TmsToolReceiveDetailList :mainId="tmsToolReceiveDetailMainId" />--> +<!-- </a-tab-pane>--> +<!-- </a-tabs>--> + + <tmsToolReceive-modal ref="modalForm" @ok="modalFormOk"></tmsToolReceive-modal> + </a-card> +</template> + +<script> + + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolReceiveModal from './modules/TmsToolReceiveModal' + import { getAction } from '@/api/manage' + import TmsToolReceiveDetailList from './TmsToolReceiveDetailList' + import '@/assets/less/TableExpand.less' + + export default { + name: "TmsToolReceiveList", + mixins:[JeecgListMixin], + components: { + TmsToolReceiveDetailList, + TmsToolReceiveModal + }, + data () { + return { + description: '宸ヨ棰嗙敤绠$悊椤甸潰', + // 琛ㄥご + columns: [ + // { + // title:'棰嗙敤鍗曠姸鎬�', + // align:"center", + // dataIndex: 'orderStatus' + // }, + { + title:'棰嗙敤浜�', + align:"center", + dataIndex: 'receiver' + }, + { + title:'棰嗙敤鏃堕棿', + align:"center", + dataIndex: 'receiveTime' + }, + { + title:'棰嗙敤璇存槑', + align:"center", + dataIndex: 'receiveComment' + }, + { + title:'纭浜�', + align:"center", + dataIndex: 'confirmer' + }, + { + title:'纭鏃堕棿', + align:"center", + dataIndex: 'confirmTime' + }, + { + title:'纭鎰忚', + align:"center", + dataIndex: 'confirmComment' + }, + { + title:'鏄惁浼氬綊杩�', + align:"center", + dataIndex: 'returnFlag' + }, + { + title:'褰掕繕鏃堕棿', + align:"center", + dataIndex: 'returnTime' + }, + { + title:'褰掕繕璇存槑', + align:"center", + dataIndex: 'returnComment' + }, + { + title:'褰掕繕纭浜�', + align:"center", + dataIndex: 'returnConfirmer' + }, + { + title:'褰掕繕纭鏃堕棿', + align:"center", + dataIndex: 'returnConfirmTime' + }, + { + title:'褰掕繕纭鎰忚', + align:"center", + dataIndex: 'returnConfirmComment' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/tms/tmsToolReceive/list", + delete: "/tms/tmsToolReceive/delete", + deleteBatch: "/tms/tmsToolReceive/deleteBatch", + exportXlsUrl: "/tms/tmsToolReceive/exportXls", + importExcelUrl: "tms/tmsToolReceive/importExcel", + }, + dictOptions:{ + }, + /* 鍒嗛〉鍙傛暟 */ + ipagination:{ + current: 1, + pageSize: 5, + pageSizeOptions: ['5', '10', '50'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + selectedMainId:'', + superFieldList:[], + tmsToolReceiveDetailMainId: '', + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + } + }, + methods: { + initDictConfig(){ + }, + clickThenSelect(record) { + return { + on: { + click: () => { + this.onSelectChange(record.id.split(","), [record]); + } + } + } + }, + onClearSelected() { + this.selectedRowKeys = []; + this.selectionRows = []; + this.selectedMainId='' + }, + onSelectChange(selectedRowKeys, selectionRows) { + this.selectedMainId=selectedRowKeys[0] + this.selectedRowKeys = selectedRowKeys; + this.selectionRows = selectionRows; + this.tmsToolReceiveDetailMainId = selectionRows[0]['id'] + }, + loadData(arg) { + if(!this.url.list){ + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + this.onClearSelected() + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records; + this.ipagination.total = res.result.total; + } + if(res.code===510){ + this.$message.warning(res.message) + } + this.loading = false; + }) + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'orderStatus',text:'棰嗙敤鍗曠姸鎬�',dictCode:''}) + fieldList.push({type:'string',value:'receiver',text:'棰嗙敤浜�',dictCode:''}) + fieldList.push({type:'date',value:'receiveTime',text:'棰嗙敤鏃堕棿'}) + fieldList.push({type:'string',value:'receiveComment',text:'棰嗙敤璇存槑',dictCode:''}) + fieldList.push({type:'string',value:'confirmer',text:'纭浜�',dictCode:''}) + fieldList.push({type:'date',value:'confirmTime',text:'纭鏃堕棿'}) + fieldList.push({type:'string',value:'confirmComment',text:'纭鎰忚',dictCode:''}) + fieldList.push({type:'string',value:'returnFlag',text:'鏄惁浼氬綊杩�',dictCode:''}) + fieldList.push({type:'date',value:'returnTime',text:'褰掕繕鏃堕棿'}) + fieldList.push({type:'string',value:'returnComment',text:'褰掕繕璇存槑',dictCode:''}) + fieldList.push({type:'string',value:'returnConfirmer',text:'褰掕繕纭浜�',dictCode:''}) + fieldList.push({type:'date',value:'returnConfirmTime',text:'褰掕繕纭鏃堕棿'}) + fieldList.push({type:'string',value:'returnConfirmComment',text:'褰掕繕纭鎰忚',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> \ No newline at end of file diff --git a/src/views/tms/TmsToolScrapDetailList.vue b/src/views/tms/TmsToolScrapDetailList.vue new file mode 100644 index 0000000..fb742d8 --- /dev/null +++ b/src/views/tms/TmsToolScrapDetailList.vue @@ -0,0 +1,187 @@ +<template> + <a-card :bordered="false" :class="'cust-erp-sub-tab'"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" v-if="mainId"> + <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> + <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" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @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-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + + </a-table> + </div> + + <tmsToolScrapDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></tmsToolScrapDetail-modal> + </a-card> +</template> + +<script> + + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolScrapDetailModal from './modules/TmsToolScrapDetailModal' + + export default { + name: "TmsToolScrapDetailList", + mixins:[JeecgListMixin], + components: { TmsToolScrapDetailModal }, + props:{ + mainId:{ + type:String, + default:'', + required:false + } + }, + watch:{ + mainId:{ + immediate: true, + handler(val) { + if(!this.mainId){ + this.clearList() + }else{ + this.queryParam['orderId'] = val + this.loadData(1); + } + } + } + }, + data () { + return { + description: '宸ヨ鎶ュ簾绠$悊椤甸潰', + disableMixinCreated:true, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鎶ュ簾鍗旾D', + align:"center", + dataIndex: 'orderId' + }, + { + title:'宸ヨID', + align:"center", + dataIndex: 'toolId' + }, + { + title:'搴撳瓨ID', + align:"center", + dataIndex: 'inventoryId' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/tms/tmsToolScrap/listTmsToolScrapDetailByMainId", + delete: "/tms/tmsToolScrap/deleteTmsToolScrapDetail", + deleteBatch: "/tms/tmsToolScrap/deleteBatchTmsToolScrapDetail", + exportXlsUrl: "/tms/tmsToolScrap/exportTmsToolScrapDetail", + importUrl: "/tms/tmsToolScrap/importTmsToolScrapDetail", + }, + dictOptions:{ + } + } + }, + created() { + }, + computed: { + importExcelUrl(){ + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; + } + }, + methods: { + clearList(){ + this.dataSource=[] + this.selectedRowKeys=[] + this.ipagination.current = 1 + } + + } + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> diff --git a/src/views/tms/TmsToolScrapList.vue b/src/views/tms/TmsToolScrapList.vue new file mode 100644 index 0000000..3948847 --- /dev/null +++ b/src/views/tms/TmsToolScrapList.vue @@ -0,0 +1,286 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <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="鎶ュ簾鍗曠姸鎬�"> + <a-input placeholder="璇疯緭鍏ユ姤搴熷崟鐘舵��" v-model="queryParam.orderStatus"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鐢宠浜�"> + <a-input placeholder="璇疯緭鍏ョ敵璇蜂汉" v-model="queryParam.applicant"></a-input> + </a-form-item> + </a-col> + <template v-if="toggleSearchStatus"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鐢宠鏃堕棿"> + <j-date placeholder="璇烽�夋嫨鐢宠鏃堕棿" v-model="queryParam.applicationTime"></j-date> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="纭浜�"> + <a-input placeholder="璇疯緭鍏ョ‘璁や汉" v-model="queryParam.confirmer"></a-input> + </a-form-item> + </a-col> + </template> + <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 @click="handleToggleSearch" style="margin-left: 8px"> + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> + </span> + </a-col> + </a-row> + </a-form> + </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>--> + </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" + bordered + rowKey="id" + class="j-table-force-nowrap" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" + :customRow="clickThenSelect" + @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-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + +<!-- <a-tabs defaultActiveKey="1">--> +<!-- <a-tab-pane tab="宸ヨ鎶ュ簾鏄庣粏" key="1" >--> +<!-- <TmsToolScrapDetailList :mainId="tmsToolScrapDetailMainId" />--> +<!-- </a-tab-pane>--> +<!-- </a-tabs>--> + + <tmsToolScrap-modal ref="modalForm" @ok="modalFormOk"></tmsToolScrap-modal> + </a-card> +</template> + +<script> + + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolScrapModal from './modules/TmsToolScrapModal' + import { getAction } from '@/api/manage' + import TmsToolScrapDetailList from './TmsToolScrapDetailList' + import '@/assets/less/TableExpand.less' + + export default { + name: "TmsToolScrapList", + mixins:[JeecgListMixin], + components: { + TmsToolScrapDetailList, + TmsToolScrapModal + }, + data () { + return { + description: '宸ヨ鎶ュ簾绠$悊椤甸潰', + // 琛ㄥご + columns: [ + // { + // title:'鎶ュ簾鍗曠姸鎬�', + // align:"center", + // dataIndex: 'orderStatus' + // }, + { + title:'鐢宠浜�', + align:"center", + dataIndex: 'applicant' + }, + { + title:'鐢宠鏃堕棿', + align:"center", + dataIndex: 'applicationTime' + }, + { + title:'鐢宠璇存槑', + align:"center", + dataIndex: 'applicationComment' + }, + { + title:'纭浜�', + align:"center", + dataIndex: 'confirmer' + }, + { + title:'纭鏃堕棿', + align:"center", + dataIndex: 'confirmTime' + }, + { + title:'纭鎰忚', + align:"center", + dataIndex: 'confirmComment' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/tms/tmsToolScrap/list", + delete: "/tms/tmsToolScrap/delete", + deleteBatch: "/tms/tmsToolScrap/deleteBatch", + exportXlsUrl: "/tms/tmsToolScrap/exportXls", + importExcelUrl: "tms/tmsToolScrap/importExcel", + }, + dictOptions:{ + }, + /* 鍒嗛〉鍙傛暟 */ + ipagination:{ + current: 1, + pageSize: 5, + pageSizeOptions: ['5', '10', '50'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + selectedMainId:'', + superFieldList:[], + tmsToolScrapDetailMainId: '', + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + } + }, + methods: { + initDictConfig(){ + }, + clickThenSelect(record) { + return { + on: { + click: () => { + this.onSelectChange(record.id.split(","), [record]); + } + } + } + }, + onClearSelected() { + this.selectedRowKeys = []; + this.selectionRows = []; + this.selectedMainId='' + }, + onSelectChange(selectedRowKeys, selectionRows) { + this.selectedMainId=selectedRowKeys[0] + this.selectedRowKeys = selectedRowKeys; + this.selectionRows = selectionRows; + this.tmsToolScrapDetailMainId = selectionRows[0]['id'] + }, + loadData(arg) { + if(!this.url.list){ + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + this.onClearSelected() + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records; + this.ipagination.total = res.result.total; + } + if(res.code===510){ + this.$message.warning(res.message) + } + this.loading = false; + }) + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'orderStatus',text:'鎶ュ簾鍗曠姸鎬�',dictCode:''}) + fieldList.push({type:'string',value:'applicant',text:'鐢宠浜�',dictCode:''}) + fieldList.push({type:'date',value:'applicationTime',text:'鐢宠鏃堕棿'}) + fieldList.push({type:'string',value:'applicationComment',text:'鐢宠璇存槑',dictCode:''}) + fieldList.push({type:'string',value:'confirmer',text:'纭浜�',dictCode:''}) + fieldList.push({type:'date',value:'confirmTime',text:'纭鏃堕棿'}) + fieldList.push({type:'string',value:'confirmComment',text:'纭鎰忚',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> \ No newline at end of file diff --git a/src/views/tms/TmsToolStocktakingDetailList.vue b/src/views/tms/TmsToolStocktakingDetailList.vue new file mode 100644 index 0000000..9878873 --- /dev/null +++ b/src/views/tms/TmsToolStocktakingDetailList.vue @@ -0,0 +1,197 @@ +<template> + <a-card :bordered="false" :class="'cust-erp-sub-tab'"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" v-if="mainId"> + <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> + <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" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @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-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + + </a-table> + </div> + + <tmsToolStocktakingDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></tmsToolStocktakingDetail-modal> + </a-card> +</template> + +<script> + + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolStocktakingDetailModal from './modules/TmsToolStocktakingDetailModal' + + export default { + name: "TmsToolStocktakingDetailList", + mixins:[JeecgListMixin], + components: { TmsToolStocktakingDetailModal }, + props:{ + mainId:{ + type:String, + default:'', + required:false + } + }, + watch:{ + mainId:{ + immediate: true, + handler(val) { + if(!this.mainId){ + this.clearList() + }else{ + this.queryParam['orderId'] = val + this.loadData(1); + } + } + } + }, + data () { + return { + description: '宸ヨ鐩樼偣绠$悊椤甸潰', + disableMixinCreated:true, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鐩樼偣鍗旾D', + align:"center", + dataIndex: 'orderId' + }, + { + title:'宸ヨID', + align:"center", + dataIndex: 'toolId' + }, + { + title:'鐩樼偣鍓嶆暟閲�', + align:"center", + dataIndex: 'beforeNumber' + }, + { + title:'瀹為檯鐩樼偣鏁伴噺', + align:"center", + dataIndex: 'actualNumber' + }, + { + title:'鐩樼偣缁撴灉', + align:"center", + dataIndex: 'stocktakingResult' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/tms/tmsToolStocktaking/listTmsToolStocktakingDetailByMainId", + delete: "/tms/tmsToolStocktaking/deleteTmsToolStocktakingDetail", + deleteBatch: "/tms/tmsToolStocktaking/deleteBatchTmsToolStocktakingDetail", + exportXlsUrl: "/tms/tmsToolStocktaking/exportTmsToolStocktakingDetail", + importUrl: "/tms/tmsToolStocktaking/importTmsToolStocktakingDetail", + }, + dictOptions:{ + } + } + }, + created() { + }, + computed: { + importExcelUrl(){ + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; + } + }, + methods: { + clearList(){ + this.dataSource=[] + this.selectedRowKeys=[] + this.ipagination.current = 1 + } + + } + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> diff --git a/src/views/tms/TmsToolStocktakingInventoryChangeList.vue b/src/views/tms/TmsToolStocktakingInventoryChangeList.vue new file mode 100644 index 0000000..2af0d62 --- /dev/null +++ b/src/views/tms/TmsToolStocktakingInventoryChangeList.vue @@ -0,0 +1,195 @@ +<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> + <!-- 鏌ヨ鍖哄煙-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> + + <tms-tool-stocktaking-inventory-change-modal ref="modalForm" @ok="modalFormOk"></tms-tool-stocktaking-inventory-change-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolStocktakingInventoryChangeModal from './modules/TmsToolStocktakingInventoryChangeModal' + + export default { + name: 'TmsToolStocktakingInventoryChangeList', + mixins:[JeecgListMixin, mixinDevice], + components: { + TmsToolStocktakingInventoryChangeModal + }, + 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: 'detailId' + }, + { + title:'搴撳瓨ID', + align:"center", + dataIndex: 'inventoryId' + }, + { + title:'宸ヨ鏉$爜', + align:"center", + dataIndex: 'toolBarcode' + }, + { + title:'鏁伴噺(榛樿1)', + align:"center", + dataIndex: 'number' + }, + { + title:'鍙樻洿绫诲瀷;姝e父/鍑哄簱/鍏ュ簱', + align:"center", + dataIndex: 'changeType' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/tms/tmsToolStocktakingInventoryChange/list", + delete: "/tms/tmsToolStocktakingInventoryChange/delete", + deleteBatch: "/tms/tmsToolStocktakingInventoryChange/deleteBatch", + exportXlsUrl: "/tms/tmsToolStocktakingInventoryChange/exportXls", + importExcelUrl: "tms/tmsToolStocktakingInventoryChange/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'detailId',text:'鐩樼偣鏄庣粏ID',dictCode:''}) + fieldList.push({type:'string',value:'inventoryId',text:'搴撳瓨ID',dictCode:''}) + fieldList.push({type:'string',value:'toolBarcode',text:'宸ヨ鏉$爜',dictCode:''}) + fieldList.push({type:'BigDecimal',value:'number',text:'鏁伴噺(榛樿1)',dictCode:''}) + fieldList.push({type:'string',value:'changeType',text:'鍙樻洿绫诲瀷;姝e父/鍑哄簱/鍏ュ簱',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/tms/TmsToolStocktakingList.vue b/src/views/tms/TmsToolStocktakingList.vue new file mode 100644 index 0000000..d850083 --- /dev/null +++ b/src/views/tms/TmsToolStocktakingList.vue @@ -0,0 +1,262 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <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="鐩樼偣鍗曞彿"> + <a-input placeholder="璇疯緭鍏ョ洏鐐瑰崟鍙�" v-model="queryParam.orderCode"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鐩樼偣鐘舵��"> + <a-input placeholder="璇疯緭鍏ョ洏鐐圭姸鎬�" v-model="queryParam.orderStatus"></a-input> + </a-form-item> + </a-col> + <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 @click="handleToggleSearch" style="margin-left: 8px"> + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> + </span> + </a-col> + </a-row> + </a-form> + </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>--> + </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" + bordered + rowKey="id" + class="j-table-force-nowrap" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" + :customRow="clickThenSelect" + @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-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + +<!-- <a-tabs defaultActiveKey="1">--> +<!-- <a-tab-pane tab="宸ヨ鐩樼偣鏄庣粏" key="1" >--> +<!-- <TmsToolStocktakingDetailList :mainId="tmsToolStocktakingDetailMainId" />--> +<!-- </a-tab-pane>--> +<!-- </a-tabs>--> + + <tmsToolStocktaking-modal ref="modalForm" @ok="modalFormOk"></tmsToolStocktaking-modal> + </a-card> +</template> + +<script> + + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolStocktakingModal from './modules/TmsToolStocktakingModal' + import { getAction } from '@/api/manage' + import TmsToolStocktakingDetailList from './TmsToolStocktakingDetailList' + import '@/assets/less/TableExpand.less' + + export default { + name: "TmsToolStocktakingList", + mixins:[JeecgListMixin], + components: { + TmsToolStocktakingDetailList, + TmsToolStocktakingModal + }, + data () { + return { + description: '宸ヨ鐩樼偣绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title:'鐩樼偣鍗曞彿', + align:"center", + dataIndex: 'orderCode' + }, + // { + // title:'鐩樼偣鐘舵��', + // align:"center", + // dataIndex: 'orderStatus' + // }, + { + title:'鐩樼偣浜�', + align:"center", + dataIndex: 'operator' + }, + { + title:'鐩樼偣鏃堕棿', + align:"center", + dataIndex: 'operateTime' + }, + { + title:'澶囨敞', + align:"center", + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/tms/tmsToolStocktaking/list", + delete: "/tms/tmsToolStocktaking/delete", + deleteBatch: "/tms/tmsToolStocktaking/deleteBatch", + exportXlsUrl: "/tms/tmsToolStocktaking/exportXls", + importExcelUrl: "tms/tmsToolStocktaking/importExcel", + }, + dictOptions:{ + }, + /* 鍒嗛〉鍙傛暟 */ + ipagination:{ + current: 1, + pageSize: 5, + pageSizeOptions: ['5', '10', '50'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + selectedMainId:'', + superFieldList:[], + tmsToolStocktakingDetailMainId: '', + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + } + }, + methods: { + initDictConfig(){ + }, + clickThenSelect(record) { + return { + on: { + click: () => { + this.onSelectChange(record.id.split(","), [record]); + } + } + } + }, + onClearSelected() { + this.selectedRowKeys = []; + this.selectionRows = []; + this.selectedMainId='' + }, + onSelectChange(selectedRowKeys, selectionRows) { + this.selectedMainId=selectedRowKeys[0] + this.selectedRowKeys = selectedRowKeys; + this.selectionRows = selectionRows; + this.tmsToolStocktakingDetailMainId = selectionRows[0]['id'] + }, + loadData(arg) { + if(!this.url.list){ + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + this.onClearSelected() + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records; + this.ipagination.total = res.result.total; + } + if(res.code===510){ + this.$message.warning(res.message) + } + this.loading = false; + }) + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'orderCode',text:'鐩樼偣鍗曞彿',dictCode:''}) + fieldList.push({type:'string',value:'orderStatus',text:'鐩樼偣鐘舵��',dictCode:''}) + fieldList.push({type:'string',value:'operator',text:'鐩樼偣浜�',dictCode:''}) + fieldList.push({type:'date',value:'operateTime',text:'鐩樼偣鏃堕棿'}) + fieldList.push({type:'string',value:'remark',text:'澶囨敞',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> \ No newline at end of file diff --git a/src/views/tms/TmsToolsList.vue b/src/views/tms/TmsToolsList.vue new file mode 100644 index 0000000..7be4ed9 --- /dev/null +++ b/src/views/tms/TmsToolsList.vue @@ -0,0 +1,252 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <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-input placeholder="璇疯緭鍏ュ伐瑁呭悕绉�" v-model="queryParam.toolName"></j-input> + </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.toolCode"></j-input> + </a-form-item> + </a-col> + <template v-if="toggleSearchStatus"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="宸ヨ鍒嗙被"> + <a-input placeholder="璇疯緭鍏ュ伐瑁呭垎绫�" v-model="queryParam.toolCategory"></a-input> + </a-form-item> + </a-col> + </template> + <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 @click="handleToggleSearch" style="margin-left: 8px"> + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> + </span> + </a-col> + </a-row> + </a-form> + </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> + + <tms-tools-modal ref="modalForm" @ok="modalFormOk"></tms-tools-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import TmsToolsModal from './modules/TmsToolsModal' + + export default { + name: 'TmsToolsList', + mixins:[JeecgListMixin, mixinDevice], + components: { + TmsToolsModal + }, + data () { + return { + description: '宸ヨ淇℃伅绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'宸ヨ鍚嶇О', + align:"center", + dataIndex: 'toolName' + }, + { + title:'宸ヨ缂栫爜', + align:"center", + dataIndex: 'toolCode' + }, + { + title:'宸ヨ鍒嗙被', + align:"center", + dataIndex: 'toolCategory' + }, + { + title:'鍨嬪彿', + align:"center", + dataIndex: 'toolModel' + }, + { + title:'瑙勬牸', + align:"center", + dataIndex: 'toolSpecification' + }, + { + title:'鍗曚綅', + align:"center", + dataIndex: 'toolUnit' + }, + { + title:'瀛樻斁浣嶇疆', + align:"center", + dataIndex: 'storeLocation' + }, + { + title:'渚涘簲鍟�', + align:"center", + dataIndex: 'supplierId' + }, + { + title:'搴撳瓨棰勮鍊�', + align:"center", + dataIndex: 'inventoryWarning' + }, + { + title:'澶囨敞', + align:"center", + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/tms/tmsTools/list", + delete: "/tms/tmsTools/delete", + deleteBatch: "/tms/tmsTools/deleteBatch", + exportXlsUrl: "/tms/tmsTools/exportXls", + importExcelUrl: "tms/tmsTools/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'toolName',text:'宸ヨ鍚嶇О',dictCode:''}) + fieldList.push({type:'string',value:'toolCode',text:'宸ヨ缂栫爜',dictCode:''}) + fieldList.push({type:'string',value:'toolCategory',text:'宸ヨ鍒嗙被',dictCode:''}) + fieldList.push({type:'string',value:'toolModel',text:'鍨嬪彿',dictCode:''}) + fieldList.push({type:'string',value:'toolSpecification',text:'瑙勬牸',dictCode:''}) + fieldList.push({type:'string',value:'toolUnit',text:'鍗曚綅',dictCode:''}) + fieldList.push({type:'string',value:'storeLocation',text:'瀛樻斁浣嶇疆',dictCode:''}) + fieldList.push({type:'string',value:'supplierId',text:'渚涘簲鍟�',dictCode:''}) + fieldList.push({type:'int',value:'inventoryWarning',text:'搴撳瓨棰勮鍊�',dictCode:''}) + fieldList.push({type:'string',value:'remark',text:'澶囨敞',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/tms/modules/JSelectInboundToolModal.vue b/src/views/tms/modules/JSelectInboundToolModal.vue new file mode 100644 index 0000000..154457f --- /dev/null +++ b/src/views/tms/modules/JSelectInboundToolModal.vue @@ -0,0 +1,283 @@ +<template> + <!--鏀寔鍏ㄥ睆缂╂斁--> + <j-modal + :visible="visible" + :width="1200" + :title="title" + switchFullscreen + @ok="handleSubmit" + @cancel="close" + style="top: 50px" + cancelText="鍏抽棴" + > + <a-card :bordered="false"> + <div class="table-page-search-wrapper"> + <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-input placeholder="璇疯緭鍏ュ伐瑁呭悕绉�,鏀寔妯$硦鏌ヨ" v-model="queryParam.toolName"></j-input> + </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.toolCode"></j-input> + </a-form-item> + </a-col> + <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-row> + </a-form> + </div> + <!--鍑哄簱鍗曞垪琛�--> + <a-table + ref="table" + size="middle" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :rowSelection="rowSelection" + :loading="loading" + @change="handleTableChange" + :rowClassName="getRowClassName" + > + </a-table> + </a-card> + </j-modal> +</template> + +<script> +import { filterObj } from '@/utils/util' +import { getAction } from '@api/manage' + +export default { + name: 'JSelectSharpenOutboundToolModal', + components: {}, + props: {}, + data() { + return { + title: '閫夋嫨鍏ュ簱宸ヨ', + queryParam: {}, + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'宸ヨ鍚嶇О', + align:"center", + dataIndex: 'toolName' + }, + { + title:'宸ヨ缂栫爜', + align:"center", + dataIndex: 'toolCode' + }, + { + title:'宸ヨ鍒嗙被', + align:"center", + dataIndex: 'toolCategory' + }, + { + title:'鍨嬪彿', + align:"center", + dataIndex: 'toolModel' + }, + { + title:'瑙勬牸', + align:"center", + dataIndex: 'toolSpecification' + }, + { + title:'鍗曚綅', + align:"center", + dataIndex: 'toolUnit' + }, + { + title:'瀛樻斁浣嶇疆', + align:"center", + dataIndex: 'storeLocation' + }, + { + title:'渚涘簲鍟�', + align:"center", + dataIndex: 'supplierId' + }, + { + title:'澶囨敞', + align:"center", + dataIndex: 'remark' + } + ], + selectedRowKeys: [], + oldSelectRow: [], + scrollTrigger: { x: 1500, y: 500 }, + dataSource: [], + selectionRows: [], + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['5', '10', '20'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + }, + isorter: { + column: 'toolCode', + order: 'asc', + }, + departTree: [], + visible: false, + loading: false, + prepareKnifeDetailList:[], + url: { + list: "/tms/tmsTools/list" + }, + } + }, + computed: { + rowSelection() { + return { + type: 'checkbox', + onChange: (selectedRowKeys, selectedRows) => { + this.selectedRowKeys = selectedRowKeys + this.onSelectChange(selectedRows) + }, + getCheckboxProps: (record) => ({ + props: { + disabled: record.alreadySelected, + }, + }), + } + }, + }, + watch: { + }, + created() { + }, + methods: { + getRowClassName(record, index) { + return record.alreadySelected ? 'disabled-row' : ''; + }, + async loadData(arg) { + if (arg === 1) { + this.ipagination.current = 1 + } + this.loading = true + let params = this.getQueryParams() //鏌ヨ鏉′欢 + console.log(params) + await getAction(this.url.list, params).then((res) => { + if (res.success) { + // 澶勭悊鏁版嵁锛屾爣璁板凡閫夋嫨鐨勮褰� + this.dataSource = res.result.records.map(item => { + // 妫�鏌ュ綋鍓嶈褰曟槸鍚﹀湪宸查�夋嫨鍒楄〃涓� + if (this.oldSelectRow && this.oldSelectRow.includes(item.id)) { + return { ...item, alreadySelected: true } + } + return { ...item, alreadySelected: false }; // 鏄庣‘璁剧疆涓� false + }) + this.ipagination.total = res.result.total + } + if (res.code === 510) { + this.$message.warning(res.message) + } + this.loading = false + }) + }, + showOrderModal(oldSelectRow) { + this.oldSelectRow = oldSelectRow ? oldSelectRow.split(',') : [] + this.visible = true + this.loadData(1) + }, + getQueryParams() { + let param = Object.assign({}, this.queryParam, this.isorter) + param.field = this.getQueryField() + param.pageNo = this.ipagination.current + param.pageSize = this.ipagination.pageSize + return filterObj(param) + }, + //鏌ヨ鏉′欢澶勭悊 + getQueryField() { + let fields = ['id']; + for (let a = 0; a < this.columns.length; a++) { + fields.push(this.columns[a].dataIndex); + } + return fields.join(','); + }, + searchReset() { + this.queryParam = {} + this.loadData(1) + }, + close() { + this.queryParam = {} + this.selectedRowKeys = [] + this.selectionRows = [] + this.visible = false + }, + handleTableChange(pagination, filters, sorter) { + if (Object.keys(sorter).length > 0) { + this.isorter.column = sorter.field + this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc' + } + this.ipagination = pagination + this.loadData() + }, + handleSubmit() { + if (this.selectionRows.length > 0) { + this.$bus.$emit('selectionRows', this.selectionRows) + // this.searchReset(0) + this.close() + } else { + this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�') + } + }, + onSelectChange(selectionRows) { + this.selectionRows = selectionRows + }, + searchQuery() { + this.loadData(1) + }, + }, +} +</script> + +<style scoped> +.ant-table-tbody .ant-table-row td { + padding-top: 10px; + padding-bottom: 10px; +} + +#components-layout-demo-custom-trigger .trigger { + font-size: 18px; + line-height: 64px; + padding: 0 24px; + cursor: pointer; + transition: color 0.3s; +} + +/* 绂佺敤琛岀殑鏍峰紡 */ +.disabled-row { + color: #999 !important; /* 鐏拌壊鏂囧瓧 */ + background-color: #f5f5f5 !important; /* 鐏拌壊鑳屾櫙 */ +} + +/* 纭繚绂佺敤琛岀殑澶嶉�夋涔熸樉绀轰负绂佺敤鐘舵�� */ +.disabled-row .ant-checkbox-wrapper { + color: #999; +} + +/* 绂佺敤琛屼腑鐨勬墍鏈夊厓绱� */ +.disabled-row * { + color: #999 !important; + cursor: not-allowed !important; +} +</style> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolHistoryForm.vue b/src/views/tms/modules/TmsToolHistoryForm.vue new file mode 100644 index 0000000..309e5f2 --- /dev/null +++ b/src/views/tms/modules/TmsToolHistoryForm.vue @@ -0,0 +1,134 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <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="inventoryId"> + <a-input v-model="model.inventoryId" placeholder="璇疯緭鍏ュ簱瀛業D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="宸ヨ鏉$爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolBarcode"> + <a-input v-model="model.toolBarcode" placeholder="璇疯緭鍏ュ伐瑁呮潯鐮�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鎿嶄綔浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator"> + <a-input v-model="model.operator" placeholder="璇疯緭鍏ユ搷浣滀汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鎿嶄綔鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operateTime"> + <j-date placeholder="璇烽�夋嫨鎿嶄綔鏃堕棿" v-model="model.operateTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鎿嶄綔绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operateType"> + <a-input v-model="model.operateType" placeholder="璇疯緭鍏ユ搷浣滅被鍨�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="涓氬姟涓昏〃" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="businessTable"> + <a-input v-model="model.businessTable" placeholder="璇疯緭鍏ヤ笟鍔′富琛�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="涓氬姟鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="businessId"> + <a-input v-model="model.businessId" placeholder="璇疯緭鍏ヤ笟鍔d" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'TmsToolHistoryForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/tms/tmsToolHistory/add", + edit: "/tms/tmsToolHistory/edit", + queryById: "/tms/tmsToolHistory/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + 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'; + } + 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; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolHistoryModal.vue b/src/views/tms/modules/TmsToolHistoryModal.vue new file mode 100644 index 0000000..f2e90d7 --- /dev/null +++ b/src/views/tms/modules/TmsToolHistoryModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <tms-tool-history-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tms-tool-history-form> + </j-modal> +</template> + +<script> + + import TmsToolHistoryForm from './TmsToolHistoryForm' + export default { + name: 'TmsToolHistoryModal', + components: { + TmsToolHistoryForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolInboundDetailModal.vue b/src/views/tms/modules/TmsToolInboundDetailModal.vue new file mode 100644 index 0000000..f002465 --- /dev/null +++ b/src/views/tms/modules/TmsToolInboundDetailModal.vue @@ -0,0 +1,133 @@ +<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> + <a-col :span="24"> + <a-form-model-item label="鍏ュ簱鍗�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId"> + <a-input v-model="model.orderId"placeholder="璇疯緭鍏ュ叆搴撳崟" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="宸ヨID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId"> + <a-input v-model="model.toolId"placeholder="璇疯緭鍏ュ伐瑁匢D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍏ュ簱鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveNumber"> + <a-input-number v-model="model.receiveNumber"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' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: "TmsToolInboundDetailModal", + components: { + }, + props:{ + mainId:{ + type:String, + required:false, + default:'' + } + }, + data () { + return { + title:"鎿嶄綔", + width:800, + visible: false, + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/tms/tmsToolInbound/addTmsToolInboundDetail", + edit: "/tms/tmsToolInbound/editTmsToolInboundDetail", + } + + } + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + 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['orderId'] = 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() + }, + + + } + } +</script> diff --git a/src/views/tms/modules/TmsToolInboundForm.vue b/src/views/tms/modules/TmsToolInboundForm.vue new file mode 100644 index 0000000..ce49553 --- /dev/null +++ b/src/views/tms/modules/TmsToolInboundForm.vue @@ -0,0 +1,206 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <!-- 涓昏〃鍗曞尯鍩� --> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24" > + <a-form-model-item label="鍏ュ簱鍗曠姸鎬�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus"> + <j-dict-select-tag type="list" v-model="model.orderStatus" dictCode="" placeholder="璇烽�夋嫨鍏ュ簱鍗曠姸鎬�" /> + </a-form-model-item> + </a-col> + <a-col :span="24" > + <a-form-model-item label="鍏ュ簱浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver"> + <a-input v-model="model.receiver" placeholder="璇疯緭鍏ュ叆搴撲汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24" > + <a-form-model-item label="鍏ュ簱鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveTime"> + <j-date placeholder="璇烽�夋嫨鍏ュ簱鏃堕棿" v-model="model.receiveTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24" > + <a-form-model-item label="鍏ュ簱璇存槑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveComment"> + <a-textarea v-model="model.receiveComment" rows="4" placeholder="璇疯緭鍏ュ叆搴撹鏄�" /> + </a-form-model-item> + </a-col> + <a-col :span="24" > + <a-form-model-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer"> + <a-input v-model="model.confirmer" placeholder="璇疯緭鍏ョ‘璁や汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24" > + <a-form-model-item label="纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime"> + <j-date placeholder="璇烽�夋嫨纭鏃堕棿" v-model="model.confirmTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24" > + <a-form-model-item label="纭鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment"> + <a-input v-model="model.confirmComment" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + <!-- 瀛愯〃鍗曞尯鍩� --> + <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="tmsToolInboundDetailTable.loading" + :columns="tmsToolInboundDetailTable.columns" + :dataSource="tmsToolInboundDetailTable.dataSource" + :maxHeight="300" + :disabled="formDisabled" + :rowNumber="true" + :rowSelection="true" + :toolbar="true" + /> + </a-tab-pane> + </a-tabs> + </a-spin> +</template> + +<script> + + import { getAction } from '@/api/manage' + import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' + import { JVXETypes } from '@/components/jeecg/JVxeTable' + import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js' + import { validateDuplicateValue } from '@/utils/util' + import JFormContainer from '@/components/jeecg/JFormContainer' + + export default { + name: 'TmsToolInboundForm', + mixins: [JVxeTableModelMixin], + components: { + JFormContainer, + }, + data() { + return { + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + model:{ + }, + // 鏂板鏃跺瓙琛ㄩ粯璁ゆ坊鍔犲嚑琛岀┖鏁版嵁 + addDefaultRowNum: 1, + validatorRules: { + }, + refKeys: ['tmsToolInboundDetail', ], + tableKeys:['tmsToolInboundDetail', ], + activeKey: 'tmsToolInboundDetail', + // 宸ヨ鍏ュ簱鏄庣粏 + tmsToolInboundDetailTable: { + loading: false, + dataSource: [], + columns: [ + { + title: '鍏ュ簱鍗�', + key: 'orderId', + type: JVXETypes.input, + width:"200px", + placeholder: '璇疯緭鍏�${title}', + defaultValue:'', + }, + { + title: '宸ヨID', + key: 'toolId', + type: JVXETypes.input, + width:"200px", + placeholder: '璇疯緭鍏�${title}', + defaultValue:'', + }, + { + title: '鍏ュ簱鏁伴噺', + key: 'receiveNumber', + type: JVXETypes.input, + width:"200px", + placeholder: '璇疯緭鍏�${title}', + defaultValue:'', + }, + ] + }, + url: { + add: "/tms/tmsToolInbound/add", + edit: "/tms/tmsToolInbound/edit", + queryById: "/tms/tmsToolInbound/queryById", + tmsToolInboundDetail: { + list: '/tms/tmsToolInbound/queryTmsToolInboundDetailByMainId' + }, + } + } + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + }, + methods: { + addBefore(){ + this.tmsToolInboundDetailTable.dataSource=[] + }, + getAllTable() { + let values = this.tableKeys.map(key => getRefPromise(this, key)) + return Promise.all(values) + }, + /** 璋冪敤瀹宔dit()鏂规硶涔嬪悗浼氳嚜鍔ㄨ皟鐢ㄦ鏂规硶 */ + editAfter() { + this.$nextTick(() => { + }) + // 鍔犺浇瀛愯〃鏁版嵁 + if (this.model.id) { + let params = { id: this.model.id } + this.requestSubTableData(this.url.tmsToolInboundDetail.list, params, this.tmsToolInboundDetailTable) + } + }, + //鏍¢獙鎵�鏈変竴瀵逛竴瀛愯〃琛ㄥ崟 + validateSubForm(allValues){ + return new Promise((resolve,reject)=>{ + Promise.all([ + ]).then(() => { + resolve(allValues) + }).catch(e => { + if (e.error === VALIDATE_FAILED) { + // 濡傛灉鏈夋湭閫氳繃琛ㄥ崟楠岃瘉鐨勫瓙琛紝灏辫嚜鍔ㄨ烦杞埌瀹冩墍鍦ㄧ殑tab + this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index] + } else { + console.error(e) + } + }) + }) + }, + /** 鏁寸悊鎴恌ormData */ + classifyIntoFormData(allValues) { + let main = Object.assign(this.model, allValues.formValue) + return { + ...main, // 灞曞紑 + tmsToolInboundDetailList: allValues.tablesValue[0].tableData, + } + }, + validateError(msg){ + this.$message.error(msg) + }, + + } + } +</script> + +<style scoped> +</style> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolInboundInventoryForm.vue b/src/views/tms/modules/TmsToolInboundInventoryForm.vue new file mode 100644 index 0000000..a6bd516 --- /dev/null +++ b/src/views/tms/modules/TmsToolInboundInventoryForm.vue @@ -0,0 +1,109 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鍏ュ簱鍗旾D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId"> + <a-input v-model="model.orderId" placeholder="璇疯緭鍏ュ叆搴撳崟ID" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="搴撳瓨ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId"> + <a-input v-model="model.inventoryId" placeholder="璇疯緭鍏ュ簱瀛業D" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'TmsToolInboundInventoryForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/tms/tmsToolInboundInventory/add", + edit: "/tms/tmsToolInboundInventory/edit", + queryById: "/tms/tmsToolInboundInventory/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + 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'; + } + 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; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolInboundInventoryModal.vue b/src/views/tms/modules/TmsToolInboundInventoryModal.vue new file mode 100644 index 0000000..a7c360d --- /dev/null +++ b/src/views/tms/modules/TmsToolInboundInventoryModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <tms-tool-inbound-inventory-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tms-tool-inbound-inventory-form> + </j-modal> +</template> + +<script> + + import TmsToolInboundInventoryForm from './TmsToolInboundInventoryForm' + export default { + name: 'TmsToolInboundInventoryModal', + components: { + TmsToolInboundInventoryForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolInboundModal.vue b/src/views/tms/modules/TmsToolInboundModal.vue new file mode 100644 index 0000000..d84913c --- /dev/null +++ b/src/views/tms/modules/TmsToolInboundModal.vue @@ -0,0 +1,326 @@ +<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> +<!-- <a-col :span="12">--> +<!-- <a-form-model-item label="鍏ュ簱鍗曠姸鎬�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus">--> +<!--<!– <j-dict-select-tag type="list" v-model="model.orderStatus" dictCode="" placeholder="璇烽�夋嫨鍏ュ簱鍗曠姸鎬�" />–>--> +<!-- <a-input type="list" v-model="model.orderStatus" placeholder="璇烽�夋嫨鍏ュ簱鍗曠姸鎬�" />--> +<!-- </a-form-model-item>--> +<!-- </a-col>--> + <a-col :span="12"> + <a-form-model-item label="鍏ュ簱浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver"> + <a-input :disabled="disableSubmit" v-model="model.receiver" placeholder="璇疯緭鍏ュ叆搴撲汉" ></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 :disabled="disableSubmit" :show-time="true" dateFormat="YYYY-MM-DD HH:mm" placeholder="璇烽�夋嫨鍏ュ簱鏃堕棿" v-model="model.receiveTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鍏ュ簱璇存槑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveComment"> + <a-textarea :disabled="disableSubmit" v-model="model.receiveComment" rows="4" placeholder="璇疯緭鍏ュ叆搴撹鏄�" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer"> + <a-input :disabled="disableSubmit" v-model="model.confirmer" placeholder="璇疯緭鍏ョ‘璁や汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime"> + <j-date :disabled="disableSubmit" :show-time="true" dateFormat="YYYY-MM-DD HH:mm" placeholder="璇烽�夋嫨纭鏃堕棿" v-model="model.confirmTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="纭鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment"> + <a-textarea :disabled="disableSubmit" v-model="model.confirmComment" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" ></a-textarea> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + + <a-button v-show="selectInboundToolFlag" type="primary" :style="{ marginBottom: '8px' }" @click="selectInboundTool">閫夋嫨鍏ュ簱宸ヨ</a-button> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="null" + @change="handleTableChange"> + + <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index"> + <div :key="col.dataIndex"> + <a-input-number + v-if="col.dataIndex === 'receiveNumber'" + :value="text" + @change="(e) => handleChange(e, record.key, col, index)" + :min="1" + /> + </div> + </template> + <span slot="action" v-if="disableSubmit === false" slot-scope="text, record, index"> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record, index)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + </a-table> + <template slot="footer" v-if="disableSubmit === false"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + <a-button @click="handleOk" :disabled="isDisabled" type="primary">纭畾</a-button> + </template> + + <j-select-inbound-tool-modal ref="selectInboundToolModal"></j-select-inbound-tool-modal> + </j-modal> +</template> + +<script> + + import { httpAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + import JSelectInboundToolModal from './JSelectInboundToolModal.vue' + import { getAction } from '../../../api/manage' + + export default { + name: "TmsToolInboundModal", + components: { + JSelectInboundToolModal + }, + data () { + return { + title:"", + width:1200, + visible: false, + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + list: "/tms/tmsToolInbound/listTmsToolInboundDetailByMainId", + add: "/tms/tmsToolInbound/add", + edit: "/tms/tmsToolInbound/edit", + }, + disableSubmit: false, + isDisabled: false, + selectInboundToolFlag: true, + loading: false, + //琛ㄦ牸鍙傛暟 + ipagination: { + current: 1, + pageSize: 10, + total: 0, + }, + dataSource: [], + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'宸ヨ鍚嶇О', + align:"center", + dataIndex: 'toolName' + }, + { + title:'宸ヨ缂栫爜', + align:"center", + dataIndex: 'toolCode' + }, + { + title:'宸ヨ鍒嗙被', + align:"center", + dataIndex: 'toolCategory' + }, + { + title:'鍨嬪彿', + align:"center", + dataIndex: 'toolModel' + }, + { + title:'瑙勬牸', + align:"center", + dataIndex: 'toolSpecification' + }, + { + title:'鍗曚綅', + align:"center", + dataIndex: 'toolUnit' + }, + { + title:'瀛樻斁浣嶇疆', + align:"center", + dataIndex: 'storeLocation' + }, + { + title:'渚涘簲鍟�', + align:"center", + dataIndex: 'supplierId' + }, + { + title:'鍏ュ簱鏁伴噺', + align:"center", + dataIndex: 'receiveNumber', + scopedSlots: { customRender: 'receiveNumber' }, + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + scopedSlots: { customRender: 'action' }, + } + ], + } + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + mounted() { + this.$bus.$on('selectionRows', (data) => { + for (let i = 0; i < data.length; i++) { + this.dataSource.push({ + id: data[i].id, + toolId: data[i].id, + toolName:data[i].toolName, + toolCode:data[i].toolCode, + toolCategory: data[i].toolCategory, + toolModel: data[i].toolModel, + toolSpecification: data[i].toolSpecification, + toolUnit: data[i].toolUnit, + storeLocation: data[i].storeLocation, + supplierId: data[i].supplierId + }) + } + this.ipagination.total = this.dataSource.length + }) + }, + methods: { + handleDelete(record, index) { + this.dataSource.splice(index, 1) + }, + handleChange(value, key, column, index) { + console.log(value, key, column, index) + const temp = [...this.dataSource] + const target = temp.filter(item => key === item.key)[index]; + if (target) { + target[column.dataIndex] = value + this.dataSource = temp + if(column.dataIndex === 'receiveNumber'){ + if(target['receiveNumber']<1){ + this.$message.error('鍏ュ簱鏁伴噺涓嶈兘灏忎簬1锛�') + this.isDisabled = true + }else{ + this.isDisabled = false + } + } + this.dataSource = temp + } + }, + selectInboundTool() { + console.log(this.dataSource) + let ids = this.dataSource.map(item => item.toolId).join(',') + this.$refs.selectInboundToolModal.showOrderModal(ids) + }, + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + if (record.id) { + getAction(this.url.list, { orderId: record.id }).then(res => { + if (res.success) { + this.dataSource = res.result.records + this.ipagination.total = res.result.length + } + this.selectInboundToolFlag = this.title !== '璇︽儏'; + }) + } + }, + handleTableChange(pagination, filters, sorter) { + this.ipagination = pagination + }, + close () { + this.$emit('close'); + this.visible = false; + this.selectInboundToolFlag = true + this.dataSource = [] + this.$refs.form.clearValidate(); + }, + 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.tmsToolInboundDetailList = this.dataSource.map( + item => { + return { + toolId: item.toolId, + receiveNumber: item.receiveNumber + } + } + ) + 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() + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolInventoryForm.vue b/src/views/tms/modules/TmsToolInventoryForm.vue new file mode 100644 index 0000000..c5292e7 --- /dev/null +++ b/src/views/tms/modules/TmsToolInventoryForm.vue @@ -0,0 +1,119 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="宸ヨ鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId"> + <a-input v-model="model.toolId" placeholder="璇疯緭鍏ュ伐瑁呭悕绉�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="宸ヨ鏉$爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolBarcode"> + <a-input v-model="model.toolBarcode" placeholder="璇疯緭鍏ュ伐瑁呮潯鐮�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="搴撳瓨鐘舵��" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryStatus"> + <a-input v-model="model.inventoryStatus" placeholder="璇疯緭鍏ュ簱瀛樼姸鎬�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="褰撳墠瀵垮懡(鐧惧垎姣�)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="currentLife"> + <a-input-number v-model="model.currentLife" placeholder="璇疯緭鍏ュ綋鍓嶅鍛�(鐧惧垎姣�)" style="width: 100%" /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'TmsToolInventoryForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/tms/tmsToolInventory/add", + edit: "/tms/tmsToolInventory/edit", + queryById: "/tms/tmsToolInventory/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + 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'; + } + 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; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolInventoryModal.vue b/src/views/tms/modules/TmsToolInventoryModal.vue new file mode 100644 index 0000000..5bc780c --- /dev/null +++ b/src/views/tms/modules/TmsToolInventoryModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <tms-tool-inventory-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tms-tool-inventory-form> + </j-modal> +</template> + +<script> + + import TmsToolInventoryForm from './TmsToolInventoryForm' + export default { + name: 'TmsToolInventoryModal', + components: { + TmsToolInventoryForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolReceiveDetailModal.vue b/src/views/tms/modules/TmsToolReceiveDetailModal.vue new file mode 100644 index 0000000..2762785 --- /dev/null +++ b/src/views/tms/modules/TmsToolReceiveDetailModal.vue @@ -0,0 +1,138 @@ +<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> + <a-col :span="24"> + <a-form-model-item label="棰嗙敤鍗旾D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId"> + <a-input v-model="model.orderId"placeholder="璇疯緭鍏ラ鐢ㄥ崟ID" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="宸ヨID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId"> + <a-input v-model="model.toolId"placeholder="璇疯緭鍏ュ伐瑁匢D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="搴撳瓨ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId"> + <a-input v-model="model.inventoryId"placeholder="璇疯緭鍏ュ簱瀛業D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="浣跨敤瀵垮懡(鐧惧垎姣�)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="usedLife"> + <a-input-number v-model="model.usedLife"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' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: "TmsToolReceiveDetailModal", + components: { + }, + props:{ + mainId:{ + type:String, + required:false, + default:'' + } + }, + data () { + return { + title:"鎿嶄綔", + width:800, + visible: false, + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/tms/tmsToolReceive/addTmsToolReceiveDetail", + edit: "/tms/tmsToolReceive/editTmsToolReceiveDetail", + } + + } + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + 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['orderId'] = 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() + }, + + + } + } +</script> diff --git a/src/views/tms/modules/TmsToolReceiveModal.vue b/src/views/tms/modules/TmsToolReceiveModal.vue new file mode 100644 index 0000000..0bbc0f9 --- /dev/null +++ b/src/views/tms/modules/TmsToolReceiveModal.vue @@ -0,0 +1,179 @@ +<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> + <a-col :span="12"> + <a-form-model-item label="棰嗙敤鍗曠姸鎬�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus"> + <a-input v-model="model.orderStatus" placeholder="璇疯緭鍏ラ鐢ㄥ崟鐘舵��" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="棰嗙敤浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver"> + <a-input v-model="model.receiver" placeholder="璇疯緭鍏ラ鐢ㄤ汉" ></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" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="棰嗙敤璇存槑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveComment"> + <a-textarea v-model="model.receiveComment" rows="4" placeholder="璇疯緭鍏ラ鐢ㄨ鏄�" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer"> + <a-input v-model="model.confirmer" placeholder="璇疯緭鍏ョ‘璁や汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime"> + <j-date placeholder="璇烽�夋嫨纭鏃堕棿" v-model="model.confirmTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="纭鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment"> + <a-textarea v-model="model.confirmComment" rows="4" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鏄惁浼氬綊杩�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnFlag"> +<!-- <a-input v-model="model.returnFlag" placeholder="璇疯緭鍏ユ槸鍚︿細褰掕繕" ></a-input>--> + <a-radio-group v-model="model.returnFlag"> + <a-radio value="1">鏄�</a-radio> + <a-radio value="0">鍚�</a-radio> + </a-radio-group> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="褰掕繕鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnTime"> + <j-date placeholder="璇烽�夋嫨褰掕繕鏃堕棿" v-model="model.returnTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="褰掕繕璇存槑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnComment"> + <a-textarea v-model="model.returnComment" rows="4" placeholder="璇疯緭鍏ュ綊杩樿鏄�" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="褰掕繕纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmer"> + <a-input v-model="model.returnConfirmer" placeholder="璇疯緭鍏ュ綊杩樼‘璁や汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="褰掕繕纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmTime"> + <j-date placeholder="璇烽�夋嫨褰掕繕纭鏃堕棿" v-model="model.returnConfirmTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="褰掕繕纭鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnConfirmComment"> + <a-textarea v-model="model.returnConfirmComment" rows="4" placeholder="璇疯緭鍏ュ綊杩樼‘璁ゆ剰瑙�" /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + + import { httpAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: "TmsToolReceiveModal", + components: { + }, + data () { + return { + title:"鎿嶄綔", + width:1000, + visible: false, + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/tms/tmsToolReceive/add", + edit: "/tms/tmsToolReceive/edit", + } + + } + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + 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'; + } + 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() + }, + + + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolScrapDetailModal.vue b/src/views/tms/modules/TmsToolScrapDetailModal.vue new file mode 100644 index 0000000..dd531f3 --- /dev/null +++ b/src/views/tms/modules/TmsToolScrapDetailModal.vue @@ -0,0 +1,133 @@ +<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> + <a-col :span="24"> + <a-form-model-item label="鎶ュ簾鍗旾D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId"> + <a-input v-model="model.orderId"placeholder="璇疯緭鍏ユ姤搴熷崟ID" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="宸ヨID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId"> + <a-input v-model="model.toolId"placeholder="璇疯緭鍏ュ伐瑁匢D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="搴撳瓨ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId"> + <a-input v-model="model.inventoryId"placeholder="璇疯緭鍏ュ簱瀛業D" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + + import { httpAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: "TmsToolScrapDetailModal", + components: { + }, + props:{ + mainId:{ + type:String, + required:false, + default:'' + } + }, + data () { + return { + title:"鎿嶄綔", + width:800, + visible: false, + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/tms/tmsToolScrap/addTmsToolScrapDetail", + edit: "/tms/tmsToolScrap/editTmsToolScrapDetail", + } + + } + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + 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['orderId'] = 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() + }, + + + } + } +</script> diff --git a/src/views/tms/modules/TmsToolScrapForm.vue b/src/views/tms/modules/TmsToolScrapForm.vue new file mode 100644 index 0000000..fc79bd7 --- /dev/null +++ b/src/views/tms/modules/TmsToolScrapForm.vue @@ -0,0 +1,206 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <!-- 涓昏〃鍗曞尯鍩� --> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24" > + <a-form-model-item label="鎶ュ簾鍗曠姸鎬�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus"> + <a-input v-model="model.orderStatus" placeholder="璇疯緭鍏ユ姤搴熷崟鐘舵��" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24" > + <a-form-model-item label="鐢宠浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicant"> + <a-input v-model="model.applicant" placeholder="璇疯緭鍏ョ敵璇蜂汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24" > + <a-form-model-item label="鐢宠鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationTime"> + <j-date placeholder="璇烽�夋嫨鐢宠鏃堕棿" v-model="model.applicationTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24" > + <a-form-model-item label="鐢宠璇存槑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationComment"> + <a-textarea v-model="model.applicationComment" rows="4" placeholder="璇疯緭鍏ョ敵璇疯鏄�" /> + </a-form-model-item> + </a-col> + <a-col :span="24" > + <a-form-model-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer"> + <a-input v-model="model.confirmer" placeholder="璇疯緭鍏ョ‘璁や汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24" > + <a-form-model-item label="纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime"> + <j-date placeholder="璇烽�夋嫨纭鏃堕棿" v-model="model.confirmTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24" > + <a-form-model-item label="纭鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment"> + <a-textarea v-model="model.confirmComment" rows="4" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + <!-- 瀛愯〃鍗曞尯鍩� --> + <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="tmsToolScrapDetailTable.loading" + :columns="tmsToolScrapDetailTable.columns" + :dataSource="tmsToolScrapDetailTable.dataSource" + :maxHeight="300" + :disabled="formDisabled" + :rowNumber="true" + :rowSelection="true" + :toolbar="true" + /> + </a-tab-pane> + </a-tabs> + </a-spin> +</template> + +<script> + + import { getAction } from '@/api/manage' + import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' + import { JVXETypes } from '@/components/jeecg/JVxeTable' + import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js' + import { validateDuplicateValue } from '@/utils/util' + import JFormContainer from '@/components/jeecg/JFormContainer' + + export default { + name: 'TmsToolScrapForm', + mixins: [JVxeTableModelMixin], + components: { + JFormContainer, + }, + data() { + return { + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + model:{ + }, + // 鏂板鏃跺瓙琛ㄩ粯璁ゆ坊鍔犲嚑琛岀┖鏁版嵁 + addDefaultRowNum: 1, + validatorRules: { + }, + refKeys: ['tmsToolScrapDetail', ], + tableKeys:['tmsToolScrapDetail', ], + activeKey: 'tmsToolScrapDetail', + // 宸ヨ鎶ュ簾鏄庣粏 + tmsToolScrapDetailTable: { + loading: false, + dataSource: [], + columns: [ + { + title: '鎶ュ簾鍗旾D', + key: 'orderId', + type: JVXETypes.input, + width:"200px", + placeholder: '璇疯緭鍏�${title}', + defaultValue:'', + }, + { + title: '宸ヨID', + key: 'toolId', + type: JVXETypes.input, + width:"200px", + placeholder: '璇疯緭鍏�${title}', + defaultValue:'', + }, + { + title: '搴撳瓨ID', + key: 'inventoryId', + type: JVXETypes.input, + width:"200px", + placeholder: '璇疯緭鍏�${title}', + defaultValue:'', + }, + ] + }, + url: { + add: "/tms/tmsToolScrap/add", + edit: "/tms/tmsToolScrap/edit", + queryById: "/tms/tmsToolScrap/queryById", + tmsToolScrapDetail: { + list: '/tms/tmsToolScrap/queryTmsToolScrapDetailByMainId' + }, + } + } + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + }, + methods: { + addBefore(){ + this.tmsToolScrapDetailTable.dataSource=[] + }, + getAllTable() { + let values = this.tableKeys.map(key => getRefPromise(this, key)) + return Promise.all(values) + }, + /** 璋冪敤瀹宔dit()鏂规硶涔嬪悗浼氳嚜鍔ㄨ皟鐢ㄦ鏂规硶 */ + editAfter() { + this.$nextTick(() => { + }) + // 鍔犺浇瀛愯〃鏁版嵁 + if (this.model.id) { + let params = { id: this.model.id } + this.requestSubTableData(this.url.tmsToolScrapDetail.list, params, this.tmsToolScrapDetailTable) + } + }, + //鏍¢獙鎵�鏈変竴瀵逛竴瀛愯〃琛ㄥ崟 + validateSubForm(allValues){ + return new Promise((resolve,reject)=>{ + Promise.all([ + ]).then(() => { + resolve(allValues) + }).catch(e => { + if (e.error === VALIDATE_FAILED) { + // 濡傛灉鏈夋湭閫氳繃琛ㄥ崟楠岃瘉鐨勫瓙琛紝灏辫嚜鍔ㄨ烦杞埌瀹冩墍鍦ㄧ殑tab + this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index] + } else { + console.error(e) + } + }) + }) + }, + /** 鏁寸悊鎴恌ormData */ + classifyIntoFormData(allValues) { + let main = Object.assign(this.model, allValues.formValue) + return { + ...main, // 灞曞紑 + tmsToolScrapDetailList: allValues.tablesValue[0].tableData, + } + }, + validateError(msg){ + this.$message.error(msg) + }, + + } + } +</script> + +<style scoped> +</style> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolScrapModal.vue b/src/views/tms/modules/TmsToolScrapModal.vue new file mode 100644 index 0000000..35a3661 --- /dev/null +++ b/src/views/tms/modules/TmsToolScrapModal.vue @@ -0,0 +1,145 @@ +<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> + <a-col :span="12"> + <a-form-model-item label="鎶ュ簾鍗曠姸鎬�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus"> + <a-input v-model="model.orderStatus" placeholder="璇疯緭鍏ユ姤搴熷崟鐘舵��" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鐢宠浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicant"> + <a-input v-model="model.applicant" placeholder="璇疯緭鍏ョ敵璇蜂汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鐢宠鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationTime"> + <j-date placeholder="璇烽�夋嫨鐢宠鏃堕棿" v-model="model.applicationTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鐢宠璇存槑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationComment"> + <a-textarea v-model="model.applicationComment" rows="4" placeholder="璇疯緭鍏ョ敵璇疯鏄�" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer"> + <a-input v-model="model.confirmer" placeholder="璇疯緭鍏ョ‘璁や汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="纭鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime"> + <j-date placeholder="璇烽�夋嫨纭鏃堕棿" v-model="model.confirmTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="纭鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment"> + <a-textarea v-model="model.confirmComment" rows="4" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + + import { httpAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: "TmsToolScrapModal", + components: { + }, + data () { + return { + title:"鎿嶄綔", + width:1000, + visible: false, + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/tms/tmsToolScrap/add", + edit: "/tms/tmsToolScrap/edit", + } + + } + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + 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'; + } + 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() + }, + + + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolStocktakingDetailModal.vue b/src/views/tms/modules/TmsToolStocktakingDetailModal.vue new file mode 100644 index 0000000..ec2e759 --- /dev/null +++ b/src/views/tms/modules/TmsToolStocktakingDetailModal.vue @@ -0,0 +1,143 @@ +<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> + <a-col :span="24"> + <a-form-model-item label="鐩樼偣鍗旾D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId"> + <a-input v-model="model.orderId"placeholder="璇疯緭鍏ョ洏鐐瑰崟ID" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="宸ヨID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId"> + <a-input v-model="model.toolId"placeholder="璇疯緭鍏ュ伐瑁匢D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐩樼偣鍓嶆暟閲�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="beforeNumber"> + <a-input-number v-model="model.beforeNumber"placeholder="璇疯緭鍏ョ洏鐐瑰墠鏁伴噺" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="瀹為檯鐩樼偣鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualNumber"> + <a-input-number v-model="model.actualNumber"placeholder="璇疯緭鍏ュ疄闄呯洏鐐规暟閲�" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鐩樼偣缁撴灉" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stocktakingResult"> + <a-input v-model="model.stocktakingResult"placeholder="璇疯緭鍏ョ洏鐐圭粨鏋�" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + + import { httpAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: "TmsToolStocktakingDetailModal", + components: { + }, + props:{ + mainId:{ + type:String, + required:false, + default:'' + } + }, + data () { + return { + title:"鎿嶄綔", + width:800, + visible: false, + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/tms/tmsToolStocktaking/addTmsToolStocktakingDetail", + edit: "/tms/tmsToolStocktaking/editTmsToolStocktakingDetail", + } + + } + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + 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['orderId'] = 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() + }, + + + } + } +</script> diff --git a/src/views/tms/modules/TmsToolStocktakingInventoryChangeForm.vue b/src/views/tms/modules/TmsToolStocktakingInventoryChangeForm.vue new file mode 100644 index 0000000..0c2a74c --- /dev/null +++ b/src/views/tms/modules/TmsToolStocktakingInventoryChangeForm.vue @@ -0,0 +1,124 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="鐩樼偣鏄庣粏ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="detailId"> + <a-input v-model="model.detailId" placeholder="璇疯緭鍏ョ洏鐐规槑缁咺D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="搴撳瓨ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId"> + <a-input v-model="model.inventoryId" placeholder="璇疯緭鍏ュ簱瀛業D" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="宸ヨ鏉$爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolBarcode"> + <a-input v-model="model.toolBarcode" placeholder="璇疯緭鍏ュ伐瑁呮潯鐮�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏁伴噺(榛樿1)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number"> + <a-input-number v-model="model.number" placeholder="璇疯緭鍏ユ暟閲�(榛樿1)" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鍙樻洿绫诲瀷;姝e父/鍑哄簱/鍏ュ簱" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="changeType"> + <a-input v-model="model.changeType" placeholder="璇疯緭鍏ュ彉鏇寸被鍨�;姝e父/鍑哄簱/鍏ュ簱" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'TmsToolStocktakingInventoryChangeForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/tms/tmsToolStocktakingInventoryChange/add", + edit: "/tms/tmsToolStocktakingInventoryChange/edit", + queryById: "/tms/tmsToolStocktakingInventoryChange/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + 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'; + } + 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; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolStocktakingInventoryChangeModal.vue b/src/views/tms/modules/TmsToolStocktakingInventoryChangeModal.vue new file mode 100644 index 0000000..385ff9f --- /dev/null +++ b/src/views/tms/modules/TmsToolStocktakingInventoryChangeModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <tms-tool-stocktaking-inventory-change-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tms-tool-stocktaking-inventory-change-form> + </j-modal> +</template> + +<script> + + import TmsToolStocktakingInventoryChangeForm from './TmsToolStocktakingInventoryChangeForm' + export default { + name: 'TmsToolStocktakingInventoryChangeModal', + components: { + TmsToolStocktakingInventoryChangeForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolStocktakingModal.vue b/src/views/tms/modules/TmsToolStocktakingModal.vue new file mode 100644 index 0000000..6617db4 --- /dev/null +++ b/src/views/tms/modules/TmsToolStocktakingModal.vue @@ -0,0 +1,135 @@ +<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> + <a-col :span="12"> + <a-form-model-item label="鐩樼偣鍗曞彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCode"> + <a-input v-model="model.orderCode" placeholder="璇疯緭鍏ョ洏鐐瑰崟鍙�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鐩樼偣鐘舵��" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus"> + <a-input v-model="model.orderStatus" placeholder="璇疯緭鍏ョ洏鐐圭姸鎬�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鐩樼偣浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator"> + <a-input v-model="model.operator" placeholder="璇疯緭鍏ョ洏鐐逛汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鐩樼偣鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operateTime"> + <j-date placeholder="璇烽�夋嫨鐩樼偣鏃堕棿" v-model="model.operateTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> + <a-textarea v-model="model.remark" rows="4" placeholder="璇疯緭鍏ュ娉�" /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + + import { httpAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: "TmsToolStocktakingModal", + components: { + }, + data () { + return { + title:"鎿嶄綔", + width:1000, + visible: false, + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/tms/tmsToolStocktaking/add", + edit: "/tms/tmsToolStocktaking/edit", + } + + } + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + 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'; + } + 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() + }, + + + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolsForm.vue b/src/views/tms/modules/TmsToolsForm.vue new file mode 100644 index 0000000..5ca2cd4 --- /dev/null +++ b/src/views/tms/modules/TmsToolsForm.vue @@ -0,0 +1,171 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <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="toolName"> + <a-input v-model="model.toolName" placeholder="璇疯緭鍏ュ伐瑁呭悕绉�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="宸ヨ缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolCode"> + <a-input v-model="model.toolCode" placeholder="璇疯緭鍏ュ伐瑁呯紪鐮�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="宸ヨ鍒嗙被" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolCategory"> + <a-input v-model="model.toolCategory" placeholder="璇疯緭鍏ュ伐瑁呭垎绫�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鍨嬪彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolModel"> + <a-input v-model="model.toolModel" placeholder="璇疯緭鍏ュ瀷鍙�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="瑙勬牸" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolSpecification"> + <a-input v-model="model.toolSpecification" placeholder="璇疯緭鍏ヨ鏍�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鍗曚綅" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolUnit"> + <a-input v-model="model.toolUnit" placeholder="璇疯緭鍏ュ崟浣�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="瀛樻斁浣嶇疆" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="storeLocation"> + <a-input v-model="model.storeLocation" placeholder="璇疯緭鍏ュ瓨鏀句綅缃�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="渚涘簲鍟�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="supplierId"> + <a-input v-model="model.supplierId" placeholder="璇疯緭鍏ヤ緵搴斿晢" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="搴撳瓨棰勮鍊�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryWarning"> + <a-input-number v-model="model.inventoryWarning" placeholder="璇疯緭鍏ュ簱瀛橀璀﹀��" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> + <a-textarea v-model="model.remark" rows="4" placeholder="璇疯緭鍏ュ娉�" /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'TmsToolsForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + toolName: [ + { required: true, message: '璇疯緭鍏ュ伐瑁呭悕绉�!'}, + ], + toolCode: [ + { required: true, message: '璇疯緭鍏ュ伐瑁呯紪鐮�!'}, + { validator: (rule, value, callback) => validateDuplicateValue('tms_tools', 'tool_code', value, this.model.id, callback)}, + ], + toolCategory: [ + { required: true, message: '璇疯緭鍏ュ伐瑁呭垎绫�!'}, + ], + toolModel: [ + { required: true, message: '璇疯緭鍏ュ瀷鍙�!'}, + ], + toolSpecification: [ + { required: true, message: '璇疯緭鍏ヨ鏍�!'}, + ], + storeLocation: [ + { required: true, message: '璇疯緭鍏ュ瓨鏀句綅缃�!'}, + ], + inventoryWarning: [ + { required: true, message: '璇疯緭鍏ュ簱瀛橀璀﹀��!'}, + ], + }, + url: { + add: "/tms/tmsTools/add", + edit: "/tms/tmsTools/edit", + queryById: "/tms/tmsTools/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + 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'; + } + 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; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/TmsToolsModal.vue b/src/views/tms/modules/TmsToolsModal.vue new file mode 100644 index 0000000..cf420df --- /dev/null +++ b/src/views/tms/modules/TmsToolsModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <tms-tools-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tms-tools-form> + </j-modal> +</template> + +<script> + + import TmsToolsForm from './TmsToolsForm' + export default { + name: 'TmsToolsModal', + components: { + TmsToolsForm + }, + data () { + return { + title:'', + width:1000, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file -- Gitblit v1.9.3