From 3e189124a64cecd9f2467aa7e4cb05aa4436b500 Mon Sep 17 00:00:00 2001 From: cuijian <cuijian@xalxzn.com> Date: 星期一, 26 五月 2025 11:50:07 +0800 Subject: [PATCH] 工具入库申请 --- src/views/tms/modules/inbound/JSelectReturnListModal.vue | 290 +++++++ src/views/flowable/workflow/inboundOrder/InboundOrderHandle.vue | 445 +++++++++++ src/views/tms/modules/baseTools/BaseToolsListLeft.vue | 9 src/views/tms/InboundOrderList.vue | 243 ++++++ src/views/tms/modules/inbound/JSelectSharpenListModal.vue | 273 +++++++ src/views/tms/modules/inbound/InboundOrderModel.vue | 600 +++++++++++++++ src/views/tms/modules/inbound/JSelectToolingModal.vue | 254 ++++++ src/views/flowable/workflow/FlowTodo.vue | 20 src/views/tms/modules/inbound/InboundDetailList.vue | 88 ++ 9 files changed, 2,216 insertions(+), 6 deletions(-) diff --git a/src/views/flowable/workflow/FlowTodo.vue b/src/views/flowable/workflow/FlowTodo.vue index 6c18e0c..7245338 100644 --- a/src/views/flowable/workflow/FlowTodo.vue +++ b/src/views/flowable/workflow/FlowTodo.vue @@ -136,6 +136,8 @@ <third-maintenance-approval-modal ref="thirdMaintenanceApprovalModal" :selectShenpiData="selectThirdMaintenanceData" @searchReset="searchReset"></third-maintenance-approval-modal> <equipment-seal-up-approval-modal ref="equipmentSealUpApprovalModelRef" @searchReset="searchReset" /> + <inbound-order-handle ref="inboundOrderApprovalModal" :selectInboundOrderData="selectInboundOrderData" + @searchReset="searchReset"></inbound-order-handle> </a-card> </template> @@ -163,6 +165,7 @@ import EquipmentSealUpApprovalModal from '@views/flowable/workflow/sealUp/EquipmentSealUpApprovalModal.vue' import stocktakingBoundHandle from '@views/flowable/workflow/stocktakingBound/stocktakingBoundHandle.vue' import lossBoundHandle from '@views/flowable/workflow/lossBound/lossBoundHandle.vue' +import InboundOrderHandle from '@views/flowable/workflow/inboundOrder/InboundOrderHandle.vue' export default { name: 'NcDeviceCharactersList', @@ -183,7 +186,8 @@ SecondMaintenanceApprovalModal, ThirdMaintenanceApprovalModal, OutBoundOrderHandle, - EquipmentSealUpApprovalModal + EquipmentSealUpApprovalModal, + InboundOrderHandle }, data() { return { @@ -268,6 +272,7 @@ selectOutBoundOrderData: {}, selectLossBoundOrderData: {}, selectStocktakingBoundOrderData: {}, + selectInboundOrderData:{}, //涓氬姟淇℃伅ID dataId: undefined } @@ -359,6 +364,9 @@ break case 'equipment_seal_up': this.handleEquipmentSealUp(item) + break + case 'toolInStorageApproval': + this.handleToolInStorage(item) break default: alert('娌℃壘鍒拌娴佺▼') @@ -495,7 +503,15 @@ this.$refs.equipmentSealUpApprovalModelRef.title = item.name this.$refs.equipmentSealUpApprovalModelRef.handleDetail(item) this.$refs.equipmentSealUpApprovalModelRef.disableSubmit = false - } + }, + handleToolInStorage(item) { + if (item && item.dataId) { + this.selectInboundOrderData = Object.assign({}, item) + this.$refs.inboundOrderApprovalModal.auditVisible = true + this.$refs.inboundOrderApprovalModal.clearTableSource() + this.$refs.inboundOrderApprovalModal.getAllApproveData(item) + } + }, } } </script> diff --git a/src/views/flowable/workflow/inboundOrder/InboundOrderHandle.vue b/src/views/flowable/workflow/inboundOrder/InboundOrderHandle.vue new file mode 100644 index 0000000..e8af61a --- /dev/null +++ b/src/views/flowable/workflow/inboundOrder/InboundOrderHandle.vue @@ -0,0 +1,445 @@ +<template> + <a-modal + :title="title" + :width="width" + :visible="visible" + :footer="null" + @cancel="handCancel" + > + <a-card :bordered="false"> + <div> + <b>{{ selectInboundOrderData.description }}</b> + <br> + <br> + <a-tag color="blue"> + 澶勭悊浜� {{ selectInboundOrderData.assignee_dictText }} + </a-tag> + <a-tag color="blue"> + 鍒涘缓鏃堕棿 {{ selectInboundOrderData.createTime }} + </a-tag> + <br> + <br> + <button @click="fetchAndShowBmp" class="btn-custom">鎵撳紑娴佺▼鍥�</button> + <div v-if="imageSrc"> + <img :src="imageSrc" alt="Fetched Image" /> + </div> + <hr class="shallow-hr"> + </div> + <div> + <b>鐢宠鍗曡鎯�</b> + <br> + <a-form :form='form'> + <a-spin :spinning="spinning"> + <a-tabs default-active-key='1' @change='callback'> + <a-tab-pane key='1' tab='鐢宠鍗曞熀鏈俊鎭�'> + <a-form-model ref='form' :model='tableRowRecord'> + <a-row> + <a-col :span='span'> + <a-form-model-item label='鍏ュ簱鍗曠紪鍙�' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='inboundNum'> + <a-input :disabled='coldisabled' v-model='tableRowRecord.inboundNum'></a-input> + </a-form-model-item> + </a-col> + <a-col :span='span'> + <a-form-model-item label='鍏ュ簱绫诲瀷' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='inStorehouseType'> + <j-dict-select-tag :disabled="coldisabled" type="list" v-model="tableRowRecord.inStorehouseType" dictCode="in_storehouse_type" /> + </a-form-model-item> + </a-col> + </a-row> + <a-row> + <a-col :span='span'> + <a-form-model-item label='鍏ュ簱鏃堕棿' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='inboundTime'> + <j-date :disabled="coldisabled" v-model="tableRowRecord.inboundTime" :show-time="true" dateFormat="YYYY-MM-DD HH:mm" style="width: 100%"/> + </a-form-model-item> + </a-col> + <a-col :span='span'> + <a-form-model-item label='鐢宠鍘熷洜' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='applicationReason'> + <a-input :disabled='coldisabled' v-model='tableRowRecord.applicationReason'></a-input> + </a-form-model-item> + </a-col> + </a-row> + <a-row> + <a-col :span='span'> + <a-form-model-item label='缁忔墜浜�' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='handler'> + <a-input :disabled='coldisabled' v-model='tableRowRecord.handler_dictText'></a-input> + </a-form-model-item> + </a-col> + <a-col :span='span'> + <a-form-model-item label='澶囨敞' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='remark'> + <a-textarea :disabled="coldisabled" v-model="tableRowRecord.remark" rows="4" /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-tab-pane> + <a-tab-pane key='2' tab='鐢宠鍗曟槑缁嗕俊鎭�'> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:'max-content'}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="null"> + </a-table> + </a-tab-pane> + <a-tab-pane key='3' tab='娴佺▼鑺傜偣'> + <a-timeline> + <a-timeline-item v-for="(item,index) in hitaskDataSource" :key="index"> + <div> + <h3 style="font-weight: bold;">{{item.taskName}}</h3> + <div>澶勭悊浜猴細{{item.assignee_dictText}}</div> + <div v-if="index !==0">澶勭悊鏃堕暱锛歿{item.duration}}</div> + <div v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</div> + <div v-if="item.description">澶勭悊鎰忚锛歿{item.description}}</div> + </div> + </a-timeline-item> + </a-timeline> + </a-tab-pane> + </a-tabs> + </a-spin> + </a-form> + </div> + <div v-if="auditVisible"> + <hr class="shallow-hr"> + <br> + <b>瀹℃壒璇︽儏</b> + <br> + <a-form-model ref="form" :model="approveData" :rules="validatorRules" slot="detail"> + <a-row> + <a-col ::span='span'> + <a-form-model-item label="鐢宠浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop='handler_dictText'> + <a-input :disabled='coldisabled' v-model='tableRowRecord.handler_dictText'></a-input> + </a-form-model-item > + </a-col> + <a-col ::span='span'> + <a-form-model-item label="鐢宠鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createTime"> + <a-input :disabled='coldisabled' v-model='tableRowRecord.createTime'></a-input> + </a-form-model-item > + </a-col> + <a-col :span="24" class="btxx"> + <a-form-item label="瀹℃壒鐘舵��" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-select v-model='assignFileStream.status' placeholder="璇烽�夋嫨瀹℃壒缁撴灉"> + <a-select-option value="3">閫氳繃</a-select-option> + <a-select-option value="4">椹冲洖</a-select-option> + </a-select> + </a-form-item> + </a-col> + <a-col :span="24" class="btxx"> + <a-form-model-item label="瀹℃壒鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-textarea v-model="assignFileStream.approvalOpinion" rows="4" placeholder="璇疯緭鍏ュ鎵规剰瑙�"/> + </a-form-model-item > + </a-col> + </a-row> + <div class="table-operator" style="text-align: right;"> + <a-button @click="handleQueXiaoTask" type="primary" icon="close">鍙栨秷</a-button> + <a-button @click="submitForm">鎻� 浜�</a-button> + </div> + </a-form-model> + </div> + </a-card> + + + </a-modal> +</template> + +<script> + +import '@assets/less/TableExpand.less' +import { mixinDevice } from '@/utils/mixin' +import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage' +export default { + name: 'FlowShenPi', + mixins: [mixinDevice], + props: { + selectInboundOrderData: { + type: Object, + required: true + } + }, + + data() { + return { + form: this.$form.createForm(this), + span: 12, + span1: 8, + coldisabled: true, + spinning: false, + tableRowRecord: {}, + assignFileStream:{}, + tableDataSource: [], + usageDataSource: [], + hitaskDataSource:[], + dataSource: [], + bomForm: {}, + imageSrc: null, + drawerVisible: true, + auditVisible: true, + loading: false, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 30 }, + sm: { span: 16 } + }, + /* 鍒嗛〉鍙傛暟 */ + ipagination:{ + current: 1, + pageSize: 5, + pageSizeOptions: ['5', '10', '50'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'宸ュ叿缂栫爜', + align:"center", + dataIndex: 'toolCode' + }, + { + title:'宸ュ叿绫诲瀷', + align:"center", + dataIndex: 'applicationType' + }, + { + title:'涓枃鍚嶇О', + align:"center", + dataIndex: 'chineseName' + }, + { + title:'鍨嬪彿/鍥惧彿', + align:"center", + dataIndex: 'toolModel' + }, + { + title:'鐢宠鍏ュ簱鏁伴噺', + align:"center", + dataIndex: 'inStorageQuantity' + }, + ], + validatorRules: { + status: { + rules: [ + { required: true, message: '璇烽�夋嫨瀹℃壒鐘舵��!'}, + ] + }, + }, + approveData: {}, + flowData: {}, + title: '瀹℃壒椤甸潰', + width: 1200, + visible: false, + // 琛ㄥご + url: { + queryInboundOrder: '/tms/inboundOrder/list', + queryInboundDetailList: 'tms/inboundDetail/list', + diagramView: '/assign/flow/diagramView', + queryHisTaskList:'/assign/flow/queryHisTaskList', + approve:"/tms/inboundOrder/approval", + }, + dictOptions: {}, + superFieldList: [], + workflowSource: [] + } + }, + created() { + }, + computed: {}, + methods: { + callback() { + }, + handCancel() { + this.visible = false + }, + clearTableSource() { + this.tableDataSource = [] + this.usageDataSource = [] + }, + fetchAndShowBmp() { + try { + let parm = { + processDefinitionId: this.flowData.processDefinitionId, + processInstanceId:this.flowData.processInstanceId, + TaskDefinitionKey:this.flowData.processDefinitionKey + } + downFile(this.url.diagramView,parm,'get').then((res=>{ + const urlObject = window.URL.createObjectURL(new Blob([res])) + this.imageSrc = urlObject + })) + } catch (error) { + console.error('Error fetching image blob:', error) + alert('鏃犳硶鍔犺浇鍥剧墖锛岃绋嶅悗鍐嶈瘯銆�') + } + }, + handleQueXiaoTask(){ + this.visible = false + this.routeReload() + }, + submitForm () { + const that = this; + if (!that.assignFileStream.status==null || that.assignFileStream.status===undefined){ + this.$message.warning('璇烽�夋嫨瀹℃壒鐘舵�侊紒') + return false; + } + if (!that.assignFileStream.approvalOpinion==null || that.assignFileStream.approvalOpinion===undefined) { + this.$message.warning('璇疯緭鍏ュ鎵规剰瑙侊紒') + return false; + } + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true; + let url=this.url.approve + let method = 'post'; + let flowTaskVo = {} + flowTaskVo.status=that.assignFileStream.status; + flowTaskVo.approvalOpinion =that.assignFileStream.approvalOpinion; + flowTaskVo.comment =that.assignFileStream.approvalOpinion; + flowTaskVo.dataId = this.selectInboundOrderData.dataId + flowTaskVo.taskId = this.selectInboundOrderData.id + flowTaskVo.userId = this.selectInboundOrderData.assignee + flowTaskVo.instanceId = this.selectInboundOrderData.procInstId + flowTaskVo.targetKey = this.selectInboundOrderData.taskDefKey + flowTaskVo.values = this.selectInboundOrderData.variables + flowTaskVo.assignee = this.selectInboundOrderData.assignee + console.log("琛ㄥ崟鎻愪氦鏁版嵁",flowTaskVo) + httpAction(url,flowTaskVo,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.visible = false + //鍒锋柊琛ㄦ牸 + that.$emit('searchReset') + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + getAllApproveData(item) { + this.visible = true + this.loading = true + this.flowData = item + getAction(this.url.queryHisTaskList, {procInstId: item.procInstId}).then(res=>{ + if(res.success){ + this.hitaskDataSource = res.result + } + }) + getAction(this.url.queryInboundOrder, {id: item.dataId}).then((res => { + if (res.success) { + this.tableRowRecord = res.result.records[0] + } + })) + getAction(this.url.queryInboundDetailList, {inboundOrderId: item.dataId}).then(res => { + if (res.success) { + this.dataSource = res.result.records + if (res.result.total) { + this.ipagination.total = res.result.total + } else { + this.ipagination.total = 0 + } + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + } + } +} +</script> +<style scoped> +.shallow-hr { + border: 0; + height: 1px; /* 鍒嗙晫绾跨殑楂樺害 */ + background-color: rgba(0, 0, 0, 0.1); /* 浣跨敤 RGBA 棰滆壊锛屽苟璁剧疆杈冧綆鐨勯�忔槑搴� */ + margin: 20px 0; /* 鍒嗙晫绾夸笂涓嬬殑澶栬竟璺� */ +} +.btn-custom { + background-color: #4CAF50; /* 缁胯壊鑳屾櫙 */ + color: white; /* 鐧借壊鏂囧瓧 */ + border: none; /* 鏃犺竟妗� */ + padding: 5px 15px; /* 鍐呰竟璺� */ + text-align: center; /* 鏂囧瓧灞呬腑 */ + text-decoration: none; /* 鏃犱笅鍒掔嚎 */ + display: inline-block; /* 琛屽唴鍧楀厓绱� */ + font-size: 12px; /* 瀛椾綋澶у皬 */ + margin: 4px 2px; /* 澶栬竟璺� */ + cursor: pointer; /* 榧犳爣鎮仠鏃舵樉绀烘墜鍨� */ + border-radius: 4px; /* 鍦嗚杈规 */ +} + +.bold-large-label { + font-weight: bold; + font-size: 20px; /* 鎴栦綘闇�瑕佺殑浠讳綍澶у皬 */ +} +.left_qiu{ + position: absolute; + left: -74px; + top: 0; + width:54px; + border-radius: 50%; + height:54px; + font-size: 13px; + margin: auto; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: center; + background: #0099ff; + transform: translate(0, 0); +} +/deep/ .ant-timeline-item-tail{ + left: -29px !important; +} +.left_qiu span{ + width: 3em; + display: block; + color: #fff; + text-align: center; +} +.img{ + width: 75%; +} + +.wrap{ + clear: both; + width: 100%; + display: flex; + height: 50px; + border: 1px solid #ccc; + /* background-color: aqua; */ +} +.box{ + width:21%; + height:50px; + border-right: 1px solid #ccc; + line-height: 50px; + /* background: red; */ + text-align:center; + margin: auto; +} + +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/tms/InboundOrderList.vue b/src/views/tms/InboundOrderList.vue new file mode 100644 index 0000000..fda2a46 --- /dev/null +++ b/src/views/tms/InboundOrderList.vue @@ -0,0 +1,243 @@ +<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 :md="6" :sm="8"> + <a-form-item label="鍏ュ簱鐢宠鍗曠紪鍙�"> + <a-input placeholder="璇疯緭鍏ュ叆搴撶敵璇峰崟缂栧彿" v-model="queryParam.inboundNum" /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="8"> + <a-form-item label="鍏ュ簱绫诲瀷"> + <j-search-select-tag + placeholder="璇烽�夋嫨鍏ュ簱绫诲瀷" + v-model="queryParam.inStorehouseType" + dict="in_storehouse_type" + /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="8"> + <a-form-item label="缁忔墜浜�"> + <j-search-select-tag + placeholder="璇烽�夋嫨缁忔墜浜�" + v-model="queryParam.handler" + dict="sys_user,realname,id,del_flag!=1" + /> + </a-form-item> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + </div> + + <!-- table鍖哄煙-begin --> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :customRow="customRow" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + > + <!--鐘舵�佹爮涓�у睍绀�--> + <span slot="action" slot-scope="text, record"> + <a href="javascript:;" @click="handleEdit(record)" v-if="record.orderStatus == '1'">缂栬緫</a> + <a-divider type="vertical" v-if="record.orderStatus == '1'" /> + <a href="javascript:;" @click="handleDetail(record)">璇︽儏</a> + <a-divider type="vertical" v-if="record.orderStatus == '1'"/> + <a href="javascript:;" @click="handleSubmit(record)" v-if="record.orderStatus == '1'">鎻愪氦</a> + </span> + </a-table> + <a-tabs defaultActiveKey="1"> + <a-tab-pane tab="宸ュ叿鍏ュ簱鏄庣粏" key="1"> + <inbound-detail-list ref="inboundDetailList"></inbound-detail-list> + </a-tab-pane> + </a-tabs> + <!-- table鍖哄煙-end --> + <inbound-order-model ref="modalForm" @ok="modalFormOk"></inbound-order-model> + </a-card> +</template> + +<script> +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import InboundOrderModel from './modules/inbound/InboundOrderModel' +import InboundDetailList from './modules/inbound/InboundDetailList' +import { requestPut } from '@/api/manage' +import JDictSelectTag from '@/components/dict/JDictSelectTag' +import JSearchSelectTag from '@/components/dict/JSearchSelectTag' +import { postAction,getAction } from '../../api/manage' + +export default { + name: 'InboundOrderList', + mixins: [JeecgListMixin], + components: { + InboundOrderModel, + InboundDetailList, + JDictSelectTag, + JSearchSelectTag, + }, + data() { + return { + description: '鍏ュ簱鐢宠鍗�', + url: { + list: '/tms/inboundOrder/list', + toolingStorageStatus: '/tooling/storage/toolingStorageStatus', + importExcelUrl: 'tooling/storage/importExcel', + exportXlsUrl: '/tooling/storage/exportXls', + takeBack: '/tooling/storage/takeBack', + edit:'/tms/inboundOrder/edit', + submit:'/tms/inboundOrder/submit' + }, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + }, + { + title: '鍏ュ簱鐢宠鍗曠紪鍙�', + align: 'center', + dataIndex: 'inboundNum', + sorter: true, + }, + { + title: '鍏ュ簱鍗曠被鍨�', + align: 'center', + dataIndex: 'inStorehouseType_dictText', + }, + { + title: '缁忔墜浜�', + align: 'center', + dataIndex: 'handler_dictText', + }, + { + title: '鐢宠鍘熷洜', + align: 'center', + dataIndex: 'applicationReason', + }, + { + title: '鍏ュ簱鏃堕棿', + align: 'center', + dataIndex: 'inboundTime', + sorter: true, + }, + { + title: '瀹℃牳浜�', + align: 'center', + dataIndex: 'reviewer_dictText', + }, + { + title: '瀹℃牳鏃堕棿', + align: 'center', + dataIndex: 'approvalDate', + sorter: true, + }, + { + title: '瀹℃牳鐘舵��', + align: 'center', + dataIndex: 'orderStatus_dictText', + }, + { + title: '鍊熺敤鍗曞彿', + align: 'center', + dataIndex: 'borrowNum', + }, + { + title: '瀹℃壒鎰忚', + align: 'center', + dataIndex: 'approvalOpinion', + }, + { + width: 150, + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + }, + ], + } + }, + computed: { + /* 瀵煎叆璺緞椤甸潰閲嶆柊璁$畻 */ + importExcelUrl: function () { + // return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;//寮�鍙戠幆澧冩寚鍚� + return `${window._CONFIG['hxFileURL']}/${this.url.importExcelUrl}` + }, + }, + methods: { + searchReset() { + this.queryParam = {} + this.$refs.inboundDetailList.dataSource = [] + this.loadData(1); + }, + customRow(record) { + return { + on: { + click: (e) => { + //灏嗗綋鍓嶉�変腑鐨勮褰曚紶鍒板瓙椤甸潰 + this.$bus.$emit('getToolingStorageData', record) + //鐐瑰嚮褰撳墠琛屽彉鑹� + let oldList = document.querySelectorAll('.checked-td-of-add-table') + if (oldList) { + for (let j = 0; j < oldList.length; j++) { + oldList[j].classList.remove('checked-td-of-add-table') + } + } + let children = e.target.parentNode.children + for (let i = 0; i < children.length; i++) { + children[i].classList.add('checked-td-of-add-table') + } + }, + }, + } + }, + handleEdit: function (record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '缂栬緫' + this.$refs.modalForm.disableSubmit = false + }, + handleAdd() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鏂板' + this.$refs.modalForm.disableSubmit = false + }, + handleSubmit(record) { + let that = this; + getAction(that.url.submit, { id:record.id}).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.loadData(); + } else { + that.$message.warning(res.message); + } + }) + }, + }, +} +</script> + +<style lang="less" scoped> +@import '~@assets/less/common.less'; +/deep/ .notshow { + display: none; +} +/deep/ .checked-td-of-add-table { + background-color: rgba(220, 220, 220, 1); +} +</style> \ No newline at end of file diff --git a/src/views/tms/modules/baseTools/BaseToolsListLeft.vue b/src/views/tms/modules/baseTools/BaseToolsListLeft.vue index 14e6efa..f1ed47a 100644 --- a/src/views/tms/modules/baseTools/BaseToolsListLeft.vue +++ b/src/views/tms/modules/baseTools/BaseToolsListLeft.vue @@ -20,7 +20,7 @@ >鍙栨秷</a> </div> </a-alert> - <div class="drawer-bootom-button"> + <!-- <div class="drawer-bootom-button"> <a-dropdown :trigger="['click']" placement="bottomCenter" @@ -43,7 +43,7 @@ <a-icon type="bars" /> </a-button> </a-dropdown> - </div> + </div> --> <a-input-search @search="handleSearch" @@ -57,11 +57,12 @@ <!-- showLine --> <a-tree :checkStrictly="checkStrictly" - :expandedKeys.sync="expandedKeys" + :selectedKeys="selectedKeys" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" :treeData="treeDataSource" - :autoExpandParent="autoExpandParent" + + :defaultExpandAll="true" @select="onSelect" @expand="onExpand" > diff --git a/src/views/tms/modules/inbound/InboundDetailList.vue b/src/views/tms/modules/inbound/InboundDetailList.vue new file mode 100644 index 0000000..a105e63 --- /dev/null +++ b/src/views/tms/modules/inbound/InboundDetailList.vue @@ -0,0 +1,88 @@ +<template> + <a-card + :bordered="false" + class="card-area" + > + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + > + </a-table> + </a-card> +</template> + +<script> +import { requestPut } from '@/api/manage' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' + +export default { + name: 'InboundDetailList', + mixins: [JeecgListMixin], + components: {}, + data() { + return { + url: { + list: '/tms/inboundDetail/list', + }, + queryParam: {}, + nodeType: 0, + dataSource: [], + disableMixinCreated:true, + columns: [ + { + title: '宸ュ叿缂栫爜', + align: 'center', + dataIndex: 'toolCode', + width: '10%', + key: 'toolCode' + }, + { + title: '宸ュ叿鍚嶇О', + dataIndex: 'chineseName', + align: 'center', + key: 'toolName' + }, + { + title: '鍨嬪彿/鍥惧彿', + dataIndex: 'toolModel', + align: 'center', + key: 'toolModel' + }, + + { + title: '宸ュ叿鍒嗙被', + dataIndex: 'applicationType', + align: 'center', + }, + { + title: '鍏ュ簱鏁伴噺', + dataIndex: 'inStorageQuantity', + align: 'center', + } + ] + } + }, + + methods: { + + + }, + mounted() { + this.$bus.$on('getToolingStorageData', (data) => { + this.queryParam.inboundOrderId = data.id; + this.searchQuery(); + }) + } +} +</script> + +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/tms/modules/inbound/InboundOrderModel.vue b/src/views/tms/modules/inbound/InboundOrderModel.vue new file mode 100644 index 0000000..9bc0325 --- /dev/null +++ b/src/views/tms/modules/inbound/InboundOrderModel.vue @@ -0,0 +1,600 @@ +<template> + <a-modal + :title="title" + :visible="visible" + :fullScreen="true" + :width="1200" + @ok="handleOk" + @cancel="handleCancel" + > + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍏ュ簱鐢宠鍗曠紪鍙�"> + <a-input :disabled="true" placeholder="绯荤粺鑷姩鐢熸垚" v-decorator="['inboundNum', validatorRules.inboundNum]" /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍏ュ簱绫诲瀷"> + <j-dict-select-tag + :disabled="disableSubmit" + type="list" + v-decorator="['inStorehouseType', validatorRules.inStorehouseType]" + :triggerChange="true" + dictCode="in_storehouse_type" + placeholder="璇烽�夋嫨鍏ュ簱绫诲瀷" + @change="handleTypeChange" + /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍏ュ簱鏃堕棿"> + <a-date-picker + @change="onChange" + :disabled="disableSubmit" + style="width: 100%" + v-decorator="['inboundTime', validatorRules.inboundTime]" + /> + </a-form-item> + </a-col> + <a-col :span="24 / 2"> + <a-form-item label="鐢宠鍘熷洜" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input placeholder="璇疯緭鍏ョ敵璇峰師鍥�" :disabled="disableSubmit" v-decorator="['applicationReason', validatorRules.applicationReason]" /> + </a-form-item> + </a-col> + </a-row> + <a-row style="width: 100%"> + + <a-col :span="24 / 2"> + <a-form-item label="缁忔墜浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="true" + v-if="!barcodeCurrentType" + placeholder="璇烽�夋嫨缁忔墜浜�" + v-decorator="['handler', { rules: [{ required: false, message: '璇烽�夋嫨缁忔墜浜�' }] }]" + dict="sys_user,realname,id,del_flag=0" + @change="selectCurrentUserChange" + /> + </a-form-item> + </a-col> + + <a-col :span="24 / 2"> + <a-form-item label="瀹℃牳浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-search-select-tag + :disabled="true" + placeholder="璇烽�夋嫨瀹℃牳浜�" + v-decorator="['reviewer', validatorRules.reviewer]" + dict="sys_user,realname,id,del_flag=0" + @change="selectCurrentUserChange" + /> + </a-form-item> + </a-col> + + </a-row> + + <a-row style="width: 100%"> + + <a-col :span="24 / 2"> + <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="瀹℃牳鏃堕棿"> + <a-date-picker + @change="onChange" + :disabled="true" + style="width: 100%" + v-decorator="['approvalDate', validatorRules.approvalDate]" + /> + </a-form-item> + </a-col> + + <a-col :span="24 / 2"> + <a-form-item label="瀹℃牳鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input placeholder="璇疯緭鍏ュ鏍告剰瑙�" :disabled="true" v-decorator="['approvalOpinion', validatorRules.approvalOpinion]" /> + </a-form-item> + </a-col> + </a-row> + + <a-row style="width: 100%"> + <a-col :span="24"> + <a-form-item :labelCol="{ span: 3 }" :wrapperCol="{ span: 21 }" label="澶囨敞"> + <a-textarea + :disabled="disableSubmit" + :rows="2" + placeholder="..." + v-decorator="['remark', validatorRules.remark]" + /> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectReturnList()" v-show="returnShow && !disableSubmit">閫夋嫨鍊熺敤鍑哄簱鍗�</a-button> + <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" v-show="toolingShow && !disableSubmit">閫夋嫨宸ュ叿</a-button> + <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectSharpenList()" v-show="sharpenShow && !disableSubmit">閫夋嫨鍒冪(鍑哄簱鍗�</a-button> + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @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 == 'inStorageQuantity'" + :disabled="quantityDisable" + :value="text" + @change="(e) => handleChange(e, record.key, col, index)" + :min="1" + /> + </div> + </template> + <span slot="action" slot-scope="text, record, index"> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record, index)" :disabled="disableSubmit"> + <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> + + <template slot="footer" v-if="disableSubmit == true"> + <a-button :style="{ marginRight: '8px' }" @click="handleCancel">鍏抽棴</a-button> + </template> + <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal> + <j-select-return-list-modal ref="returnModalForm" @ok="modalFormOk"></j-select-return-list-modal> + <j-select-sharpen-list-modal ref="sharpenModalForm" @ok="modalFormOk"></j-select-sharpen-list-modal> + </a-modal> +</template> + +<script> +import pick from 'lodash.pick' +import JSelectToolingModal from './JSelectToolingModal' +import { ajaxGetDictItems } from '@/api/api' +import moment from 'moment' +import { getAction, postAction, requestPut } from '@/api/manage' +import JDictSelectTag from '@/components/dict/JDictSelectTag' +import JSearchSelectTag from '@/components/dict/JSearchSelectTag' +import JMultiSelectTag from '@/components/dict/JMultiSelectTag' +import { filterObj } from '@/utils/util' +import JSelectReturnListModal from './JSelectReturnListModal' +import JSelectSharpenListModal from './JSelectSharpenListModal' + +export default { + name: 'InboundOrderModel', + components: { + JSelectToolingModal, + JMultiSelectTag, + JDictSelectTag, + JSelectReturnListModal, + JSearchSelectTag, + JSelectSharpenListModal, + }, + data() { + return { + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + isDisabled: false, + selectedRowKeys: {}, + state: { + show: false, + maintenanceValue: 1, + checkValue: 1, + maintenanceState: false, + checkState: false, + }, + inboundDate: '', + applicationDate: '', + supplierShow: false, + disableSubmit: false, + numDisable:false, + quantityDisable:false, + onlyCodeDisable:true, + returnShow:false, + toolingShow:false, + sharpenShow:false, + addDisable:false, + toolinngOptions:[], + title: '鎿嶄綔', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + confirmLoading: false, + loading: false, + form: this.$form.createForm(this), + dataSource: [], + toolingTreeData:[], + warehouseOptions:[], + locationOptions:[], + allToolingList:[], + param: {}, + barcodeCurrentType: false, + inboundOrderId:'', + validatorRules: { + type: { + rules: [ + { + required: true, + message: '璇烽�夋嫨鍏ュ簱绫诲瀷!', + }, + ], + }, + inboundDate: { + rules: [ + { + required: true, + message: '璇烽�夋嫨鐢宠鍏ュ簱鏃ユ湡!', + }, + ], + }, + applicant: { + rules: [ + { + required: true, + message: '璇烽�夋嫨鐢宠浜�!', + }, + ], + }, + }, + url: { + add: '/tms/inboundOrder/add', + edit: '/tms/inboundOrder/edit', + queryByUserName: '/sys/user/queryByUserName', + toolingList:'/tms/baseTools/list', + queryAccountList:'/tooling/storage/queryAccountList', + querySharpenList:'/sharpen/sharpenDetail/querySharpenList', + queryReturnList:'/returnInventory/queryReturnList', + detailList:'/tms/inboundDetail/list', + }, + toolingOptions:[], + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + }, + { + title: '宸ュ叿缂栫爜', + align: 'center', + dataIndex: 'toolCode', + width: 150, + }, + { + title: '宸ュ叿绫诲瀷', + align: 'center', + dataIndex: 'applicationType' + }, + { + title: '涓枃鍚嶇О', + align: 'center', + dataIndex: 'chineseName', + }, + { + title: '鍨嬪彿/鍥惧彿', + align: 'center', + dataIndex: 'toolModel' + }, + { + title: '鍏ュ簱鏁伴噺', + align: 'center', + dataIndex: 'inStorageQuantity', + scopedSlots: { customRender: 'inStorageQuantity' }, + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + }, + ], + } + }, + created() {}, + methods: { + modalFormOk() { + }, + getQueryParams() { + this.param.pageNo = this.ipagination.current + this.param.pageSize = this.ipagination.pageSize + return filterObj(this.param) + }, + add() { + this.edit({}) + }, + edit(record) { + let that = this + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + this.isDisabled = false + this.disableSubmit = false + if (record.id) { + if(record.inStorehouseType == "1"){ + this.toolingShow = true + }else if(record.inStorehouseType == "2"){ + this.returnShow = true + }else if(record.inStorehouseType == "5"){ + this.sharpenShow = true + } + this.inboundOrderId = record.id + this.detailList(this.inboundOrderId) + } + this.initOptions() + this.$nextTick(() => { + this.form.setFieldsValue( + pick(this.model, 'inboundNum', 'inStorehouseType', 'inboundTime', 'applicationReason', 'handler','approvalDate','reviewer','approvalOpinion','remark') + ) + }) + }, + handleChange(value, key, column, index) { + //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index + const temp = [...this.dataSource] + const target = temp.filter(item => key === item.key)[index]; + if (target) { + target[column.dataIndex] = value + this.dataSource = temp + } + }, + close() { + this.$emit('close') + this.dataSource = [] + this.visible = false + this.supplierShow = false, + this.disableSubmit = false, + this.numDisable = false, + this.quantityDisable = false, + this.onlyCodeDisable = true, + this.returnShow = false, + this.toolingShow = false, + this.sharpenShow = false, + this.addDisable = false + }, + handleTableChange(pagination, filters, sorter) { + this.ipagination = pagination + this.detailList(this.inboundOrderId); + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = Object.assign(this.model, values) + formData.detailData = this.dataSource + let http = '' + if(this.model.id){ + http = this.url.edit + }else{ + http = this.url.add + } + postAction(http, formData) + .then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok', new Date()) + } else { + that.$message.warning(res.message) + } + }) + .finally(() => { + that.confirmLoading = false + that.close() + }) + } + }) + }, + handleCancel() { + this.close() + }, + //閫夋嫨宸ュ叿 + selectTooling: function () { + let ids = [] + for (let i = 0; i < this.dataSource.length; i++) { + ids.push(this.dataSource[i].toolCodeId) + } + this.$refs.toolingModalForm.showModal(ids) + this.$refs.toolingModalForm.title = '閫夋嫨宸ュ叿' + this.$refs.toolingModalForm.disableSubmit = false + }, + //閫夋嫨褰掕繕宸ュ叿 + selectReturnList: function () { + let ids = [] + for (let i = 0; i < this.dataSource.length; i++) { + ids.push(this.dataSource[i].id) + } + this.$refs.returnModalForm.showModal(ids) + this.$refs.returnModalForm.title = '閫夋嫨褰掕繕宸ュ叿' + this.$refs.returnModalForm.disableSubmit = false + }, + //閫夋嫨鍒冪(宸ュ叿 + selectSharpenList: function () { + let ids = [] + for (let i = 0; i < this.dataSource.length; i++) { + ids.push(this.dataSource[i].id) + } + this.$refs.sharpenModalForm.showModal(ids) + this.$refs.sharpenModalForm.title = '閫夋嫨鍒冪(宸ュ叿' + this.$refs.sharpenModalForm.disableSubmit = false + }, + handleDelete(record, index) { + this.dataSource.splice(index, 1) + }, + onChange() {}, + //鎺у埗鎵爜鎴栨墜閫� + selectCurrentUserType(e) { + if (e == '0') { + this.barcodeCurrentType = true + } else { + this.barcodeCurrentType = false + } + }, + //鎵嬮�変汉鍛樺�� + selectCurrentUserChange(e) { + console.log('褰撳墠鎵嬮��', e) + // this.form.setFieldsValue({ + // // userName: e, + // userNameId: e, + // }) + }, + //鍏ュ簱绫诲瀷 + handleTypeChange(value) { + this.dataSource = [] + if(value == 1){ + this.toolingShow = true + this.quantityDisable = false + this.addDisable = true + this.numDisable = false + }else{ + this.toolingShow = false + } + if(value == 2){ + this.numDisable = true + this.addDisable = false + this.returnShow = true + this.quantityDisable = true + }else{ + this.returnShow = false + } + if (value == 5) { + this.numDisable = true + this.addDisable = false + this.sharpenShow = true + this.quantityDisable = true + } else { + this.sharpenShow = false + } + + }, + //娣诲姞宸ュ叿鎸夐挳 + addTooling() { + const temp = [...this.dataSource]; + temp.push({ indexId: temp.length + 1 }); + this.dataSource = temp; + }, + detailList(inboundOrderId) { + this.param.inboundOrderId = inboundOrderId + getAction(this.url.detailList, this.getQueryParams()).then((res) => { + if (res.success) { + this.dataSource = res.result.records + this.ipagination.total = res.result.total; + } + }) + }, + initOptions() { + + ajaxGetDictItems("mes_base_warehouse,name,id,del_flag!='1' order by num asc", null).then((res) => { + if (res.success) { + if (res.result) { + for (let i = 0; i < res.result.length; i++) { + res.result[i].label = res.result[i].title; + } + } + this.warehouseOptions = res.result; + } + }) + ajaxGetDictItems("mes_base_storage_area,name,id,del_flag!='1'", null).then((res) => { + if (res.success) { + if (res.result) { + for (let i = 0; i < res.result.length; i++) { + res.result[i].label = res.result[i].title; + } + } + this.locationOptions = res.result; + } + }) + ajaxGetDictItems("mes_base_tooling,num,id,del_flag!='1'", null).then((res) => { + if (res.success) { + if (res.result) { + for (let i = 0; i < res.result.length; i++) { + res.result[i].label = res.result[i].title; + res.result[i].toolingName = res.result[i].name + } + } + this.toolingOptions = res.result; + } + }) + }, + filterOption(input, option) { + return ( + option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + ); + }, + }, + watch: {}, + mounted() { + this.$bus.$on('selectionRows', (data) => { + //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟 + for (let i = 0; i < data.length; i++) { + this.dataSource.push({ + toolCodeId:data[i].id, + toolingId: data[i].toolingId || data[i].id, + toolCode: data[i].toolCode, + chineseName: data[i].chineseName, + toolModel: data[i].toolModel, + applicationType: data[i].applicationTypeName, + unitName: data[i].unitName || data[i].unitId_dictText, + onlyCode:data[i].onlyCode, + noAccountQuantity:data[i].noAccountQuantity, + inStorageQuantity:data[i].storageQuantity + }) + } + //this.ipaginationm.total = this.dataSource.length + }) + }, +} +</script> + + +<style lang="less" scoped> +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} + +/deep/ .notshow { + display: none; +} +</style> diff --git a/src/views/tms/modules/inbound/JSelectReturnListModal.vue b/src/views/tms/modules/inbound/JSelectReturnListModal.vue new file mode 100644 index 0000000..1336e03 --- /dev/null +++ b/src/views/tms/modules/inbound/JSelectReturnListModal.vue @@ -0,0 +1,290 @@ +<template> + <!--鏀寔鍏ㄥ睆缂╂斁--> + <j-modal + :visible="visible" + :title="title" + switchFullscreen + :width="1200" + @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="宸ュ叿缂栫爜"> + <a-input placeholder="璇疯緭鍏ュ伐鍏风紪鐮�,鏀寔妯$硦鏌ヨ" v-model="queryParam.num"></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.name"></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.model"></a-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" + :scroll="scrollTrigger" + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :rowSelection="rowSelection" + :loading="loading" + @change="handleTableChange" + > + </a-table> + </a-card> + </j-modal> +</template> + +<script> +import { filterObj } from '@/utils/util' +import { getAction } from '@/api/manage' + +export default { + name: 'JSelectToolingModal', + components: {}, + props: {}, + data() { + return { + queryParam: {}, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + }, + { + title: '宸ュ叿缂栫爜', + align: 'center', + dataIndex: 'toolingNum', + sorter: true, + }, + { + title: '宸ュ叿鍚嶇О', + align: 'center', + dataIndex: 'toolingName', + sorter: true, + }, + { + title: '鍞竴缂栫爜', + align: 'center', + dataIndex: 'onlyCode', + sorter: true, + }, + { + title: '鍏ュ簱鏁伴噺', + align: 'center', + dataIndex: 'inStorageQuantity', + sorter: true, + }, + { + title: '宸ュ叿鍒嗙被', + align: 'center', + dataIndex: 'toolingCategoryName', + sorter: true, + }, + { + title: '瑙勬牸鍨嬪彿', + align: 'center', + dataIndex: 'model', + sorter: true, + }, + { + title: '鍗曚綅', + align: 'center', + dataIndex: 'unitName', + sorter: true, + }, + ], + selectedRowKeys: [], + oldSlelectRows: [], + scrollTrigger: {}, + dataSource: [], + selectionRows: [], + title: '鏍规嵁鏌ヨ缁撴灉閫夋嫨宸ュ叿', + 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: 'num', + order: 'desc', + }, + departTree: [], + visible: false, + loading: false, + url: { + // list: '/base/tooling/list', + list: '/returnInventory/queryReturnList', + queryKnifeBom:'/toolingStorage/mesToolingOutbounds/queryKnifeBom' + }, + } + }, + computed: { + rowSelection() { + return { + type: 'checkbox', + onChange: (selectedRowKeys, selectedRows) => { + this.selectedRowKeys = selectedRowKeys + this.onSelectChange(selectedRows) + }, + getCheckboxProps: (record) => ({ + props: { + disabled: record.distable, + }, + }), + selectedRowKeys: this.selectedRowKeys, + } + }, + }, + watch: {}, + created() {}, + methods: { + async loadData(arg) { + if (arg === 1) { + this.ipagination.current = 1 + } + let that = this + this.loading = true + let params = this.getQueryParams() //鏌ヨ鏉′欢 + await getAction(this.url.list, params).then((res) => { + if (res.success) { + for (let i = 0; i < res.result.records.length; i++) { + if (that.oldSlelectRows.indexOf(res.result.records[i].toolingId) > -1) { + res.result.records[i].distable = true + } else { + res.result.records[i].distable = false + } + } + this.dataSource = res.result.records + this.ipagination.total = res.result.total + } + if (res.code === 510) { + this.$message.warning(res.message) + } + this.loading = false + }) + }, + showModal(oldSlelectRows) { + this.oldSlelectRows = oldSlelectRows + 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 str = 'id,' + for (let a = 0; a < this.columns.length; a++) { + str += ',' + this.columns[a].dataIndex + } + return str + }, + searchReset(num) { + let that = this + if (num !== 0) { + that.loadData(1) + } + that.selectborrowIds = [] + }, + close() { + this.searchReset(0) + this.selectedRowKeys = [] + this.visible = false + }, + handleTableChange(pagination, filters, sorter) { + //TODO 绛涢�� + 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) { + let params = this.getQueryParams() //鏌ヨ鏉′欢 + params['onlyCode'] = this.selectionRows[0].onlyCode; + getAction(this.url.queryKnifeBom, params).then((res) => { + if (res.success) { + this.prepareKnifeDetailList = res.result + this.$bus.$emit('selectionRows', this.prepareKnifeDetailList) + } + + if (res.code === 510) { + this.$message.warning(res.message) + } + this.loading = false + + }) + this.searchReset(0) + this.close() + } else { + this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�') + } + }, + onSelectChange(selectionRows) { + this.selectionRows = selectionRows + }, + onSearch() { + this.loadData(1) + }, + searchQuery() { + this.loadData(1); + }, + searchReset() { + this.queryParam = {} + 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; +} +</style> \ No newline at end of file diff --git a/src/views/tms/modules/inbound/JSelectSharpenListModal.vue b/src/views/tms/modules/inbound/JSelectSharpenListModal.vue new file mode 100644 index 0000000..f83c694 --- /dev/null +++ b/src/views/tms/modules/inbound/JSelectSharpenListModal.vue @@ -0,0 +1,273 @@ +<template> + <!--鏀寔鍏ㄥ睆缂╂斁--> + <j-modal + :visible="visible" + :title="title" + switchFullscreen + :width="1200" + @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="宸ュ叿缂栫爜"> + <a-input placeholder="璇疯緭鍏ュ伐鍏风紪鐮�,鏀寔妯$硦鏌ヨ" v-model="queryParam.num"></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.name"></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.model"></a-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" + :scroll="scrollTrigger" + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :rowSelection="rowSelection" + :loading="loading" + @change="handleTableChange" + > + </a-table> + </a-card> + </j-modal> +</template> + +<script> +import { filterObj } from '@/utils/util' +import { getAction } from '@/api/manage' + +export default { + name: 'JSelectToolingModal', + components: {}, + props: {}, + data() { + return { + queryParam: {}, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + }, + { + title: '宸ュ叿缂栫爜', + align: 'center', + dataIndex: 'toolingNum', + sorter: true, + }, + { + title: '宸ュ叿鍚嶇О', + align: 'center', + dataIndex: 'toolingName', + sorter: true, + }, + { + title: '鍞竴缂栫爜', + align: 'center', + dataIndex: 'onlyCode', + sorter: true, + }, + { + title: '鍏ュ簱鏁伴噺', + align: 'center', + dataIndex: 'inStorageQuantity', + sorter: true, + }, + { + title: '宸ュ叿鍒嗙被', + align: 'center', + dataIndex: 'toolingCategoryName', + sorter: true, + }, + { + title: '瑙勬牸鍨嬪彿', + align: 'center', + dataIndex: 'model', + sorter: true, + }, + { + title: '鍗曚綅', + align: 'center', + dataIndex: 'unitName', + sorter: true, + }, + ], + selectedRowKeys: [], + oldSlelectRows: [], + scrollTrigger: {}, + dataSource: [], + selectionRows: [], + title: '鏍规嵁鏌ヨ缁撴灉閫夋嫨宸ュ叿', + 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: 'num', + order: 'desc', + }, + departTree: [], + visible: false, + loading: false, + url: { + // list: '/base/tooling/list', + list: '/sharpen/sharpenDetail/querySharpenList', + }, + } + }, + computed: { + rowSelection() { + return { + type: 'checkbox', + onChange: (selectedRowKeys, selectedRows) => { + this.selectedRowKeys = selectedRowKeys + this.onSelectChange(selectedRows) + }, + getCheckboxProps: (record) => ({ + props: { + disabled: record.distable, + }, + }), + selectedRowKeys: this.selectedRowKeys, + } + }, + }, + watch: {}, + created() {}, + methods: { + async loadData(arg) { + if (arg === 1) { + this.ipagination.current = 1 + } + let that = this + this.loading = true + let params = this.getQueryParams() //鏌ヨ鏉′欢 + params["sharpenStatus"] = 1 + await getAction(this.url.list, params).then((res) => { + if (res.success) { + for (let i = 0; i < res.result.records.length; i++) { + if (that.oldSlelectRows.indexOf(res.result.records[i].toolingId) > -1) { + res.result.records[i].distable = true + } else { + res.result.records[i].distable = false + } + } + this.dataSource = res.result.records + this.ipagination.total = res.result.total + } + if (res.code === 510) { + this.$message.warning(res.message) + } + this.loading = false + }) + }, + showModal(oldSlelectRows) { + this.oldSlelectRows = oldSlelectRows + 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 str = 'id,' + for (let a = 0; a < this.columns.length; a++) { + str += ',' + this.columns[a].dataIndex + } + return str + }, + searchReset(num) { + let that = this + if (num !== 0) { + that.loadData(1) + } + that.selectborrowIds = [] + }, + close() { + this.searchReset(0) + this.selectedRowKeys = [] + this.visible = false + }, + handleTableChange(pagination, filters, sorter) { + //TODO 绛涢�� + 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() { + this.$bus.$emit('selectionRows', this.selectionRows) + this.searchReset(0) + this.close() + }, + onSelectChange(selectionRows) { + this.selectionRows = selectionRows + }, + onSearch() { + this.loadData(1) + }, + searchQuery() { + this.loadData(1); + }, + searchReset() { + this.queryParam = {} + 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; +} +</style> \ No newline at end of file diff --git a/src/views/tms/modules/inbound/JSelectToolingModal.vue b/src/views/tms/modules/inbound/JSelectToolingModal.vue new file mode 100644 index 0000000..0ccb752 --- /dev/null +++ b/src/views/tms/modules/inbound/JSelectToolingModal.vue @@ -0,0 +1,254 @@ +<template> + <!--鏀寔鍏ㄥ睆缂╂斁--> + <j-modal + :visible="visible" + :title="title" + switchFullscreen + :width="1200" + @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="宸ュ叿缂栫爜"> + <a-input placeholder="璇疯緭鍏ュ伐鍏风紪鐮�,鏀寔妯$硦鏌ヨ" v-model="queryParam.toolCode"></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.chineseName"></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.toolModel"></a-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" + :scroll="scrollTrigger" + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :rowSelection="rowSelection" + :loading="loading" + @change="handleTableChange" + > + </a-table> + </a-card> + </j-modal> +</template> + +<script> +import { filterObj } from '@/utils/util' +import { getAction } from '@/api/manage' + +export default { + name: 'JSelectToolingModal', + components: {}, + props: {}, + data() { + return { + queryParam: {}, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + }, + { + title: '宸ュ叿缂栫爜', + align: 'center', + dataIndex: 'toolCode', + sorter: true, + }, + { + title: '宸ュ叿鍚嶇О', + align: 'center', + dataIndex: 'chineseName', + sorter: true, + }, + { + title: '宸ュ叿绫诲瀷', + align: 'center', + dataIndex: 'applicationTypeName', + sorter: true, + }, + { + title: '鍨嬪彿/鍥惧彿', + align: 'center', + dataIndex: 'toolModel', + sorter: true, + }, + ], + selectedRowKeys: [], + oldSlelectRows: [], + scrollTrigger: {}, + dataSource: [], + selectionRows: [], + title: '鏍规嵁鏌ヨ缁撴灉閫夋嫨宸ュ叿', + 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: 'desc', + }, + departTree: [], + visible: false, + loading: false, + url: { + // list: '/base/tooling/list', + list: '/tms/baseTools/paraCommonToolList', + }, + } + }, + computed: { + rowSelection() { + return { + type: 'checkbox', + onChange: (selectedRowKeys, selectedRows) => { + this.selectedRowKeys = selectedRowKeys + this.onSelectChange(selectedRows) + }, + getCheckboxProps: (record) => ({ + props: { + disabled: record.distable, + }, + }), + selectedRowKeys: this.selectedRowKeys, + } + }, + }, + watch: {}, + created() {}, + methods: { + async loadData(arg) { + if (arg === 1) { + this.ipagination.current = 1 + } + let that = this + this.loading = true + let params = this.getQueryParams() //鏌ヨ鏉′欢 + await getAction(this.url.list, params).then((res) => { + if (res.success) { + for (let i = 0; i < res.result.records.length; i++) { + if (that.oldSlelectRows.indexOf(res.result.records[i].id) > -1) { + res.result.records[i].distable = true + } else { + res.result.records[i].distable = false + } + } + this.dataSource = res.result.records + this.ipagination.total = res.result.total + } + if (res.code === 510) { + this.$message.warning(res.message) + } + this.loading = false + }) + }, + showModal(oldSlelectRows) { + this.oldSlelectRows = oldSlelectRows + 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 str = 'id,' + for (let a = 0; a < this.columns.length; a++) { + str += ',' + this.columns[a].dataIndex + } + return str + }, + searchReset(num) { + let that = this + if (num !== 0) { + that.loadData(1) + } + that.selectborrowIds = [] + }, + close() { + this.searchReset(0) + this.selectedRowKeys = [] + this.visible = false + }, + handleTableChange(pagination, filters, sorter) { + //TODO 绛涢�� + 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() { + this.$bus.$emit('selectionRows', this.selectionRows) + this.searchReset(0) + this.close() + }, + onSelectChange(selectionRows) { + this.selectionRows = selectionRows + }, + onSearch() { + this.loadData(1) + }, + searchQuery() { + this.loadData(1); + }, + searchReset() { + this.queryParam = {} + 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; +} +</style> \ No newline at end of file -- Gitblit v1.9.3