From 1b8399357869093ce21b285a921525651c46b2c3 Mon Sep 17 00:00:00 2001 From: cuilei <ray_tsu1@163.com> Date: 星期一, 08 九月 2025 11:28:44 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/base/modules/printerConfig/PrinterConfigModel.vue | 249 +++++++ src/views/base/PrinterConfigList.vue | 328 ++++++++++ src/views/cms/modules/CuttingInboundModal.vue | 106 +- public/index.html | 4 src/components/tools/Logo.vue | 2 src/views/user/Login.vue | 6 src/views/lsw/LswMaterialOutboundList.vue | 275 +++----- src/views/base/modules/warehouse/WarehouseModel.vue | 6 src/views/lsw/LswMaterialInventoryList.vue | 276 ++----- /dev/null | 60 - src/components/page/GlobalFooter.vue | 2 src/views/lsw/modules/LswMaterialInboundModal.vue | 4 src/views/cms/CuttingInventoryList.vue | 85 +- src/views/lsw/LswMaterialInboundList.vue | 152 +--- src/views/lsw/modules/LswMaterialInboundForm.vue | 185 +++-- src/components/layouts/TabLayout.vue | 2 src/views/cms/CuttingInboundList.vue | 2 src/views/lsw/LswMateriaView.vue | 135 +--- 18 files changed, 1,098 insertions(+), 781 deletions(-) diff --git a/public/index.html b/public/index.html index 0adf960..c816d16 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> - <title>MDC鏅烘収杞﹂棿</title> + <title>鍙屾灄杞存壙鏅烘収杞﹂棿</title> <link rel="icon" href="<%= BASE_URL %>logo.png"> <script src="<%= BASE_URL %>cdn/babel-polyfill/polyfill_7_2_5.js"></script> <style> @@ -249,7 +249,7 @@ <div id="loader"></div> <div class="loader-section section-left"></div> <div class="loader-section section-right"></div> - <div class="load_title">姝e湪鍔犺浇MDC鏅烘収杞﹂棿,璇疯�愬績绛夊緟 + <div class="load_title">姝e湪鍔犺浇绯荤粺,璇疯�愬績绛夊緟 </div> </div> diff --git a/src/components/layouts/TabLayout.vue b/src/components/layouts/TabLayout.vue index b70473d..b495c67 100644 --- a/src/components/layouts/TabLayout.vue +++ b/src/components/layouts/TabLayout.vue @@ -183,7 +183,7 @@ * @param title 瑕佷慨鏀圭殑鏂版爣棰� */ changeTitle(title) { - let projectTitle = "MDC鏅烘収杞﹂棿" + let projectTitle = "鍙屾灄杞存壙鏅烘収杞﹂棿" // 棣栭〉鐗规畩澶勭悊 if (this.$route.path === indexKey) { document.title = projectTitle diff --git a/src/components/page/GlobalFooter.vue b/src/components/page/GlobalFooter.vue index c71d938..b31fa02 100644 --- a/src/components/page/GlobalFooter.vue +++ b/src/components/page/GlobalFooter.vue @@ -3,7 +3,7 @@ <div class="copyright"> Copyright <a-icon type="copyright"/> - 2024 <span>2015-2025 鐏电鏅鸿兘</span> + 2025 <span>2015-2025 鐏电鏅鸿兘</span> </div> </div> </template> diff --git a/src/components/tools/Logo.vue b/src/components/tools/Logo.vue index 08e69d6..f564025 100644 --- a/src/components/tools/Logo.vue +++ b/src/components/tools/Logo.vue @@ -21,7 +21,7 @@ props: { title: { type: String, - default: 'MDC鏅烘収杞﹂棿', + default: 'MES鏅烘収杞﹂棿', required: false }, showTitle: { diff --git a/src/views/base/PrinterConfigList.vue b/src/views/base/PrinterConfigList.vue new file mode 100644 index 0000000..932cc76 --- /dev/null +++ b/src/views/base/PrinterConfigList.vue @@ -0,0 +1,328 @@ +<template> + <a-card + :bordered="false" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="30"> + + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鎵撳嵃鏈篒P"> + <j-input + placeholder="璇疯緭鍏ユ墦鍗版満IP妫�绱�" + v-model="queryParam.printerIp " + ></j-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="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + >鏂板 + </a-button> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + filterMultiple="filterMultiple" + :columns="columns" + :rowClassName="tableRowClass" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + > + <!--鐘舵�佹爮涓�у睍绀�--> + <span + slot="status" + slot-scope="text,record" + > + <a-badge + v-if="record.printerStatus==1" + status="success" + /> + <span + v-if="record.printerStatus==1" + class="success" + >鍚敤</span> + <a-badge + v-if="record.printerStatus==0" + status="error" + /> + <span + v-if="record.printerStatus==0" + class="error" + >绂佺敤</span> + </span> + <span + slot="action" + slot-scope="text, record" + > + <a + href="javascript:;" + @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 v-if="record.printerStatus == 0"> + <a-popconfirm + title="纭畾鍚敤鍚�?" + @confirm="() => handleActive(record.id)" + > + <a>鍚敤</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item v-if="record.printerStatus == 1"> + <a-popconfirm + title="纭畾绂佺敤鍚�?" + @confirm="() => handleActive(record.id)" + > + <a>绂佺敤</a> + </a-popconfirm> + </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> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <printer-config-model + ref="modalForm" + @ok="modalFormOk" + ></printer-config-model> + </a-card> +</template> + +<script> +//鎸夐渶寮曞叆 缁勪欢 +import PrinterConfigModel from './modules/printerConfig/PrinterConfigModel' + +import { getAction, requestPut } from '@/api/manage' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import JEllipsis from '@/components/jeecg/JEllipsis' +import JInput from '@/components/jeecg/JInput' + +export default { + name: 'PrinterConfigList', + mixins: [JeecgListMixin], + components: { + PrinterConfigModel, + JEllipsis, + JInput + }, + data() { + return { + dataSource: [], + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + /* 鎺掑簭鍙傛暟 */ + isorter:{ + column: 'printerIp', + order: 'asc', + }, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鎵撳嵃鏈篒P', + align: 'center', + dataIndex: 'printerIp' + }, + { + title: '鎵撳嵃鏈哄悕绉�', + align: 'center', + dataIndex: 'printerName' + }, + { + title: '鎵撳嵃鏈虹鍙�', + align: 'center', + dataIndex: 'portNumber' + }, + { + title: '鎵撳嵃鏈哄瀷鍙�', + align: 'center', + dataIndex: 'printerModel' + }, + { + width: 100, + title: '鐘舵��', + align: 'center', + scopedSlots: { + customRender: 'status' + }, + dataIndex: 'printerStatus' + }, + { + width: 150, + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/base/printerConfig/list', + delete: '/base/printerConfig/delete', + active: '/base/printerConfig/active' + } + } + }, + mounted() { + + }, + methods: { + loadData(arg) { + if (arg === 1) { + this.ipagination.current = 1 + } + 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 + }) + }, + //绂佺敤鐘舵�佹牱寮� + tableRowClass(record, index) { + if (record.printerStatus != '1') { + return 'frozenRowClass' + } + return '' + }, + //鍚敤绂佺敤 + handleActive(id) { + if (!this.url.active) { + this.$message.error('璇疯缃畊rl.active!') + return + } + let that = this + requestPut(that.url.active, {}, { id: 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'; + +.frozenRowClass { + color: #c9c9c9; +} + +.success { + color: green; +} + +.error { + color: red; +} + +.fontweight { + font-weight: bold; +} + +.ant-card-body .table-operator { + margin-bottom: 18px; +} + +.ant-table-tbody .ant-table-row td { + padding-top: 15px; + padding-bottom: 15px; +} + +.anty-row-operator button { + margin: 0 5px; +} + +/deep/ .ant-btn-danger { + background-color: #ffffff; +} + +.ant-modal-cust-warp { + height: 100%; +} + +.ant-modal-cust-warp .ant-modal-body { + height: calc(100% - 110px) !important; + overflow-y: auto; +} + +.ant-modal-cust-warp .ant-modal-content { + height: 90% !important; + overflow-y: hidden; +} +</style> \ No newline at end of file diff --git a/src/views/base/modules/printerConfig/PrinterConfigModel.vue b/src/views/base/modules/printerConfig/PrinterConfigModel.vue new file mode 100644 index 0000000..e4e6f47 --- /dev/null +++ b/src/views/base/modules/printerConfig/PrinterConfigModel.vue @@ -0,0 +1,249 @@ +<template> + <a-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + :maskClosable="false" + :okButtonProps="{ props: {disabled: disableSubmit} }" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴" + > + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="鎵撳嵃鏈篒P" + > + <a-input + :disabled="disableSubmit" + allow-clear + placeholder="璇疯緭鍏ユ墦鍗版満IP" + v-decorator="['printerIp', validatorRules.printerIp]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="鎵撳嵃鏈哄悕绉�" + > + <a-input + :disabled="disableSubmit" + allow-clear + placeholder="璇疯緭鍏ユ墦鍗版満绔彛" + v-decorator="['printerName', validatorRules.printerName]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="鎵撳嵃鏈虹鍙�" + > + <a-input + :disabled="disableSubmit" + allow-clear + placeholder="璇疯緭鍏ユ墦鍗版満绔彛" + v-decorator="['portNumber', validatorRules.portNumber]" + /> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="鎵撳嵃鏈哄瀷鍙�" + > + <a-input + :disabled="disableSubmit" + allow-clear + placeholder="璇疯緭鍏ユ墦鍗版満鍨嬪彿" + v-decorator="['printerModel', validatorRules.printerModel]" + /> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + </a-modal> +</template> + +<script> +import { httpAction } from '@/api/manage' +import pick from 'lodash.pick' +import { duplicateCheck } from '@/api/api' //閲嶅鏍¢獙 + +export default { + name: 'PrinterConfigModel', + components: {}, + data() { + return { + title: '鎿嶄綔', + visible: false, + disableSubmit: false, + model: {}, + treeData: [], + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + printerIp: { + rules: [ + { required: true, message: '璇疯緭鍏ユ墦鍗版満IP' }, + { min: 2, max: 30, message: '闀垮害鍦� 2 鍒� 30 涓瓧绗�', trigger: 'blur' }, + ] + }, + printerName: { + rules: [ + { required: true, message: '璇疯緭鍏ユ墦鍗版満鍚嶇О' }, + { min: 2, max: 30, message: '闀垮害鍦� 2 鍒� 30 涓瓧绗�', trigger: 'blur' }, + ] + }, + portNumber: { + rules: [ + { required: true, message: '璇疯緭鍏ユ墦鍗版満绔彛' }, + { min: 0, max: 64, message: '闀垮害涓嶈秴杩� 64 涓瓧绗�', trigger: 'blur' }, + { validator: this.validateName } + ] + }, + + printerModel: { + rules: [ + { required: true, message: '璇疯緭鍏ユ墦鍗版満鍨嬪彿' }, + { min: 0, max: 64, message: '闀垮害涓嶈秴杩� 64 涓瓧绗�', trigger: 'blur' } + ] + } + }, + url: { + add: '/base/printerConfig/add', + edit: '/base/printerConfig/edit' + }, + nextFactoryOptions: [] + } + }, + + + created() { + }, + methods: { + add() { + this.edit({}) + }, + edit(record) { + this.form.resetFields() + this.model = Object.assign({}, record) + this.warehouseId = record.id + this.visible = true + this.$nextTick(() => { + this.form.setFieldsValue( + pick(this.model, 'printerIp','printerName', 'portNumber', 'printerModel') + ) + }) + }, + close() { + this.$emit('close') + this.visible = false + }, + handleOk() { + console.log('琛ㄥ崟鍊�:', this.form.getFieldsValue()) + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' + } + let formData = Object.assign(this.model, values) + httpAction(httpurl, formData, 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() + }) + } + }) + }, + handleCancel() { + this.close() + }, + + //楠岃瘉 鍚嶇О + validateName(rule, value, callback) { + var params = { + tableName: 'base_printer_config', + fieldName: 'port_number', + fieldVal: value, + //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + delFlag: 'true' + } + duplicateCheck(params).then((res) => { + if (res.success) { + callback() + } else { + callback('鎵撳嵃鏈虹鍙e凡瀛樺湪!') + } + }) + }, + // 鍏抽棴寮圭獥鏃舵竻闄よ〃鍗曟牎楠� + removeValidate() { + if (this.$refs.form) this.$refs.form.clearValidate() + } + } +} +</script> + +<style 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; +} +</style> \ No newline at end of file diff --git a/src/views/base/modules/warehouse/WarehouseModel.vue b/src/views/base/modules/warehouse/WarehouseModel.vue index e8b6ce8..5565858 100644 --- a/src/views/base/modules/warehouse/WarehouseModel.vue +++ b/src/views/base/modules/warehouse/WarehouseModel.vue @@ -55,6 +55,7 @@ > <j-dict-select-tag :disabled="disableSubmit" type="list" placeholder="璇烽�夋嫨浜х嚎" v-model="model.factoryId" + v-decorator="['factoryId', validatorRules.factoryId ]" dictCode="base_factory,factory_name,id,del_flag='0' and factory_category='3'" /> </a-form-item> </a-col> @@ -105,6 +106,11 @@ { min: 0, max: 64, message: '闀垮害涓嶈秴杩� 64 涓瓧绗�', trigger: 'blur' }, { validator: this.validateName } ] + }, + factoryId: { + rules: [ + { required: true, message: '璇烽�夋嫨浜х嚎' }, + ] } }, url: { diff --git a/src/views/cms/CuttingInboundList.vue b/src/views/cms/CuttingInboundList.vue index 6f4ce01..673fc37 100644 --- a/src/views/cms/CuttingInboundList.vue +++ b/src/views/cms/CuttingInboundList.vue @@ -68,7 +68,7 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <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> diff --git a/src/views/cms/CuttingInventoryList.vue b/src/views/cms/CuttingInventoryList.vue index a21fc71..ae89f6a 100644 --- a/src/views/cms/CuttingInventoryList.vue +++ b/src/views/cms/CuttingInventoryList.vue @@ -2,41 +2,41 @@ <a-card :bordered="false"> <!-- 鏌ヨ鍖哄煙 --> <div class="table-page-search-wrapper"> -<!-- <a-form layout="inline" @keyup.enter.native="searchQuery">--> -<!-- <a-row :gutter="24">--> + <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.cuttingId" />--> <!-- </a-form-item>--> <!-- </a-col>--> -<!-- <a-col :md="6" :sm="8">--> -<!-- <a-form-item label="鍒�鍏锋潯鐮�">--> -<!-- <a-input placeholder="璇疯緭鍏ュ垁鍏锋潯鐮�" v-model="queryParam.cuttingBarcode" />--> -<!-- </a-form-item>--> -<!-- </a-col>--> -<!-- <a-col--> -<!-- :md="6"--> -<!-- :sm="8"--> -<!-- >--> -<!-- <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>--> -<!-- </span>--> -<!-- </a-col>--> -<!-- </a-row>--> -<!-- </a-form>--> + <a-col :md="6" :sm="8"> + <a-form-item label="鍒�鍏锋潯鐮�"> + <a-input placeholder="璇疯緭鍏ュ垁鍏锋潯鐮�" v-model="queryParam.cuttingBarcode" /> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <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> + </span> + </a-col> + </a-row> + </a-form> </div> <!-- 鏌ヨ鍖哄煙-END --> @@ -220,9 +220,27 @@ align: "center", }, { - title: '鏁伴噺', + title: '鎬绘暟', dataIndex: 'cuttingIdNumber', - align: "center" + align: "center", + customRender: (text, record, index) => { + const obj = { + children: text, + attrs: {} + }; + // 鍙湪绗竴琛屾樉绀烘�绘暟閲忥紝鍏朵粬琛屾樉绀虹┖ + if (record.rowSpan !== undefined && record.rowSpan > 0) { + obj.children = text; + obj.attrs.rowSpan = record.rowSpan; + } else if (record.rowSpan === 0) { + obj.children = ''; + obj.attrs.rowSpan = 0; + } else { + obj.children = text; + obj.attrs.rowSpan = 1; + } + return obj; + } } ], url: { @@ -475,7 +493,8 @@ } return result; - } + }, + } } </script> diff --git a/src/views/cms/modules/CuttingInboundModal.vue b/src/views/cms/modules/CuttingInboundModal.vue index 5d11427..e9385b4 100644 --- a/src/views/cms/modules/CuttingInboundModal.vue +++ b/src/views/cms/modules/CuttingInboundModal.vue @@ -3,7 +3,7 @@ <a-spin :spinning="confirmLoading"> <a-form :form="form"> <a-row style="width: 100%"> - <a-col :span="24 / 2"> + <a-col :span="24 / 2"> <a-form-item label="鍏ュ簱浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> <j-search-select-tag :disabled="disableSubmit" @@ -26,12 +26,13 @@ <a-row style="width: 100%"> <a-col :span="24"> <a-form-item label="鍏ュ簱璇存槑" :labelCol="{span:3}" :wrapperCol="{span:21}"> - <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ叆搴撹鏄�" v-decorator="['receiveComment', validatorRules.receiveComment]" /> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ叆搴撹鏄�" + v-decorator="['receiveComment', validatorRules.receiveComment]" /> </a-form-item> </a-col> </a-row> <a-row style="width: 100%"> - <a-col :span="24 / 2"> + <a-col :span="24 / 2"> <a-form-item label="纭浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> <j-search-select-tag :disabled="disableSubmit" @@ -54,7 +55,8 @@ <a-row style="width: 100%"> <a-col :span="24"> <a-form-item label="纭鎰忚" :labelCol="{span:3}" :wrapperCol="{span:21}"> - <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-decorator="['confirmComment', validatorRules.confirmComment]" /> + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" + v-decorator="['confirmComment', validatorRules.confirmComment]" /> </a-form-item> </a-col> </a-row> @@ -103,27 +105,28 @@ <script> - import pick from 'lodash.pick' - import JSelectToolingModal from './JSelectToolingModal' - 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 store from '@/store/' - export default { - name: 'CuttingInboundModal', - components: { +import pick from 'lodash.pick' +import JSelectToolingModal from './JSelectToolingModal' +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 store from '@/store/' + +export default { + name: 'CuttingInboundModal', + components: { JSelectToolingModal, JMultiSelectTag, JDictSelectTag, store, - moment, + moment }, - data () { - return { - /* 鍒嗛〉鍙傛暟 */ + data() { + return { + /* 鍒嗛〉鍙傛暟 */ ipagination: { current: 1, pageSize: 10, @@ -133,27 +136,26 @@ }, showQuickJumper: true, showSizeChanger: true, - total: 0, + total: 0 }, - title:'鏂板', - visible: false, - selectedRowKeys: {}, + title: '鏂板', + visible: false, + selectedRowKeys: {}, model: {}, labelCol: { xs: { span: 24 }, - sm: { span: 6 }, + sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, - sm: { span: 18 }, + sm: { span: 18 } }, confirmLoading: false, loading: false, form: this.$form.createForm(this), dataSource: [], param: {}, - validatorRules: { - }, + validatorRules: {}, columns: [ { title: '#', @@ -161,52 +163,52 @@ key: 'rowIndex', width: 50, align: 'center', - customRender: function (t, r, index) { + customRender: function(t, r, index) { return parseInt(index) + 1 - }, + } }, { title: '鍒�鍏风紪鐮�', align: 'center', dataIndex: 'cuttingCode', - width: 150, + width: 150 }, { title: '鍒�鍏峰悕绉�', align: 'center', - dataIndex: 'cuttingName', + dataIndex: 'cuttingName' }, { title: '鍏ュ簱鏁伴噺', align: 'center', dataIndex: 'receiveNumber', - scopedSlots: { customRender: 'receiveNumber' }, + scopedSlots: { customRender: 'receiveNumber' } }, { title: '鎿嶄綔', dataIndex: 'action', align: 'center', - scopedSlots: { customRender: 'action' }, - }, + scopedSlots: { customRender: 'action' } + } ], url: { add: '/cms/cuttingInbound/add', - detailList: '/cms/cuttingInbound/detailList', + detailList: '/cms/cuttingInbound/detailList' }, - orderId:'', - disableSubmit:false - } - }, - methods: { - modalFormOk(){ + orderId: '', + disableSubmit: false + } + }, + methods: { + modalFormOk() { - }, - getQueryParams() { + }, + getQueryParams() { this.param.pageNo = this.ipagination.current this.param.pageSize = this.ipagination.pageSize return filterObj(this.param) }, - add() { + add() { let receiver = store.getters.userInfo.id let receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') this.edit({ receiver: receiver, receiveTime: receiveTime }) @@ -228,7 +230,7 @@ ) }) }, - handleDelete(record, index) { + handleDelete(record, index) { this.dataSource.splice(index, 1) }, handleChange(value, key, column, index) { @@ -240,7 +242,7 @@ this.dataSource = temp } }, - selectTooling: function () { + selectTooling: function() { let ids = [] for (let i = 0; i < this.dataSource.length; i++) { ids.push(this.dataSource[i].cuttingId) @@ -266,7 +268,7 @@ return } // 鏍¢獙鍏ュ簱鏁伴噺鏄惁濉啓 - for(let i=0; i<this.dataSource.length; i++) { + for (let i = 0; i < this.dataSource.length; i++) { if (!this.dataSource[i].receiveNumber || this.dataSource[i].receiveNumber <= 0) { this.$message.error(`蹇呴』濉啓鍏ュ簱鏁伴噺`) return @@ -303,9 +305,9 @@ this.dataSource = [] this.visible = false this.disableSubmit = false - }, - }, - mounted() { + } + }, + mounted() { this.$bus.$on('selectionRows', (data) => { //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟 for (let i = 0; i < data.length; i++) { @@ -316,6 +318,6 @@ }) } }) - }, } +} </script> \ No newline at end of file diff --git a/src/views/lsw/LswMateriaView.vue b/src/views/lsw/LswMateriaView.vue index 53f0289..52f29b9 100644 --- a/src/views/lsw/LswMateriaView.vue +++ b/src/views/lsw/LswMateriaView.vue @@ -40,8 +40,7 @@ </a-row> </a-form> </div> - <!-- <a-button @click="handleAdd" type="primary" icon="plus">鏂板鐗╂枡淇℃伅-娴嬭瘯</a-button>--> - <a-spin :spinning="confirmLoading"> + <a-spin :spinning="loading"> <div> <!-- 涓昏〃鍗曞尯鍩� --> <a-table @@ -55,6 +54,7 @@ :pagination="ipagination" :loading="loading" :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio'}" + :customRow="customTableRow" @change="handleTableChange"> <!--鐘舵�佹爮涓�у睍绀�--> <span @@ -118,24 +118,9 @@ </a-table> </div> <!-- 瀛愯〃鍗曞尯鍩� --> - <a-tabs v-model="activeKey" @change="handleChangeTabs"> - <a-tab-pane tab="搴撳瓨鏄庣粏" :key="refKeys[0]" :forceRender="true"> - <div style="display: flex; align-items: center; margin-bottom: 10px;"> - <a-tag color="green" style="font-weight: bold;"> - 搴撳瓨鎬婚噺锛歿{ totalInventoryQuantity }} - </a-tag> - </div> - <j-vxe-table - keep-source - :ref="refKeys[0]" - :loading="lswMaterialInventoryTable.loading" - :columns="lswMaterialInventoryTable.columns" - :dataSource="lswMaterialInventoryTable.dataSource" - :maxHeight="300" - :rowNumber="true" - :rowSelection="true" - :toolbar="false" - /> + <a-tabs v-model="activeKey"> + <a-tab-pane tab="搴撳瓨鏄庣粏" key="lswMaterialInventory" :forceRender="true"> + <lsw-material-inventory-list ref="lswMaterialInventory" /> </a-tab-pane> </a-tabs> </a-spin> @@ -146,18 +131,16 @@ <script> import { getAction } from '@/api/manage' -import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' -import { JVXETypes } from '@/components/jeecg/JVxeTable' -import JFormContainer from '@/components/jeecg/JFormContainer' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import LswMaterialModal from '@views/lsw/modules/LswMaterialModal.vue' +import LswMaterialInventoryList from './LswMaterialInventoryList.vue' export default { - name: 'LswMaterialForm', - mixins: [JVxeTableModelMixin, JeecgListMixin], + name: 'LswMaterialView', + mixins: [JeecgListMixin], components: { LswMaterialModal, - JFormContainer + LswMaterialInventoryList }, data() { return { @@ -175,8 +158,6 @@ validatorRules: {}, selectedRowKeys: [], // 鍒濆鍖栦负绌烘暟缁勶紙鍗曢�夋椂瀛樺偍鍗曚釜key锛� selectedRowData: null, - refKeys: ['lswMaterialInventory'], - tableKeys: ['lswMaterialInventory'], activeKey: 'lswMaterialInventory', columns: [ { @@ -226,63 +207,12 @@ scopedSlots: { customRender: 'action' } } ], - // 鐗╂枡搴撳瓨淇℃伅 - lswMaterialInventoryTable: { - loading: false, - dataSource: [], - columns: [ - { - title: '鎵规鍙�', - key: 'batchNumber', - type: JVXETypes.input, - width: '200px', - placeholder: '璇疯緭鍏�${title}', - defaultValue: '' - }, - { - title: '搴撳瓨绫诲瀷', - key: 'inventoryCategory', - type: JVXETypes.input, - width: '200px', - placeholder: '璇疯緭鍏�${title}', - defaultValue: '' - }, - { - title: '鏁伴噺', - key: 'quantity', - type: JVXETypes.input, - width: '200px', - placeholder: '璇疯緭鍏�${title}', - defaultValue: '' - }, - { - title: '搴撳瓨鍦�', - key: 'warehouseName', - type: JVXETypes.input, - width: '200px', - placeholder: '璇疯緭鍏�${title}', - defaultValue: '' - }, - { - title: '搴撳瓨鐘舵��', - key: 'inventoryStatus', - type: JVXETypes.input, - width: '200px', - placeholder: '璇疯緭鍏�${title}', - defaultValue: '' - } - ] - }, url: { - //searchlikeQuery list: '/lsw/lswMaterial/list', edit: '/lsw/lswMaterial/edit', active: '/lsw/lswMaterial/active', inactive: '/lsw/lswMaterial/inactive', queryById: '/lsw/lswMaterial/queryById', - lswMaterialInventory: { - list: '/lsw/lswMaterial/queryLswMaterialInventoryByMainId' - } } } }, @@ -298,15 +228,6 @@ formDisabled() { return this.disabled }, - totalInventoryQuantity() { - if (!this.lswMaterialInventoryTable.dataSource || this.lswMaterialInventoryTable.dataSource.length === 0) { - return '0' - } - return this.lswMaterialInventoryTable.dataSource.reduce((sum, item) => { - const quantity = Number(item.quantity) || 0 - return sum + quantity - }, 0) - }, }, created() { }, @@ -319,17 +240,19 @@ return '' }, async onSelectChange(selectedRowKeys) { - this.lswMaterialInventoryTable.loading = true // 鍗曢�夋ā寮忎笅锛宻electedRowKeys 鏄暟缁勶紝浣嗛暱搴︽渶澶氫负1 - console.log('鐐瑰嚮浜�---->') this.selectedRowKeys = selectedRowKeys - this.lswMaterialInventoryTable.dataSource = [] // 鑾峰彇閫変腑琛岀殑瀹屾暣鏁版嵁 - if (selectedRowKeys.length > 0) { - const selectedId = selectedRowKeys[0] // 閫変腑琛岀殑id - const lswMaterialInventoryResult = await getAction(this.url.lswMaterialInventory.list, { 'id': selectedId }) - this.lswMaterialInventoryTable.dataSource = lswMaterialInventoryResult.result - this.lswMaterialInventoryTable.loading = false + if (selectedRowKeys.length === 1) { + //鍔犺浇搴撳瓨淇℃伅 + this.$refs.lswMaterialInventory.queryParam.materialId = this.selectedRowKeys[0] + this.$refs.lswMaterialInventory.loadData(1) + this.$refs.lswMaterialInventory.statisticsInventory(this.selectedRowKeys[0]) + }else { + //搴撳瓨淇℃伅娓呯┖ + this.$refs.lswMaterialInventory.queryParam.materialId = 'null' + this.$refs.lswMaterialInventory.loadData(1) + this.$refs.lswMaterialInventory.statisticsInventory('null') } }, handleActive(record) { @@ -346,8 +269,24 @@ that.$message.warning(res.message) } }) - } - + }, + /** + * 鑷畾涔夎〃鏍艰 + * @param record 琛ㄦ牸琛屼俊鎭� + * @returns {{style: {cursor: string}, on: {click: *}}} 鏍峰紡瀵硅薄涓庝簨浠舵柟娉� + */ + customTableRow(record) { + return { + style: { + cursor: 'pointer' + }, + on: { + click: () => { + this.onSelectChange([record.id]) + } + } + } + }, } } </script> diff --git a/src/views/lsw/LswMaterialInboundList.vue b/src/views/lsw/LswMaterialInboundList.vue index c5ca76e..c682bdb 100644 --- a/src/views/lsw/LswMaterialInboundList.vue +++ b/src/views/lsw/LswMaterialInboundList.vue @@ -5,24 +5,41 @@ <a-form layout="inline" @keyup.enter.native="searchQuery" > <a-row :gutter="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="绾胯竟搴�"> + <j-dict-select-tag placeholder="璇烽�夋嫨绾胯竟搴�" v-model="queryParam.warehouseId" + dictCode="base_line_side_warehouse,warehouse_name,id,del_flag=0 and warehouse_status='1'"></j-dict-select-tag> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍏ュ簱绫诲瀷"> + <j-dict-select-tag placeholder="璇烽�夋嫨鍏ュ簱绫诲瀷" v-model="queryParam.inboundCategory" dictCode="material_inbound_category"></j-dict-select-tag> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="鐗╂枡缂栫爜"> <j-input placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�" v-model="queryParam.materialNumber"></j-input> </a-form-item> </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="鐗╂枡鍚嶇О"> - <j-input placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" v-model="queryParam.materialName"></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.batchNumber"></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="鐗╂枡鍚嶇О"> + <j-input placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" v-model="queryParam.materialName"></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.batchNumber"></j-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-button type="info" @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> @@ -32,22 +49,16 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> - <a-dropdown v-if="selectedRowKeys.length > 0"> - <a-menu slot="overlay"> - <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> - </a-menu> - <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> - </a-dropdown> + <a-button @click="handleAdd('HEAT_TREATMENT_INBOUND')" type="primary" icon="plus">鐑鐞嗗鍗忓叆搴�</a-button> + <a-button @click="handleAdd('SMALL_INNER_RING')" type="primary" icon="plus">灏忓唴鍦堝鍗忓叆搴�</a-button> + <a-button @click="handleAdd('MATERIAL_INNER_TRANSFER')" type="primary" icon="plus">鍐呴儴璋冩嫧</a-button> </div> - <!-- table鍖哄煙-begin --> <div> <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> </div> - <a-table ref="table" size="middle" @@ -61,46 +72,6 @@ :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> @@ -137,12 +108,17 @@ } }, { - title:'浜х嚎', + title:'鏉ユ簮缂栫爜', align:"center", - dataIndex: 'factoryId_dictText' + dataIndex: 'originalCode' }, { - title:'搴撳瓨鍦�', + title:'鏉ユ簮鍚嶇О', + align:"center", + dataIndex: 'originalName' + }, + { + title:'绾胯竟搴�', align:"center", dataIndex: 'warehouseId_dictText' }, @@ -167,60 +143,36 @@ dataIndex: 'quantity' }, { - title:'鎺ユ敹浜�', + title:'鍏ュ簱绫诲瀷', align:"center", - dataIndex: 'receiver' + dataIndex: 'inboundCategory_dictText' }, { - title:'鎺ユ敹鏃堕棿', + title:'鍏ュ簱浜�', + align:"center", + dataIndex: 'receiver_dictText' + }, + { + title:'鍏ュ簱鏃堕棿', align:"center", dataIndex: 'receiveTime' }, - // { - // title: '鎿嶄綔', - // dataIndex: 'action', - // align:"center", - // fixed:"right", - // width:147, - // scopedSlots: { customRender: 'action' } - // } ], url: { - list: "/lswmaterialinbound/lswMaterialInbound/list", - delete: "/lswmaterialinbound/lswMaterialInbound/delete", - deleteBatch: "/lswmaterialinbound/lswMaterialInbound/deleteBatch", - exportXlsUrl: "/lswmaterialinbound/lswMaterialInbound/exportXls", - importExcelUrl: "lswmaterialinbound/lswMaterialInbound/importExcel", + list: "/lsw/materialInbound/list", }, - dictOptions:{}, - superFieldList:[], } }, created() { - this.getSuperFieldList(); }, computed: { - importExcelUrl: function(){ - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; - }, }, methods: { - initDictConfig(){ - + handleAdd(inboundCategory) { + this.$refs.modalForm.add(inboundCategory); + this.$refs.modalForm.title = "鏂板"; + this.$refs.modalForm.disableSubmit = false; }, - getSuperFieldList(){ - let fieldList=[]; - fieldList.push({type:'int',value:'delFlag',text:'鍒犻櫎鏍囪',dictCode:''}) - fieldList.push({type:'string',value:'factoryId',text:'浜х嚎ID',dictCode:''}) - fieldList.push({type:'string',value:'warehouseId',text:'搴撳瓨鍦癐D',dictCode:''}) - fieldList.push({type:'string',value:'materialNumber',text:'鐗╂枡缂栫爜',dictCode:''}) - fieldList.push({type:'string',value:'materialName',text:'鐗╂枡鍚嶇О',dictCode:''}) - fieldList.push({type:'string',value:'batchNumber',text:'鎵规鍙�',dictCode:''}) - fieldList.push({type:'int',value:'quantity',text:'鍏ュ簱鏁伴噺',dictCode:''}) - fieldList.push({type:'string',value:'receiver',text:'鎺ユ敹浜�',dictCode:''}) - fieldList.push({type:'datetime',value:'receiveTime',text:'鎺ユ敹鏃堕棿'}) - this.superFieldList = fieldList - } } } </script> diff --git a/src/views/lsw/LswMaterialInventoryList.vue b/src/views/lsw/LswMaterialInventoryList.vue index b39b983..ceac6ed 100644 --- a/src/views/lsw/LswMaterialInventoryList.vue +++ b/src/views/lsw/LswMaterialInventoryList.vue @@ -1,201 +1,109 @@ <template> <a-card :bordered="false"> - <!-- 鏌ヨ鍖哄煙 --> - <div class="table-page-search-wrapper"> - <a-form layout="inline" @keyup.enter.native="searchQuery"> - <a-row :gutter="24"> - </a-row> - </a-form> + <div style="display: flex; align-items: center; margin-bottom: 10px;"> + <a-tag color="blue" style="font-weight: bold; font-size: large;"> + 搴撳瓨缁熻锛歿{ inventoryStatisticsInfo}} + </a-tag> </div> - <!-- 鏌ヨ鍖哄煙-END --> - - <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <div class="table-operator"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> - <a-button type="primary" icon="download" @click="handleExportXls('鐗╂枡搴撳瓨淇℃伅')">瀵煎嚭</a-button> - <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> - <a-button type="primary" icon="import">瀵煎叆</a-button> - </a-upload> - <!-- 楂樼骇鏌ヨ鍖哄煙 --> - <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> - <a-dropdown v-if="selectedRowKeys.length > 0"> - <a-menu slot="overlay"> - <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> - </a-menu> - <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> - </a-dropdown> - </div> - - <!-- table鍖哄煙-begin --> - <div> - <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> - <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� - <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> - </div> - - <a-table - ref="table" - size="middle" - :scroll="{x:true}" - bordered - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - class="j-table-force-nowrap" - @change="handleTableChange"> - - <template slot="htmlSlot" slot-scope="text"> - <div v-html="text"></div> - </template> - <template slot="imgSlot" slot-scope="text,record"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> - <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> - </template> - <template slot="fileSlot" slot-scope="text"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> - <a-button - v-else - :ghost="true" - type="primary" - icon="download" - size="small" - @click="downloadFile(text)"> - 涓嬭浇 - </a-button> - </template> - - <span slot="action" slot-scope="text, record"> - <a @click="handleEdit(record)">缂栬緫</a> - - <a-divider type="vertical" /> - <a-dropdown> - <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> - <a-menu slot="overlay"> - <a-menu-item> - <a @click="handleDetail(record)">璇︽儏</a> - </a-menu-item> - <a-menu-item> - <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> - <a>鍒犻櫎</a> - </a-popconfirm> - </a-menu-item> - </a-menu> - </a-dropdown> - </span> - - </a-table> - </div> - - <lsw-material-inventory-modal ref="modalForm" @ok="modalFormOk"></lsw-material-inventory-modal> + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange"> + </a-table> </a-card> </template> <script> - import '@/assets/less/TableExpand.less' - import { mixinDevice } from '@/utils/mixin' - import { JeecgListMixin } from '@/mixins/JeecgListMixin' - import LswMaterialInventoryModal from './modules/LswMaterialInventoryModal' +import '@/assets/less/TableExpand.less' +import { mixinDevice } from '@/utils/mixin' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import LswMaterialInventoryModal from './modules/LswMaterialInventoryModal' +import { getAction } from '@api/manage' - export default { - name: 'LswMaterialInventoryList', - mixins:[JeecgListMixin, mixinDevice], - components: { - LswMaterialInventoryModal - }, - data () { - return { - description: '鐗╂枡搴撳瓨淇℃伅绠$悊椤甸潰', - // 琛ㄥご - columns: [ - { - title: '#', - dataIndex: '', - key:'rowIndex', - width:60, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; - } - }, - { - title:'鐗╂枡ID', - align:"center", - dataIndex: 'materialId' - }, - { - title:'鎵规鍙�', - align:"center", - dataIndex: 'batchNumber' - }, - { - title:'搴撳瓨绫诲瀷', - align:"center", - dataIndex: 'inventoryCategory' - }, - { - title:'鏁伴噺', - align:"center", - dataIndex: 'quantity' - }, - { - title:'搴撳瓨鍦癐D', - align:"center", - dataIndex: 'warehouseId' - }, - { - title:'搴撳瓨鐘舵��', - align:"center", - dataIndex: 'inventoryStatus' - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align:"center", - fixed:"right", - width:147, - scopedSlots: { customRender: 'action' } +export default { + name: 'LswMaterialInventoryList', + mixins: [JeecgListMixin, mixinDevice], + components: { + LswMaterialInventoryModal + }, + data() { + return { + description: '鐗╂枡搴撳瓨淇℃伅绠$悊椤甸潰', + inventoryStatisticsInfo: "0", + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 } - ], - url: { - list: "/lswmaterialinventory/lswMaterialInventory/list", - delete: "/lswmaterialinventory/lswMaterialInventory/delete", - deleteBatch: "/lswmaterialinventory/lswMaterialInventory/deleteBatch", - exportXlsUrl: "/lswmaterialinventory/lswMaterialInventory/exportXls", - importExcelUrl: "lswmaterialinventory/lswMaterialInventory/importExcel", - }, - dictOptions:{}, - superFieldList:[], - } - }, - created() { - this.getSuperFieldList(); - }, - computed: { - importExcelUrl: function(){ - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + { + title: '鎵规鍙�', + align: 'center', + dataIndex: 'batchNumber' + }, + { + title: '搴撳瓨绫诲瀷', + align: 'center', + dataIndex: 'inventoryCategory_dictText' + }, + { + title: '鏁伴噺', + align: 'center', + dataIndex: 'quantity' + }, + { + title: '搴撳瓨鍦�', + align: 'center', + dataIndex: 'warehouseId_dictText' + }, + { + title: '搴撳瓨鐘舵��', + align: 'center', + dataIndex: 'inventoryStatus_dictText' + }, + { + title: '鐑鐞嗘爣璁�', + align: 'center', + dataIndex: 'warehouseId_dictText' + }, + ], + url: { + list: '/lsw/materialInventory/list', + statistics: '/lsw/materialInventory/statisticsInventory', }, - }, - methods: { - initDictConfig(){ - }, - getSuperFieldList(){ - let fieldList=[]; - fieldList.push({type:'string',value:'materialId',text:'鐗╂枡ID',dictCode:''}) - fieldList.push({type:'string',value:'batchNumber',text:'鎵规鍙�',dictCode:''}) - fieldList.push({type:'string',value:'inventoryCategory',text:'搴撳瓨绫诲瀷',dictCode:''}) - fieldList.push({type:'string',value:'quantity',text:'鏁伴噺',dictCode:''}) - fieldList.push({type:'string',value:'warehouseId',text:'搴撳瓨鍦癐D',dictCode:''}) - fieldList.push({type:'string',value:'inventoryStatus',text:'搴撳瓨鐘舵��',dictCode:''}) - this.superFieldList = fieldList - } + } + }, + created() { + }, + computed: { + }, + methods: { + statisticsInventory(materialId) { + getAction(this.url.statistics, {materialId : materialId}).then(res => { + if(res.success) { + this.inventoryStatisticsInfo = res.result; + } + }) } } +} </script> <style scoped> - @import '~@assets/less/common.less'; +@import '~@assets/less/common.less'; </style> \ No newline at end of file diff --git a/src/views/lsw/LswMaterialOutboundList.vue b/src/views/lsw/LswMaterialOutboundList.vue index b38cd0d..6abdcb4 100644 --- a/src/views/lsw/LswMaterialOutboundList.vue +++ b/src/views/lsw/LswMaterialOutboundList.vue @@ -5,24 +5,42 @@ <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="绾胯竟搴�"> + <j-dict-select-tag placeholder="璇烽�夋嫨绾胯竟搴�" v-model="queryParam.warehouseId" + dictCode="base_line_side_warehouse,warehouse_name,id,del_flag=0 and warehouse_status='1'"></j-dict-select-tag> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍑哄簱绫诲瀷"> + <j-dict-select-tag placeholder="璇烽�夋嫨鍑哄簱绫诲瀷" v-model="queryParam.outboundCategory" + dictCode="material_outbound_category"></j-dict-select-tag> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="鐗╂枡缂栫爜"> <j-input placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�" v-model="queryParam.materialNumber"></j-input> </a-form-item> </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="鐗╂枡鍚嶇О"> - <j-input placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" v-model="queryParam.materialName"></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.batchNumber"></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="鐗╂枡鍚嶇О"> + <j-input placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" v-model="queryParam.materialName"></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.batchNumber"></j-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-button type="info" @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> @@ -30,21 +48,11 @@ </div> <!-- 鏌ヨ鍖哄煙-END --> - <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <div class="table-operator"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> - <a-dropdown v-if="selectedRowKeys.length > 0"> - <a-menu slot="overlay"> - <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> - </a-menu> - <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> - </a-dropdown> - </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>椤� + <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> @@ -61,169 +69,88 @@ :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" class="j-table-force-nowrap" @change="handleTableChange"> - - <template slot="htmlSlot" slot-scope="text"> - <div v-html="text"></div> - </template> - <template slot="imgSlot" slot-scope="text,record"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> - <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> - </template> - <template slot="fileSlot" slot-scope="text"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> - <a-button - v-else - :ghost="true" - type="primary" - icon="download" - size="small" - @click="downloadFile(text)"> - 涓嬭浇 - </a-button> - </template> - - <span slot="action" slot-scope="text, record"> - <a @click="handleEdit(record)">缂栬緫</a> - - <a-divider type="vertical" /> - <a-dropdown> - <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> - <a-menu slot="overlay"> - <a-menu-item> - <a @click="handleDetail(record)">璇︽儏</a> - </a-menu-item> - <a-menu-item> - <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> - <a>鍒犻櫎</a> - </a-popconfirm> - </a-menu-item> - </a-menu> - </a-dropdown> - </span> - </a-table> </div> - - <lsw-material-outbound-modal ref="modalForm" @ok="modalFormOk"></lsw-material-outbound-modal> </a-card> </template> <script> - import '@/assets/less/TableExpand.less' - import { mixinDevice } from '@/utils/mixin' - import { JeecgListMixin } from '@/mixins/JeecgListMixin' - import LswMaterialOutboundModal from './modules/LswMaterialOutboundModal' +import '@/assets/less/TableExpand.less' +import { mixinDevice } from '@/utils/mixin' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' - export default { - name: 'LswMaterialOutboundList', - mixins:[JeecgListMixin, mixinDevice], - components: { - LswMaterialOutboundModal - }, - 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: 'materialNumber' - }, - { - title:'鐗╂枡鍚嶇О', - align:"center", - dataIndex: 'materialName' - }, - { - title:'浜х嚎', - align:"center", - dataIndex: 'factoryId_dictText' - }, - { - title:'鎵规鍙�', - align:"center", - dataIndex: 'batchNumber' - }, - { - title:'鍑哄簱浜�', - align:"center", - dataIndex: 'outboundStaff' - }, - { - title:'鍑哄簱鏃堕棿', - align:"center", - dataIndex: 'outboundTime' - }, - { - title:'鍑哄簱鏁伴噺', - align:"center", - dataIndex: 'quantity' - }, - { - title:'宸ュ崟', - align:"center", - dataIndex: 'workOrderId' - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align:"center", - fixed:"right", - width:147, - scopedSlots: { customRender: 'action' } +export default { + name: 'LswMaterialOutboundList', + mixins: [JeecgListMixin, mixinDevice], + components: {}, + data() { + return { + description: '鐗╂枡鍑哄簱鍗曠鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 } - ], - url: { - list: "/lswmaterialoutbound/lswMaterialOutbound/list", - delete: "/lswmaterialoutbound/lswMaterialOutbound/delete", - deleteBatch: "/lswmaterialoutbound/lswMaterialOutbound/deleteBatch", - exportXlsUrl: "/lswmaterialoutbound/lswMaterialOutbound/exportXls", - importExcelUrl: "lswmaterialoutbound/lswMaterialOutbound/importExcel", - }, - dictOptions:{}, - superFieldList:[], - } - }, - created() { - this.getSuperFieldList(); - }, - computed: { - importExcelUrl: function(){ - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; - }, - }, - methods: { - initDictConfig(){ - }, - getSuperFieldList(){ - let fieldList=[]; - fieldList.push({type:'int',value:'delFlag',text:'鍒犻櫎鏍囪',dictCode:''}) - fieldList.push({type:'string',value:'materialNumber',text:'鐗╂枡缂栫爜',dictCode:''}) - fieldList.push({type:'string',value:'materialName',text:'鐗╂枡鍚嶇О',dictCode:''}) - fieldList.push({type:'string',value:'factoryId',text:'浜х嚎ID',dictCode:''}) - fieldList.push({type:'string',value:'batchNumber',text:'鎵规鍙�',dictCode:''}) - fieldList.push({type:'string',value:'outboundStaff',text:'鍑哄簱浜�',dictCode:''}) - fieldList.push({type:'datetime',value:'outboundTime',text:'鍑哄簱鏃堕棿'}) - fieldList.push({type:'string',value:'quantity',text:'鍑哄簱鏁伴噺',dictCode:''}) - fieldList.push({type:'string',value:'workOrderId',text:'宸ュ崟ID',dictCode:''}) - this.superFieldList = fieldList + { + title: '绾胯竟搴�', + align: 'center', + dataIndex: 'warehouseId_dictText' + }, + { + title: '鐗╂枡缂栫爜', + align: 'center', + dataIndex: 'materialNumber' + }, + { + title: '鐗╂枡鍚嶇О', + align: 'center', + dataIndex: 'materialName' + }, + { + title: '鎵规鍙�', + align: 'center', + dataIndex: 'batchNumber' + }, + { + title: '鍑哄簱绫诲瀷', + align: 'center', + dataIndex: 'outboundCategory_dictText' + }, + { + title: '鍑哄簱浜�', + align: 'center', + dataIndex: 'outboundStaff_dictText' + }, + { + title: '鍑哄簱鏃堕棿', + align: 'center', + dataIndex: 'outboundTime' + }, + { + title: '鍑哄簱鏁伴噺', + align: 'center', + dataIndex: 'quantity' + } + ], + url: { + list: '/lsw/materialOutbound/list' } } - } + }, + created() { + }, + computed: {}, + methods: {} +} </script> <style scoped> - @import '~@assets/less/common.less'; +@import '~@assets/less/common.less'; </style> \ No newline at end of file diff --git a/src/views/lsw/modules/LswMaterialInboundForm.vue b/src/views/lsw/modules/LswMaterialInboundForm.vue index eb3dc18..a20e449 100644 --- a/src/views/lsw/modules/LswMaterialInboundForm.vue +++ b/src/views/lsw/modules/LswMaterialInboundForm.vue @@ -3,40 +3,34 @@ <j-form-container :disabled="formDisabled"> <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> <a-row> - <a-form-model-item label="浜х嚎" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId"> - <a-row :gutter="24"> - <a-col :span="24"> - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="" - > - <j-select-factory - :disabled="disabled" - v-model="model.factoryId" - :multi="true" - @back="backFactoryInfo" - :backProduction="true" - :treeProductOpera="true" - ></j-select-factory> - </a-form-item> - </a-col> - </a-row> - </a-form-model-item> <a-col :span="12"> - <a-form-model-item label="搴撳瓨鍦�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseId"> - <j-search-select-tag v-model="model.warehouseId" placeholder="璇烽�夋嫨搴撳瓨鍦�" - dict="base_line_side_warehouse,warehouse_name,id"></j-search-select-tag> + <a-form-model-item label="鏉ユ簮缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originalCode" + v-if="model.inboundCategory !== 'MATERIAL_INNER_TRANSFER'"> + <a-input v-model="model.originalCode" placeholder="璇疯緭鍏ユ潵婧愮紪鐮�"></a-input> + </a-form-model-item> + <a-form-model-item label="鏉ユ簮绾胯竟搴�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originalCode" + v-else> + <j-search-select-tag v-model="model.originalCode" placeholder="璇烽�夋嫨绾胯竟搴�" + :dict-options="originalCodeDictOptions" + @change="originalCodeSelectChange"></j-search-select-tag> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鏉ユ簮鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originalName"> + <a-input v-model="model.originalName" placeholder="璇疯緭鍏ユ潵婧愬悕绉�"></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="绾胯竟搴�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseId"> + <j-search-select-tag v-model="model.warehouseId" placeholder="璇烽�夋嫨绾胯竟搴�" + :dict-options="warehouseDictOptions" + @change="warehouseSelectChange"></j-search-select-tag> </a-form-model-item> </a-col> <a-col :span="12"> <a-form-model-item label="鐗╂枡缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber"> - <a-input v-model="model.materialNumber" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�"></a-input> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item label="鐗╂枡鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName"> - <a-input v-model="model.materialName" placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"></a-input> + <j-search-select-tag :dict-options="materialDictOptions" v-model="model.materialNumber" + placeholder="璇烽�夋嫨鐗╂枡缂栫爜" @change="materialSelectChange"></j-search-select-tag> </a-form-model-item> </a-col> <a-col :span="12"> @@ -49,15 +43,21 @@ <a-input-number v-model="model.quantity" placeholder="璇疯緭鍏ュ叆搴撴暟閲�" style="width: 100%" /> </a-form-model-item> </a-col> + </a-row> + </a-form-model> + </j-form-container> + <j-form-container disabled> + <a-form-model ref="form1" :model="model" slot="detail"> + <a-row> <a-col :span="12"> - <a-form-model-item label="鎺ユ敹浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver"> - <j-select-user-by-dep v-model="model.receiver" placeholder="璇疯緭鍏ユ帴鏀朵汉"></j-select-user-by-dep> + <a-form-model-item label="鐗╂枡鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName"> + <a-input v-model="model.materialName"></a-input> </a-form-model-item> </a-col> <a-col :span="12"> - <a-form-model-item label="鎺ユ敹鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveTime"> - <j-date placeholder="璇烽�夋嫨鎺ユ敹鏃堕棿" v-model="model.receiveTime" :show-time="true" - date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> + <a-form-model-item label="鍏ュ簱绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inboundCategory"> + <j-search-select-tag v-model="model.inboundCategory" + dict="material_inbound_category"></j-search-select-tag> </a-form-model-item> </a-col> </a-row> @@ -68,22 +68,11 @@ <script> -import { httpAction, getAction } from '@/api/manage' -import { validateDuplicateValue } from '@/utils/util' -import JDate from '@/components/jeecg/JDate' -import pick from 'lodash.pick' -import moment from 'moment' -import { duplicateCheck } from '@/api/api'//閲嶅鏍¢獙 -import JTreeDict from '@/components/jeecg/JTreeDict'//鍒嗙被瀛楀吀鏍戝舰涓嬫媺缁勪欢 -import JSelectFactory from '../../../../src/components/jeecgbiz/JSelectFactory.vue' +import { getAction, httpAction } from '@/api/manage' export default { name: 'LswMaterialInboundForm', - components: { - JDate, - JTreeDict, - JSelectFactory - }, + components: {}, props: { //琛ㄥ崟绂佺敤 disabled: { @@ -104,12 +93,17 @@ sm: { span: 16 } }, confirmLoading: false, + warehouseDictOptions: [], + materialDictOptions: [], validatorRules: { - factoryId: [ - { required: true, message: '浜х嚎鏄繀閫夐」', trigger: 'change' } + originalCode: [ + { required: true, message: '鏉ユ簮缂栫爜鏄繀閫夐」', trigger: 'change' } + ], + originalName: [ + { required: true, message: '鏉ユ簮鍚嶇О鏄繀閫夐」', trigger: 'change' } ], warehouseId: [ - { required: true, message: '搴撳瓨鍦版槸蹇呴�夐」', trigger: 'change' } + { required: true, message: '绾胯竟搴撴槸蹇呴�夐」', trigger: 'change' } ], materialNumber: [ { required: true, message: '鐗╂枡缂栫爜鏄繀閫夐」', trigger: 'change' } @@ -122,24 +116,27 @@ ], quantity: [ { required: true, message: '鍏ュ簱鏁伴噺鏄繀閫夐」', trigger: 'change' } - ], - receiver: [ - { required: true, message: '鎺ユ敹浜烘槸蹇呴�夐」', trigger: 'change' } - ], - receiveTime: [ - { required: true, message: '鎺ユ敹鏃堕棿鏄繀閫夐」', trigger: 'change' } ] }, url: { - add: '/lswmaterialinbound/lswMaterialInbound/add', - edit: '/lswmaterialinbound/lswMaterialInbound/edit', - queryById: '/lswmaterialinbound/lswMaterialInbound/queryById' + add: '/lsw/materialInbound/add', + edit: '/lsw/materialInbound/edit', + queryById: '/lsw/materialInbound/queryById', + queryByProductionType: '/base/lineSideWarehouse/queryByProductionType', + queryByMaterialCategory: '/lsw/lswMaterial/queryByMaterialCategory' } } }, computed: { formDisabled() { return this.disabled + }, + originalCodeDictOptions() { + return this.warehouseDictOptions.map(warehouse => ({ + ...warehouse, + value: warehouse.warehouseCode, + text: warehouse.warehouseName + '(' + warehouse.warehouseCode + ')' + })) } }, created() { @@ -147,14 +144,20 @@ this.modelDefault = JSON.parse(JSON.stringify(this.model)) }, methods: { - backFactoryInfo(info) { - this.model.factoryIds = this.model.factoryId - this.nextFactoryOptions = info.map((item, index, arr) => { - let c = { label: item.text, value: item.value + '' } - return c - }) - }, - add() { + add(inboundCategory) { + this.warehouseDictOptions = [] + this.materialDictOptions = [] + if (inboundCategory === 'HEAT_TREATMENT_INBOUND') { + this.loadWarehouseDictOptions('OUTERFLANGE,INNERFLANGE') + this.loadMaterialDictOptions('BLANK') + } else if (inboundCategory === 'SMALL_INNER_RING') { + this.loadWarehouseDictOptions('ASSEMBLE') + this.loadMaterialDictOptions('SMALL_INNER_RING') + } else if (inboundCategory === 'MATERIAL_INNER_TRANSFER') { + this.loadWarehouseDictOptions('ASSEMBLE,OUTERFLANGE,INNERFLANG,HEATTREATMENT') + this.loadMaterialDictOptions('OUTER_FLANGE,INNER_FLANGE,STEEL_BALL,BLANK,COMPONENTS') + } + this.modelDefault.inboundCategory = inboundCategory this.edit(this.modelDefault) }, edit(record) { @@ -189,6 +192,54 @@ } }) + }, + loadWarehouseDictOptions(productionType) { + let params = { productionType: productionType } + getAction(this.url.queryByProductionType, params).then(res => { + if (res.success) { + this.warehouseDictOptions = res.result.map(warehouse => ({ + ...warehouse, + value: warehouse.id, + text: warehouse.warehouseName + '(' + warehouse.warehouseCode + ')' + })) + } + }) + }, + loadMaterialDictOptions(materialCategory) { + let params = { materialCategory: materialCategory } + getAction(this.url.queryByMaterialCategory, params).then(res => { + if (res.success) { + this.materialDictOptions = res.result.map(material => ({ + ...material, + value: material.materialNumber, + text: material.materialNumber + '(' + material.materialName + ')' + })) + } + }) + }, + warehouseSelectChange(value) { + let warehouse = this.warehouseDictOptions.find(option => option.value === value) + if (warehouse) { + this.model.factoryId = warehouse.factoryId + } else { + this.model.factoryId = undefined + } + }, + materialSelectChange(value) { + let material = this.materialDictOptions.find(option => option.value === value) + if (material) { + this.model.materialName = material.materialName + } else { + this.model.materialName = undefined + } + }, + originalCodeSelectChange(value) { + let warehouse = this.originalCodeDictOptions.find(option => option.value === value) + if (warehouse) { + this.model.originalName = warehouse.warehouseName + } else { + this.model.originalName = undefined + } } } } diff --git a/src/views/lsw/modules/LswMaterialInboundModal.vue b/src/views/lsw/modules/LswMaterialInboundModal.vue index 45eb4f4..348d409 100644 --- a/src/views/lsw/modules/LswMaterialInboundModal.vue +++ b/src/views/lsw/modules/LswMaterialInboundModal.vue @@ -29,10 +29,10 @@ } }, methods: { - add () { + add (inboundCategory) { this.visible=true this.$nextTick(()=>{ - this.$refs.realForm.add(); + this.$refs.realForm.add(inboundCategory); }) }, edit (record) { diff --git a/src/views/lsw/modules/LswMaterialOutboundForm.vue b/src/views/lsw/modules/LswMaterialOutboundForm.vue deleted file mode 100644 index d4f84b3..0000000 --- a/src/views/lsw/modules/LswMaterialOutboundForm.vue +++ /dev/null @@ -1,191 +0,0 @@ -<template> - <a-spin :spinning="confirmLoading"> - <j-form-container :disabled="formDisabled"> - <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> - <a-row> - <a-form-model-item label="浜х嚎" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId"> - <a-row :gutter="24"> - <a-col :span="24"> - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="" - > - <j-select-factory - :disabled="disabled" - v-model="model.factoryId" - :multi="true" - @back="backFactoryInfo" - :backProduction="true" - :treeProductOpera="true" - ></j-select-factory> - </a-form-item> - </a-col> - </a-row> - </a-form-model-item> - <a-col :span="12"> - <a-form-model-item label="鐗╂枡缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber"> - <a-input v-model="model.materialNumber" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item label="鐗╂枡鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName"> - <a-input v-model="model.materialName" placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item label="鎵规鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchNumber"> - <a-input v-model="model.batchNumber" placeholder="璇疯緭鍏ユ壒娆″彿" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item label="鍑哄簱浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outboundStaff"> - <j-select-user-by-dep v-model="model.outboundStaff" placeholder="璇疯緭鍏ュ嚭搴撲汉" ></j-select-user-by-dep> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item label="鍑哄簱鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outboundTime"> - <j-date placeholder="璇烽�夋嫨鍑哄簱鏃堕棿" v-model="model.outboundTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item label="鍑哄簱鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity"> - <a-input-number v-model="model.quantity" placeholder="璇疯緭鍏ュ嚭搴撴暟閲�" ></a-input-number> - </a-form-model-item> - </a-col> - <a-col :span="12"> - <a-form-model-item label="宸ュ崟ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrderId"> - <a-input v-model="model.workOrderId" 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' - import JTreeDict from '@/components/jeecg/JTreeDict'//鍒嗙被瀛楀吀鏍戝舰涓嬫媺缁勪欢 - import JSelectFactory from '../../../../src/components/jeecgbiz/JSelectFactory.vue' - import JDate from '@/components/jeecg/JDate' - - export default { - name: 'LswMaterialOutboundForm', - components: { - JDate, - JTreeDict, - JSelectFactory - }, - 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: { - factoryId: [ - { required: true, message: '浜х嚎鏄繀閫夐」', trigger: 'change' } - ], - materialNumber: [ - { required: true, message: '鐗╂枡缂栫爜鏄繀閫夐」', trigger: 'change' } - ], - materialName: [ - { required: true, message: '鐗╂枡鍚嶇О鏄繀閫夐」', trigger: 'change' } - ], - batchNumber: [ - { required: true, message: '鎵规鍙锋槸蹇呴�夐」', trigger: 'change' } - ], - quantity: [ - { required: true, message: '鍑哄簱鏁伴噺鏄繀閫夐」', trigger: 'change' } - ], - outboundStaff: [ - { required: true, message: '鍑哄簱浜烘槸蹇呴�夐」', trigger: 'change' } - ], - outboundTime: [ - { required: true, message: '鍑哄簱鏃堕棿鏄繀閫夐」', trigger: 'change' } - ], - workOrderId:[ - { required: true, message: '宸ュ崟鏄繀閫夐」', trigger: 'change' } - ], - }, - url: { - add: "/lswmaterialoutbound/lswMaterialOutbound/add", - edit: "/lswmaterialoutbound/lswMaterialOutbound/edit", - queryById: "/lswmaterialoutbound/lswMaterialOutbound/queryById" - } - } - }, - computed: { - formDisabled(){ - return this.disabled - }, - }, - created () { - //澶囦唤model鍘熷鍊� - this.modelDefault = JSON.parse(JSON.stringify(this.model)); - }, - methods: { - backFactoryInfo(info) { - this.model.factoryIds = this.model.factoryId - this.nextFactoryOptions = info.map((item, index, arr) => { - let c = { label: item.text, value: item.value + '' } - return c - }) - }, - add () { - 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/lsw/modules/LswMaterialOutboundModal.vue b/src/views/lsw/modules/LswMaterialOutboundModal.vue deleted file mode 100644 index a5203a2..0000000 --- a/src/views/lsw/modules/LswMaterialOutboundModal.vue +++ /dev/null @@ -1,60 +0,0 @@ -<template> - <j-modal - :title="title" - :width="width" - :visible="visible" - switchFullscreen - @ok="handleOk" - :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" - @cancel="handleCancel" - cancelText="鍏抽棴"> - <lsw-material-outbound-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></lsw-material-outbound-form> - </j-modal> -</template> - -<script> - - import LswMaterialOutboundForm from './LswMaterialOutboundForm' - export default { - name: 'LswMaterialOutboundModal', - components: { - LswMaterialOutboundForm - }, - data () { - return { - title:'', - width:896, - 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/user/Login.vue b/src/views/user/Login.vue index e7d4f86..844b4a0 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -6,7 +6,7 @@ <div class="header"> <a href="/"> <img src="~@/assets/lxzn.png" class="logo" alt="logo"> - <span class="title">MDC鏅烘収杞﹂棿</span> + <span class="title">鍙屾灄杞存壙鏅烘収杞﹂棿</span> </a> </div> </div> @@ -62,10 +62,6 @@ >纭畾 </a-button> </a-form-item> - - <a-form-model-item style="color: red;font-size: 0.8vw"> - 瀵嗙骇锛氬唴閮� 璀﹀憡锛氭湰绯荤粺绂佹瀛樺偍銆佸鐞嗐�佷紶杈撴秹瀵嗕俊鎭� - </a-form-model-item> </a-form-model> </div> -- Gitblit v1.9.3