iWare_RawMaterialWarehouse_Web/src/api/modular/main/WmsBase/BaseCustomerManage.js
@@ -1,7 +1,7 @@ import { axios } from '@/utils/request' /** * 查询客户档案 * 查询往来关系 * * @author ly */ @@ -14,7 +14,7 @@ } /** * 客户档案列表 * 往来关系列表 * * @author ly */ @@ -27,7 +27,7 @@ } /** * 添加客户档案 * 添加往来关系 * * @author ly */ @@ -40,7 +40,7 @@ } /** * 编辑客户档案 * 编辑往来关系 * * @author ly */ @@ -53,7 +53,7 @@ } /** * 删除客户档案 * 删除往来关系 * * @author ly */ @@ -67,7 +67,7 @@ /** * 导出客户档案的Excel文件 * 导出往来关系的Excel文件 * * @author ly */ @@ -81,7 +81,7 @@ } /** * 导入客户档案的Excel文件 * 导入往来关系的Excel文件 * * @author ly */ @@ -97,7 +97,7 @@ /** * 下载客户档案的Excel导入模板 * 下载往来关系的Excel导入模板 * * @author ly */ iWare_RawMaterialWarehouse_Web/src/views/main/SalesStockReturnOrder/editForm.vue
@@ -33,8 +33,8 @@ <a-form-item label="退货方" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入退货方" v-decorator="['returnGoods']" /> </a-form-item> <a-form-item label="客户编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户编号" v-decorator="['returnGoodsOrderNo']" /> <a-form-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入编号" v-decorator="['returnGoodsOrderNo']" /> </a-form-item> <a-form-item label="销售单据" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入销售单据" v-decorator="['saleOrderNo']" /> iWare_RawMaterialWarehouse_Web/src/views/main/SalesStockReturnOrder/index.vue
@@ -118,7 +118,7 @@ dataIndex: 'returnGoods' }, { title: '客户编号', title: '编号', align: 'center', dataIndex: 'returnGoodsOrderNo' }, iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/BaseCustomer/addForm.vue
@@ -1,6 +1,6 @@ <template> <a-modal title="新增客户档案" title="新增往来关系" :width="1100" :visible="visible" :confirmLoading="confirmLoading" @@ -8,11 +8,11 @@ @cancel="handleCancel"> <a-spin :spinning="confirmLoading"> <a-form :form="form"> <a-form-item label="客户中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户中文名称" v-decorator="['custChinaName', {rules: [{required: true, message: '请输入客户中文名称!'}]}]" /> <a-form-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入中文名称" v-decorator="['custChinaName', {rules: [{required: true, message: '请输入中文名称!'}]}]" /> </a-form-item> <a-form-item label="客户英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户英文名称" v-decorator="['custEnglishName']" /> <a-form-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入英文名称" v-decorator="['custEnglishName']" /> </a-form-item> <a-form-item label="助记码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入助记码" v-decorator="['mnemonicCode']" /> iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/BaseCustomer/editForm.vue
@@ -1,6 +1,6 @@ <template> <a-modal title="编辑客户档案" title="编辑往来关系" :width="1100" :visible="visible" :confirmLoading="confirmLoading" @@ -8,11 +8,11 @@ @cancel="handleCancel"> <a-spin :spinning="confirmLoading"> <a-form :form="form"> <a-form-item label="客户中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户中文名称" v-decorator="['custChinaName', {rules: [{required: true, message: '请输入客户中文名称!'}]}]" /> <a-form-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入中文名称" v-decorator="['custChinaName', {rules: [{required: true, message: '请输入中文名称!'}]}]" /> </a-form-item> <a-form-item label="客户英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户英文名称" v-decorator="['custEnglishName']" /> <a-form-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入英文名称" v-decorator="['custEnglishName']" /> </a-form-item> <a-form-item label="助记码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入助记码" v-decorator="['mnemonicCode']" /> iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/BaseCustomer/index.vue
@@ -7,18 +7,18 @@ <a-form layout="inline"> <a-row :gutter="48"> <a-col :md="8" :sm="24"> <a-form-item label="客户编号"> <a-input v-model="queryParam.custCode" allow-clear placeholder="请输入客户编号"/> <a-form-item label="编号"> <a-input v-model="queryParam.custCode" allow-clear placeholder="请输入编号"/> </a-form-item> </a-col> <a-col :md="8" :sm="24"> <a-form-item label="客户中文名称"> <a-input v-model="queryParam.custChinaName" allow-clear placeholder="请输入客户中文名称"/> <a-form-item label="中文名称"> <a-input v-model="queryParam.custChinaName" allow-clear placeholder="请输入中文名称"/> </a-form-item> </a-col><template v-if="advanced"> <a-col :md="8" :sm="24"> <a-form-item label="客户英文名称"> <a-input v-model="queryParam.custEnglishName" allow-clear placeholder="请输入客户英文名称"/> <a-form-item label="英文名称"> <a-input v-model="queryParam.custEnglishName" allow-clear placeholder="请输入英文名称"/> </a-form-item> </a-col> <a-col :md="8" :sm="24"> @@ -139,7 +139,7 @@ <a-button type="info" v-if="hasPerm('BaseCustomer:exportExcel')" icon="download" @click="BaseCustomerToExcel()"> 导出 </a-button> <a-button type="primary" v-if="hasPerm('BaseCustomer:add')" icon="plus" @click="$refs.addForm.add()">新增客户档案</a-button> <a-button type="primary" v-if="hasPerm('BaseCustomer:add')" icon="plus" @click="$refs.addForm.add()">新增往来关系</a-button> </div> </template> <span slot="custTypescopedSlots" slot-scope="text"> @@ -204,7 +204,7 @@ customRender: (text, record, index) => `${index + 1 + (this.pageInfo.current - 1) * this.pageInfo.pageSize}` }, { title: '客户编号', title: '编号', align: 'center', customHeaderCell: () => { return { @@ -224,7 +224,7 @@ dataIndex: 'custCode' }, { title: '客户中文名称', title: '中文名称', align: 'center', customHeaderCell: () => { return { @@ -244,7 +244,7 @@ dataIndex: 'custChinaName' }, { title: '客户英文名称', title: '英文名称', align: 'center', customHeaderCell: () => { return { iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsArea/addForm.vue
@@ -10,10 +10,10 @@ <!-- <a-form-item label="仓库编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入仓库编号" v-decorator="['warehouseCode', {rules: [{required: true, message: '请输入仓库编号!'}]}]" /> </a-form-item> --> <a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <!-- <a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入仓库名称" v-decorator="['warehouseName', { rules: [{ required: true, message: '请输入仓库名称!' }] }]" /> </a-form-item> </a-form-item> --> <a-form-item label="库区名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入库区名称" v-decorator="['areaName', { rules: [{ required: true, message: '请输入库区名称!' }] }]" /> iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsArea/editForm.vue
@@ -10,10 +10,10 @@ <!-- <a-form-item label="仓库编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入仓库编号" v-decorator="['warehouseCode', {rules: [{required: true, message: '请输入仓库编号!'}]}]" /> </a-form-item> --> <a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <!-- <a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入仓库名称" v-decorator="['warehouseName', { rules: [{ required: true, message: '请输入仓库名称!' }] }]" /> </a-form-item> </a-form-item> --> <a-form-item label="库区名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入库区名称" v-decorator="['areaName', { rules: [{ required: true, message: '请输入库区名称!' }] }]" /> iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsArea/index.vue
@@ -15,12 +15,13 @@ <a-form-item label="仓库编号"> <a-input v-model="queryParam.warehouseCode" allow-clear placeholder="请输入仓库编号"/> </a-form-item> </a-col><template v-if="advanced"> <a-col :md="8" :sm="24"> </a-col> <template v-if="advanced"> <!-- <a-col :md="8" :sm="24"> <a-form-item label="仓库名称"> <a-input v-model="queryParam.warehouseName" allow-clear placeholder="请输入仓库名称"/> </a-form-item> </a-col> </a-col> --> <a-col :md="8" :sm="24"> <a-form-item label="库区名称"> <a-input v-model="queryParam.areaName" allow-clear placeholder="请输入库区名称"/> iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsControlRuleDetail/addForm.vue
@@ -8,8 +8,8 @@ @cancel="handleCancel"> <a-spin :spinning="confirmLoading"> <a-form :form="form"> <a-form-item label="控制属性规则编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入控制属性规则编号" v-decorator="['ruleCode', {rules: [{required: true, message: '请输入控制属性规则编号!'}]}]" /> <a-form-item label="控制属性规则名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入控制属性规则名称" v-decorator="['ruleName', {rules: [{required: true, message: '请输入控制属性规则名称!'}]}]" /> </a-form-item> <a-form-item label="最高库存" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入最高库存" v-decorator="['maxImumqty']" /> iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsControlRuleDetail/editForm.vue
@@ -8,8 +8,8 @@ @cancel="handleCancel"> <a-spin :spinning="confirmLoading"> <a-form :form="form"> <a-form-item label="控制属性规则编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入控制属性规则编号" v-decorator="['ruleCode', {rules: [{required: true, message: '请输入控制属性规则编号!'}]}]" /> <a-form-item label="控制属性规则名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入控制属性规则名称" v-decorator="['ruleName', {rules: [{required: true, message: '请输入控制属性规则名称!'}]}]" /> </a-form-item> <a-form-item label="最高库存" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入最高库存" v-decorator="['maxImumqty']" /> @@ -78,7 +78,7 @@ this.form.setFieldsValue( { id: record.id, ruleCode: record.ruleCode, ruleName: record.ruleName, maxImumqty: record.maxImumqty, minImumqty: record.minImumqty, safeImumqty: record.safeImumqty, iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsControlRuleDetail/index.vue
@@ -12,10 +12,15 @@ </a-form-item> </a-col> <a-col :md="8" :sm="24"> <a-form-item label="最高库存"> <a-input v-model="queryParam.maxImumqty" allow-clear placeholder="请输入最高库存"/> <a-form-item label="控制属性规则名称"> <a-input v-model="queryParam.ruleName" allow-clear placeholder="请输入控制属性规则名称"/> </a-form-item> </a-col><template v-if="advanced"> <a-col :md="8" :sm="24"> <a-form-item label="最高库存"> <a-input v-model="queryParam.maxImumqty" allow-clear placeholder="请输入最高库存"/> </a-form-item> </a-col> <a-col :md="8" :sm="24"> <a-form-item label="最低库存"> <a-input v-model="queryParam.minImumqty" allow-clear placeholder="请输入最低库存"/> @@ -212,6 +217,26 @@ dataIndex: 'ruleCode' }, { title: '控制属性规则名称', align: 'center', customHeaderCell: () => { return { style: { 'min-width': '120px'//最小列宽设置 } } }, customCell: () => { return { style: { 'min-width': '120px'//最小列宽设置 } } }, sorter: true, dataIndex: 'ruleName' }, { title: '最高库存', align: 'center', customHeaderCell: () => { iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue
@@ -142,6 +142,8 @@ }, created() { this.materialTypeDataList() const materialTypeOption = this.$options this.materialTypeData2 = materialTypeOption.filters['dictData']('abc_class_type') }, data() { return { @@ -162,7 +164,8 @@ stationNameParameterData: [], visible: false, confirmLoading: false, form: this.$form.createForm(this) form: this.$form.createForm(this), materialTypeData2:[] } }, methods: { @@ -208,8 +211,7 @@ handleOk() { }, // 初始化方法 add(record) { const materialTypeOption = this.$options this.materialTypeData2 = materialTypeOption.filters['dictData']('abc_class') this.visible = true if (record) {//编辑 @@ -282,7 +284,7 @@ BaseCustomerList = this.$refs.addFormBaseCustomer.list } console.log(6666666666666 + '客户档案集合') console.log(6666666666666 + '往来关系集合') // console.log(6666666666666 + '包装关系') // console.log(this.$refs.addFormContainerPackagingRef.list) @@ -291,7 +293,7 @@ MaterialInput: values, ControlRuleld: ControlRuleld, //控制属性 SubstituteGoodList: SubstituteGoodList, //替代品 BaseCustomerList: BaseCustomerList, //客户档案集合 BaseCustomerList: BaseCustomerList, //往来关系集合 // ContainerPackagingList: this.$refs.addFormContainerPackagingRef.list //包装关系 } this.confirmLoading = true iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addFormBaseCustomer/addForm.vue
@@ -1,6 +1,6 @@ <template> <a-modal title="新增客户档案" title="新增往来关系" :width="900" :visible="visible" :confirmLoading="confirmLoading" @@ -8,14 +8,14 @@ @cancel="handleCancel"> <a-spin :spinning="confirmLoading"> <a-form :form="form"> <a-form-item label="客户编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户编号" v-decorator="['custCode', {rules: [{required: true, message: '请输入客户编号!'}]}]" /> <a-form-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入编号" v-decorator="['custCode', {rules: [{required: true, message: '请输入编号!'}]}]" /> </a-form-item> <a-form-item label="客户中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户中文名称" v-decorator="['custChinaName', {rules: [{required: true, message: '请输入客户中文名称!'}]}]" /> <a-form-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入中文名称" v-decorator="['custChinaName', {rules: [{required: true, message: '请输入中文名称!'}]}]" /> </a-form-item> <a-form-item label="客户英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户英文名称" v-decorator="['custEnglishName']" /> <a-form-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入英文名称" v-decorator="['custEnglishName']" /> </a-form-item> <a-form-item label="助记码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入助记码" v-decorator="['mnemonicCode']" /> iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addFormBaseCustomer/addFormBaseCustomer.vue
@@ -73,7 +73,7 @@ align: 'center' }, { title: '客户编号', title: '编号', align: 'center', customHeaderCell: () => { return { @@ -93,7 +93,7 @@ dataIndex: 'custCode' }, { title: '客户中文名称', title: '中文名称', align: 'center', customHeaderCell: () => { return { iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addFormBaseCustomer/editForm.vue
@@ -1,6 +1,6 @@ <template> <a-modal title="编辑客户档案" title="编辑往来关系" :width="900" :visible="visible" :confirmLoading="confirmLoading" @@ -8,14 +8,14 @@ @cancel="handleCancel"> <a-spin :spinning="confirmLoading"> <a-form :form="form"> <a-form-item label="客户编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户编号" v-decorator="['custCode', {rules: [{required: true, message: '请输入客户编号!'}]}]" /> <a-form-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入编号" v-decorator="['custCode', {rules: [{required: true, message: '请输入编号!'}]}]" /> </a-form-item> <a-form-item label="客户中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户中文名称" v-decorator="['custChinaName', {rules: [{required: true, message: '请输入客户中文名称!'}]}]" /> <a-form-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入中文名称" v-decorator="['custChinaName', {rules: [{required: true, message: '请输入中文名称!'}]}]" /> </a-form-item> <a-form-item label="客户英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户英文名称" v-decorator="['custEnglishName']" /> <a-form-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入英文名称" v-decorator="['custEnglishName']" /> </a-form-item> <a-form-item label="助记码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入助记码" v-decorator="['mnemonicCode']" /> iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addFormBaseCustomer/index.vue
@@ -7,18 +7,18 @@ <a-form layout="inline"> <a-row :gutter="48"> <a-col :md="8" :sm="24"> <a-form-item label="客户编号"> <a-input v-model="queryParam.custCode" allow-clear placeholder="请输入客户编号" /> <a-form-item label="编号"> <a-input v-model="queryParam.custCode" allow-clear placeholder="请输入编号" /> </a-form-item> </a-col> <a-col :md="8" :sm="24"> <a-form-item label="客户中文名称"> <a-input v-model="queryParam.custChinaName" allow-clear placeholder="请输入客户中文名称" /> <a-form-item label="中文名称"> <a-input v-model="queryParam.custChinaName" allow-clear placeholder="请输入中文名称" /> </a-form-item> </a-col><template v-if="advanced"> <a-col :md="8" :sm="24"> <a-form-item label="客户英文名称"> <a-input v-model="queryParam.custEnglishName" allow-clear placeholder="请输入客户英文名称" /> <a-form-item label="英文名称"> <a-input v-model="queryParam.custEnglishName" allow-clear placeholder="请输入英文名称" /> </a-form-item> </a-col> <a-col :md="8" :sm="24"> @@ -27,13 +27,11 @@ </a-form-item> </a-col><a-col :md="8" :sm="24"> <a-form-item label="类型"> <a-input-number v-model="queryParam.custType" style="width: 100%" allow-clear placeholder="请输入类型" /> </a-form-item> </a-col> <a-col :md="8" :sm="24"> <a-form-item label="类型名称"> <a-input v-model="queryParam.custTypeName" allow-clear placeholder="请输入类型名称" /> <a-select :allowClear="true" style="width: 100%" v-model="queryParam.custType" placeholder="请选择类型"> <a-select-option v-for="(item, index) in custTypeData" :key="index" :value="item.code">{{ item.name }}</a-select-option> </a-select> </a-form-item> </a-col> <a-col :md="8" :sm="24"> @@ -145,19 +143,22 @@ <a-button type="info" v-if="hasPerm('BaseCustomer:exportExcel')" icon="download" @click="BaseCustomerToExcel()"> 导出 </a-button> <a-button type="primary" v-if="hasPerm('BaseCustomer:add')" icon="plus" @click="$refs.addForm.add()">新增客户档案</a-button> <a-button type="primary" v-if="hasPerm('BaseCustomer:add')" icon="plus" @click="$refs.addForm.add()">新增往来关系</a-button> </div> --> </template> <span slot="isDisabledscopedSlots" slot-scope="text"> <div v-if="text === true"> <a-tag color="green">是</a-tag> </div> <div v-else-if="text == false"> <a-tag color="volcano">否</a-tag> </div> <div v-else=""></div> </span> <span slot="action" slot-scope="text, record"> <span slot="custTypescopedSlots" slot-scope="text"> {{ 'base_customer_type' | dictType(text) }} </span> <span slot="isDisabledscopedSlots" slot-scope="text"> <div v-if="text===true "> <a-tag color="green">是</a-tag> </div> <div v-else-if="text==false"> <a-tag color="volcano">否</a-tag> </div> <div v-else=""></div> </span> <!-- <span slot="action" slot-scope="text, record"> <a v-if="hasPerm('BaseCustomer:edit')" @click="$refs.editForm.edit(record)">编辑</a> <a-divider type="vertical" v-if="hasPerm('BaseCustomer:edit') & hasPerm('BaseCustomer:delete')" /> @@ -165,7 +166,7 @@ @confirm="() => BaseCustomerDelete(record)"> <a>删除</a> </a-popconfirm> </span> </span> --> </s-table> <add-form ref="addForm" @ok="handleOk" /> <edit-form ref="editForm" @ok="handleOk" /> @@ -208,7 +209,7 @@ customRender: (text, record, index) => `${index + 1 + (this.pageInfo.current - 1) * this.pageInfo.pageSize}` }, { title: '客户编号', title: '编号', align: 'center', customHeaderCell: () => { return { @@ -228,7 +229,7 @@ dataIndex: 'custCode' }, { title: '客户中文名称', title: '中文名称', align: 'center', customHeaderCell: () => { return { @@ -248,7 +249,7 @@ dataIndex: 'custChinaName' }, { title: '客户英文名称', title: '英文名称', align: 'center', customHeaderCell: () => { return { @@ -293,26 +294,6 @@ customHeaderCell: () => { return { style: { 'min-width': '80px'//最小列宽设置 } } }, customCell: () => { return { style: { 'min-width': '80px'//最小列宽设置 } } }, sorter: true, dataIndex: 'custType' }, { title: '类型名称', align: 'center', customHeaderCell: () => { return { style: { 'min-width': '120px'//最小列宽设置 } } @@ -325,7 +306,8 @@ } }, sorter: true, dataIndex: 'custTypeName' dataIndex: 'custType', scopedSlots: { customRender: 'custTypescopedSlots' } }, { title: '联系人', @@ -581,14 +563,14 @@ } }, created() { if (this.hasPerm('BaseCustomer:edit') || this.hasPerm('BaseCustomer:delete')) { this.columns.push({ title: '操作', width: '150px', dataIndex: 'action', scopedSlots: { customRender: 'action' } }) } // if (this.hasPerm('BaseCustomer:edit') || this.hasPerm('BaseCustomer:delete')) { // this.columns.push({ // title: '操作', // width: '150px', // dataIndex: 'action', // scopedSlots: { customRender: 'action' } // }) // } const path = this.$route.path const columnStr = window.localStorage.getItem(path) if (columnStr) { @@ -602,9 +584,11 @@ } }); } const custTypeOption = this.$options this.custTypeData = custTypeOption.filters['dictData']('base_customer_type') const isDisabledOption = this.$options this.isDisabledData = isDisabledOption.filters['dictData']('yes_true_false') this.handleTableHt() //设置主表表格高度 window.addEventListener( 'resize', @@ -707,8 +691,7 @@ } } </script> <style lang="less"> .table-operator { <style lang="less">.table-operator { margin-bottom: 18px; } iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterialCustomer/addForm.vue
@@ -20,14 +20,14 @@ <a-form-item label="客户ID" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户ID" v-decorator="['custId']" /> </a-form-item> <a-form-item label="客户编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户编号" v-decorator="['custCode']" /> <a-form-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入编号" v-decorator="['custCode']" /> </a-form-item> <a-form-item label="客户英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户英文名称" v-decorator="['custEnglishName']" /> <a-form-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入英文名称" v-decorator="['custEnglishName']" /> </a-form-item> <a-form-item label="客户中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户中文名称" v-decorator="['custChinaName']" /> <a-form-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入中文名称" v-decorator="['custChinaName']" /> </a-form-item> </a-form> </a-spin> iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterialCustomer/editForm.vue
@@ -20,14 +20,14 @@ <a-form-item label="客户ID" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户ID" v-decorator="['custId']" /> </a-form-item> <a-form-item label="客户编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户编号" v-decorator="['custCode']" /> <a-form-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入编号" v-decorator="['custCode']" /> </a-form-item> <a-form-item label="客户英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户英文名称" v-decorator="['custEnglishName']" /> <a-form-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入英文名称" v-decorator="['custEnglishName']" /> </a-form-item> <a-form-item label="客户中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入客户中文名称" v-decorator="['custChinaName']" /> <a-form-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="请输入中文名称" v-decorator="['custChinaName']" /> </a-form-item> <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> </a-form> iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterialCustomer/index.vue
@@ -27,18 +27,18 @@ </a-form-item> </a-col> <a-col :md="8" :sm="24"> <a-form-item label="客户编号"> <a-input v-model="queryParam.custCode" allow-clear placeholder="请输入客户编号"/> <a-form-item label="编号"> <a-input v-model="queryParam.custCode" allow-clear placeholder="请输入编号"/> </a-form-item> </a-col> <a-col :md="8" :sm="24"> <a-form-item label="客户英文名称"> <a-input v-model="queryParam.custEnglishName" allow-clear placeholder="请输入客户英文名称"/> <a-form-item label="英文名称"> <a-input v-model="queryParam.custEnglishName" allow-clear placeholder="请输入英文名称"/> </a-form-item> </a-col> <a-col :md="8" :sm="24"> <a-form-item label="客户中文名称"> <a-input v-model="queryParam.custChinaName" allow-clear placeholder="请输入客户中文名称"/> <a-form-item label="中文名称"> <a-input v-model="queryParam.custChinaName" allow-clear placeholder="请输入中文名称"/> </a-form-item> </a-col> <!--年月日时分秒--> <!--时间范围--> @@ -238,7 +238,7 @@ dataIndex: 'custId' }, { title: '客户编号', title: '编号', align: 'center', customHeaderCell: () => { return { @@ -258,7 +258,7 @@ dataIndex: 'custCode' }, { title: '客户英文名称', title: '英文名称', align: 'center', customHeaderCell: () => { return { @@ -278,7 +278,7 @@ dataIndex: 'custEnglishName' }, { title: '客户中文名称', title: '中文名称', align: 'center', customHeaderCell: () => { return { iWare_RawMaterialWarehouse_Wms/Admin.NET.Application/Service/WmsBase/WmsControlRuleDetail/WmsControlRuleDetailService.cs
@@ -22,23 +22,23 @@ [Route("api")] public class WmsControlRuleDetailService : IWmsControlRuleDetailService, IDynamicApiController, ITransient { private readonly IRepository<WmsControlRuleDetail,MasterDbContextLocator> _wmsControlRuleDetailRep; private readonly IRepository<WmsControlRuleDetail, MasterDbContextLocator> _wmsControlRuleDetailRep; private readonly IRepository<SysDictType, MasterDbContextLocator> _sysDictTypeRep; private readonly IRepository<SysDictData, MasterDbContextLocator> _sysDictDataRep; private readonly ISysExcelTemplateService _sysExcelTemplateService; private readonly static object _lock = new(); public WmsControlRuleDetailService( IRepository<WmsControlRuleDetail,MasterDbContextLocator> wmsControlRuleDetailRep ,IRepository<SysDictType, MasterDbContextLocator> sysDictTypeRep ,IRepository<SysDictData, MasterDbContextLocator> sysDictDataRep ,ISysExcelTemplateService sysExcelTemplateService IRepository<WmsControlRuleDetail, MasterDbContextLocator> wmsControlRuleDetailRep , IRepository<SysDictType, MasterDbContextLocator> sysDictTypeRep , IRepository<SysDictData, MasterDbContextLocator> sysDictDataRep , ISysExcelTemplateService sysExcelTemplateService ) { _wmsControlRuleDetailRep = wmsControlRuleDetailRep; _sysDictTypeRep = sysDictTypeRep; _sysDictDataRep = sysDictDataRep; _sysExcelTemplateService = sysExcelTemplateService; _sysDictTypeRep = sysDictTypeRep; _sysDictDataRep = sysDictDataRep; _sysExcelTemplateService = sysExcelTemplateService; } /// <summary> @@ -60,8 +60,8 @@ .Where(input.IsNotChek != null, u => u.IsNotChek == input.IsNotChek) .Where(input.ShelfLifeDays != null, u => u.ShelfLifeDays == input.ShelfLifeDays) .Where(input.IsDisabled != null, u => u.IsDisabled == input.IsDisabled) .Where(input.CreatedTime!=null, u => u.CreatedTime>= Convert.ToDateTime(input.CreatedTime[0]) && u.CreatedTime<= Convert.ToDateTime(input.CreatedTime[1])) .Where(input.UpdatedTime!=null, u => u.UpdatedTime>= Convert.ToDateTime(input.UpdatedTime[0]) && u.UpdatedTime<= Convert.ToDateTime(input.UpdatedTime[1])) .Where(input.CreatedTime != null, u => u.CreatedTime >= Convert.ToDateTime(input.CreatedTime[0]) && u.CreatedTime <= Convert.ToDateTime(input.CreatedTime[1])) .Where(input.UpdatedTime != null, u => u.UpdatedTime >= Convert.ToDateTime(input.UpdatedTime[0]) && u.UpdatedTime <= Convert.ToDateTime(input.UpdatedTime[1])) .Where(!string.IsNullOrEmpty(input.CreatedUserName), u => u.CreatedUserName == input.CreatedUserName) .Where(!string.IsNullOrEmpty(input.UpdatedUserName), u => u.UpdatedUserName == input.UpdatedUserName) .OrderBy(PageInputOrder.OrderBuilder<WmsControlRuleDetailSearch>(input)) @@ -103,8 +103,8 @@ .Where(pIsNotChek != null, u => u.IsNotChek == pIsNotChek) .Where(pShelfLifeDays != null, u => u.ShelfLifeDays == pShelfLifeDays) .Where(pIsDisabled != null, u => u.IsDisabled == pIsDisabled) .Where(input.CreatedTime!=null, u => u.CreatedTime>= Convert.ToDateTime(input.CreatedTime[0]) && u.CreatedTime<= Convert.ToDateTime(input.CreatedTime[1])) .Where(input.UpdatedTime!=null, u => u.UpdatedTime>= Convert.ToDateTime(input.UpdatedTime[0]) && u.UpdatedTime<= Convert.ToDateTime(input.UpdatedTime[1])) .Where(input.CreatedTime != null, u => u.CreatedTime >= Convert.ToDateTime(input.CreatedTime[0]) && u.CreatedTime <= Convert.ToDateTime(input.CreatedTime[1])) .Where(input.UpdatedTime != null, u => u.UpdatedTime >= Convert.ToDateTime(input.UpdatedTime[0]) && u.UpdatedTime <= Convert.ToDateTime(input.UpdatedTime[1])) .Where(!string.IsNullOrEmpty(pCreatedUserName), u => u.CreatedUserName == pCreatedUserName) .Where(!string.IsNullOrEmpty(pUpdatedUserName), u => u.UpdatedUserName == pUpdatedUserName) .OrderBy(PageInputOrder.OrderNonPageBuilder(input)) @@ -113,7 +113,7 @@ return wmsControlRuleDetails; } /// <summary> /// <summary> /// 获取控制属性规则明细 /// </summary> /// <param name="input"></param> @@ -133,7 +133,7 @@ public async Task<List<WmsControlRuleDetailOutput>> List([FromQuery] WmsControlRuleDetailInput input) { return await _wmsControlRuleDetailRep.DetachedEntities.ProjectToType<WmsControlRuleDetailOutput>().ToListAsync(); } } #region 增、删、改 @@ -147,7 +147,7 @@ { var wmsControlRuleDetail = input.Adapt<WmsControlRuleDetail>(); wmsControlRuleDetail.RuleCode = Yitter.IdGenerator.YitIdHelper.NextId().ToString();//TODO 要调用生成 编号的方法 先用雪花ID //验证 //验证 await CheckExisit(wmsControlRuleDetail); wmsControlRuleDetail.CreatedUserId = wmsControlRuleDetail.UpdatedUserId = SysHelper.GetUserId(); @@ -166,7 +166,7 @@ { var wmsControlRuleDetail = await _wmsControlRuleDetailRep.FirstOrDefaultAsync(u => u.Id == input.Id); await _wmsControlRuleDetailRep.DeleteAsync(wmsControlRuleDetail); } /// <summary> @@ -182,12 +182,12 @@ var wmsControlRuleDetail = input.Adapt<WmsControlRuleDetail>(); //验证 await CheckExisit(wmsControlRuleDetail,true); await CheckExisit(wmsControlRuleDetail, true); wmsControlRuleDetail.UpdatedUserId = SysHelper.GetUserId(); wmsControlRuleDetail.UpdatedUserName = SysHelper.GetUserName(); wmsControlRuleDetail.UpdatedTime = SysHelper.GetNowTime(); await _wmsControlRuleDetailRep.UpdateAsync(wmsControlRuleDetail,ignoreNullValues:true); await _wmsControlRuleDetailRep.UpdateAsync(wmsControlRuleDetail, ignoreNullValues: true); } #endregion @@ -201,17 +201,17 @@ /// <returns>导入的记录数</returns> [HttpPost("WmsControlRuleDetail/importExcel")] public async Task<int> ImportExcelAsync(IFormFile file) { { int _HeadStartLine = 2;//第1行是说明,第2行是列名 int _DataStartLine = 3;//第3行开始是数据 DataTable importDataTable = ExcelUtil.ImportExcelToDataTable(file, _HeadStartLine, _DataStartLine); var addList =await CommonImport(importDataTable, _DataStartLine); var addList = await CommonImport(importDataTable, _DataStartLine); lock (_lock) { _wmsControlRuleDetailRep.InsertAsync(addList); } await Task.CompletedTask; return addList.Count; @@ -232,176 +232,176 @@ { index++; //导入模版定制化代码(替换模版使用) var addItem = new WmsControlRuleDetail() { CreatedTime = SysHelper.GetNowTime(), CreatedUserId = SysHelper.GetUserId(), CreatedUserName = SysHelper.GetUserName(), UpdatedTime = SysHelper.GetNowTime(), UpdatedUserId = SysHelper.GetUserId(), UpdatedUserName = SysHelper.GetUserName() }; #region 定义变量 var _RuleName = "";//控制属性规则名称 var _MaxImumqty = "";//最高库存 var _MinImumqty = "";//最低库存 var _SafeImumqty = "";//安全库存 var _MinStorageAge = "";//最小库龄 var _MaxStorageAge = "";//最大库龄 var _IsNotChek = "";//是否免检 var _ShelfLifeDays = "";//保质期天数 var _IsDisabled = "";//是否禁用 #endregion #region 取值 _RuleName = row["控制属性规则名称"]?.ToString() ; _MaxImumqty = row["最高库存"]?.ToString() ; _MinImumqty = row["最低库存"]?.ToString() ; _SafeImumqty = row["安全库存"]?.ToString() ; _MinStorageAge = row["最小库龄"]?.ToString() ; _MaxStorageAge = row["最大库龄"]?.ToString() ; _IsNotChek = row["是否免检"]?.ToString() ; _ShelfLifeDays = row["保质期天数"]?.ToString() ; _IsDisabled = row["是否禁用"]?.ToString() ; //导入模版定制化代码(替换模版使用) var addItem = new WmsControlRuleDetail() { CreatedTime = SysHelper.GetNowTime(), CreatedUserId = SysHelper.GetUserId(), CreatedUserName = SysHelper.GetUserName(), UpdatedTime = SysHelper.GetNowTime(), UpdatedUserId = SysHelper.GetUserId(), UpdatedUserName = SysHelper.GetUserName() }; #region 定义变量 var _RuleName = "";//控制属性规则名称 var _MaxImumqty = "";//最高库存 var _MinImumqty = "";//最低库存 var _SafeImumqty = "";//安全库存 var _MinStorageAge = "";//最小库龄 var _MaxStorageAge = "";//最大库龄 var _IsNotChek = "";//是否免检 var _ShelfLifeDays = "";//保质期天数 var _IsDisabled = "";//是否禁用 #endregion #region 取值 _RuleName = row["控制属性规则名称"]?.ToString(); _MaxImumqty = row["最高库存"]?.ToString(); _MinImumqty = row["最低库存"]?.ToString(); _SafeImumqty = row["安全库存"]?.ToString(); _MinStorageAge = row["最小库龄"]?.ToString(); _MaxStorageAge = row["最大库龄"]?.ToString(); _IsNotChek = row["是否免检"]?.ToString(); _ShelfLifeDays = row["保质期天数"]?.ToString(); _IsDisabled = row["是否禁用"]?.ToString(); #endregion #region 验证 if (string.IsNullOrEmpty(_RuleName)) { throw Oops.Oh($"第{index}行[控制属性规则名称]{_RuleName}不能为空!"); } if(!string.IsNullOrEmpty(_RuleName)) { addItem.RuleName = (string)_RuleName; } if(!string.IsNullOrEmpty(_MaxImumqty)) { if (!decimal.TryParse(_MaxImumqty, out decimal outMaxImumqty)&&!string.IsNullOrEmpty(_MaxImumqty)) { throw Oops.Oh($"第{index}行[最高库存]{_MaxImumqty}值不正确!"); } if (outMaxImumqty <= 0&&!string.IsNullOrEmpty(_MaxImumqty)) { throw Oops.Oh($"第{index}行[最高库存]{_MaxImumqty}值不能小于等于0!"); } else { addItem.MaxImumqty = outMaxImumqty; } } if(!string.IsNullOrEmpty(_MinImumqty)) { if (!decimal.TryParse(_MinImumqty, out decimal outMinImumqty)&&!string.IsNullOrEmpty(_MinImumqty)) { throw Oops.Oh($"第{index}行[最低库存]{_MinImumqty}值不正确!"); } if (outMinImumqty <= 0&&!string.IsNullOrEmpty(_MinImumqty)) { throw Oops.Oh($"第{index}行[最低库存]{_MinImumqty}值不能小于等于0!"); } else { addItem.MinImumqty = outMinImumqty; } } if(!string.IsNullOrEmpty(_SafeImumqty)) { if (!decimal.TryParse(_SafeImumqty, out decimal outSafeImumqty)&&!string.IsNullOrEmpty(_SafeImumqty)) { throw Oops.Oh($"第{index}行[安全库存]{_SafeImumqty}值不正确!"); } if (outSafeImumqty <= 0&&!string.IsNullOrEmpty(_SafeImumqty)) { throw Oops.Oh($"第{index}行[安全库存]{_SafeImumqty}值不能小于等于0!"); } else { addItem.SafeImumqty = outSafeImumqty; } } if(!string.IsNullOrEmpty(_MinStorageAge)) { if (!decimal.TryParse(_MinStorageAge, out decimal outMinStorageAge)&&!string.IsNullOrEmpty(_MinStorageAge)) { throw Oops.Oh($"第{index}行[最小库龄]{_MinStorageAge}值不正确!"); } if (outMinStorageAge <= 0&&!string.IsNullOrEmpty(_MinStorageAge)) { throw Oops.Oh($"第{index}行[最小库龄]{_MinStorageAge}值不能小于等于0!"); } else { addItem.MinStorageAge = outMinStorageAge; } } if(!string.IsNullOrEmpty(_MaxStorageAge)) { if (!decimal.TryParse(_MaxStorageAge, out decimal outMaxStorageAge)&&!string.IsNullOrEmpty(_MaxStorageAge)) { throw Oops.Oh($"第{index}行[最大库龄]{_MaxStorageAge}值不正确!"); } if (outMaxStorageAge <= 0&&!string.IsNullOrEmpty(_MaxStorageAge)) { throw Oops.Oh($"第{index}行[最大库龄]{_MaxStorageAge}值不能小于等于0!"); } else { addItem.MaxStorageAge = outMaxStorageAge; } } if(!string.IsNullOrEmpty(_IsNotChek)) { if(!_IsNotChek.Equals("是") && !_IsNotChek.Equals("否")) { throw Oops.Oh($"第{index}行[是否免检]{_IsNotChek}值不正确!"); } else { bool outIsNotChek = _IsNotChek.Equals("是") ? true : false; addItem.IsNotChek = outIsNotChek; } } if(!string.IsNullOrEmpty(_ShelfLifeDays)) { if (!decimal.TryParse(_ShelfLifeDays, out decimal outShelfLifeDays)&&!string.IsNullOrEmpty(_ShelfLifeDays)) { throw Oops.Oh($"第{index}行[保质期天数]{_ShelfLifeDays}值不正确!"); } if (outShelfLifeDays <= 0&&!string.IsNullOrEmpty(_ShelfLifeDays)) { throw Oops.Oh($"第{index}行[保质期天数]{_ShelfLifeDays}值不能小于等于0!"); } else { addItem.ShelfLifeDays = outShelfLifeDays; } } if(!string.IsNullOrEmpty(_IsDisabled)) { if(!_IsDisabled.Equals("是") && !_IsDisabled.Equals("否")) { throw Oops.Oh($"第{index}行[是否禁用]{_IsDisabled}值不正确!"); } else { bool outIsDisabled = _IsDisabled.Equals("是") ? true : false; addItem.IsDisabled = outIsDisabled; } } { throw Oops.Oh($"第{index}行[控制属性规则名称]{_RuleName}不能为空!"); } if (!string.IsNullOrEmpty(_RuleName)) { addItem.RuleName = (string)_RuleName; } if (!string.IsNullOrEmpty(_MaxImumqty)) { if (!decimal.TryParse(_MaxImumqty, out decimal outMaxImumqty) && !string.IsNullOrEmpty(_MaxImumqty)) { throw Oops.Oh($"第{index}行[最高库存]{_MaxImumqty}值不正确!"); } if (outMaxImumqty <= 0 && !string.IsNullOrEmpty(_MaxImumqty)) { throw Oops.Oh($"第{index}行[最高库存]{_MaxImumqty}值不能小于等于0!"); } else { addItem.MaxImumqty = outMaxImumqty; } } if (!string.IsNullOrEmpty(_MinImumqty)) { if (!decimal.TryParse(_MinImumqty, out decimal outMinImumqty) && !string.IsNullOrEmpty(_MinImumqty)) { throw Oops.Oh($"第{index}行[最低库存]{_MinImumqty}值不正确!"); } if (outMinImumqty <= 0 && !string.IsNullOrEmpty(_MinImumqty)) { throw Oops.Oh($"第{index}行[最低库存]{_MinImumqty}值不能小于等于0!"); } else { addItem.MinImumqty = outMinImumqty; } } if (!string.IsNullOrEmpty(_SafeImumqty)) { if (!decimal.TryParse(_SafeImumqty, out decimal outSafeImumqty) && !string.IsNullOrEmpty(_SafeImumqty)) { throw Oops.Oh($"第{index}行[安全库存]{_SafeImumqty}值不正确!"); } if (outSafeImumqty <= 0 && !string.IsNullOrEmpty(_SafeImumqty)) { throw Oops.Oh($"第{index}行[安全库存]{_SafeImumqty}值不能小于等于0!"); } else { addItem.SafeImumqty = outSafeImumqty; } } if (!string.IsNullOrEmpty(_MinStorageAge)) { if (!decimal.TryParse(_MinStorageAge, out decimal outMinStorageAge) && !string.IsNullOrEmpty(_MinStorageAge)) { throw Oops.Oh($"第{index}行[最小库龄]{_MinStorageAge}值不正确!"); } if (outMinStorageAge <= 0 && !string.IsNullOrEmpty(_MinStorageAge)) { throw Oops.Oh($"第{index}行[最小库龄]{_MinStorageAge}值不能小于等于0!"); } else { addItem.MinStorageAge = outMinStorageAge; } } if (!string.IsNullOrEmpty(_MaxStorageAge)) { if (!decimal.TryParse(_MaxStorageAge, out decimal outMaxStorageAge) && !string.IsNullOrEmpty(_MaxStorageAge)) { throw Oops.Oh($"第{index}行[最大库龄]{_MaxStorageAge}值不正确!"); } if (outMaxStorageAge <= 0 && !string.IsNullOrEmpty(_MaxStorageAge)) { throw Oops.Oh($"第{index}行[最大库龄]{_MaxStorageAge}值不能小于等于0!"); } else { addItem.MaxStorageAge = outMaxStorageAge; } } if (!string.IsNullOrEmpty(_IsNotChek)) { if (!_IsNotChek.Equals("是") && !_IsNotChek.Equals("否")) { throw Oops.Oh($"第{index}行[是否免检]{_IsNotChek}值不正确!"); } else { bool outIsNotChek = _IsNotChek.Equals("是") ? true : false; addItem.IsNotChek = outIsNotChek; } } if (!string.IsNullOrEmpty(_ShelfLifeDays)) { if (!decimal.TryParse(_ShelfLifeDays, out decimal outShelfLifeDays) && !string.IsNullOrEmpty(_ShelfLifeDays)) { throw Oops.Oh($"第{index}行[保质期天数]{_ShelfLifeDays}值不正确!"); } if (outShelfLifeDays <= 0 && !string.IsNullOrEmpty(_ShelfLifeDays)) { throw Oops.Oh($"第{index}行[保质期天数]{_ShelfLifeDays}值不能小于等于0!"); } else { addItem.ShelfLifeDays = outShelfLifeDays; } } if (!string.IsNullOrEmpty(_IsDisabled)) { if (!_IsDisabled.Equals("是") && !_IsDisabled.Equals("否")) { throw Oops.Oh($"第{index}行[是否禁用]{_IsDisabled}值不正确!"); } else { bool outIsDisabled = _IsDisabled.Equals("是") ? true : false; addItem.IsDisabled = outIsDisabled; } } #endregion @@ -410,9 +410,9 @@ addItem.RuleCode = Yitter.IdGenerator.YitIdHelper.NextId().ToString();//TODO 要调用生成 编号的方法 先用雪花ID details.Add(addItem); } //验重 await CheckExisitForImport(details); //验重 await CheckExisitForImport(details); return details; } @@ -439,78 +439,80 @@ /// <param name="input"></param> /// <param name="isEdit"></param> /// <returns></returns> private async Task CheckExisit( WmsControlRuleDetail input,bool isEdit=false) private async Task CheckExisit(WmsControlRuleDetail input, bool isEdit = false) { bool isExist = false; if (!isEdit)//新增 { //数据是否存在重复 isExist = await _wmsControlRuleDetailRep.AnyAsync(u => u.RuleName.Equals(input.RuleName) ,false); } else//编辑 { //当前编辑数据以外是否存在重复 isExist = await _wmsControlRuleDetailRep.AnyAsync(u => u.Id != input.Id &&u.RuleName.Equals(input.RuleName) ,false); } bool isExist = false; if (!isEdit)//新增 { //数据是否存在重复 isExist = await _wmsControlRuleDetailRep.AnyAsync(u => u.RuleName.Equals(input.RuleName) , false); } else//编辑 { //当前编辑数据以外是否存在重复 isExist = await _wmsControlRuleDetailRep.AnyAsync(u => u.Id != input.Id && u.RuleName.Equals(input.RuleName) , false); } if (isExist) throw Oops.Oh(ErrorCode.E0001); } } /// <summary> /// 根据联合主键验证数据是否已存在-导入时验证 /// </summary> /// <param name="inputs"></param> /// <returns></returns> private async Task CheckExisitForImport(List<WmsControlRuleDetail> inputs) { { //根据联合主键验证表格中中是否已存在相同数据 if (inputs?.Count <= 0) { throw Oops.Oh($"导入数据不能为空"); } //数据是否重复 var existExcelItem = inputs.GroupBy(g => new { g.RuleName }) .Where(g => g.Count() > 1) .Select(s => new { s.Key.RuleName }).FirstOrDefault(); if (existExcelItem != null) { var item= existExcelItem.Adapt<WmsControlRuleDetail>(); throw Oops.Oh($"导入的表格中,控制属性规则名称[{item.RuleName}]已存在"); } if (inputs?.Count <= 0) { throw Oops.Oh($"导入数据不能为空"); } //数据是否重复 var existExcelItem = inputs.GroupBy(g => new { g.RuleName }) .Where(g => g.Count() > 1) .Select(s => new { s.Key.RuleName }).FirstOrDefault(); if (existExcelItem != null) { var item = existExcelItem.Adapt<WmsControlRuleDetail>(); throw Oops.Oh($"导入的表格中,控制属性规则名称[{item.RuleName}]已存在"); } //根据联合主键验证数据库中是否已存在相同数据 var existDBItem = await _wmsControlRuleDetailRep.DetachedEntities.FirstOrDefaultAsync(w=> inputs.Select(s=>"" +s.RuleName ) .Contains("" +w.RuleName )); if (existDBItem != null) { var item= existDBItem.Adapt<WmsControlRuleDetail>(); throw Oops.Oh($"系统中,控制属性规则名称[{item.RuleName}]已存在"); } //根据联合主键验证数据库中是否已存在相同数据 var existDBItem = await _wmsControlRuleDetailRep.DetachedEntities.FirstOrDefaultAsync(w => inputs.Select(s => "" + s.RuleName ) .Contains("" + w.RuleName )); if (existDBItem != null) { var item = existDBItem.Adapt<WmsControlRuleDetail>(); throw Oops.Oh($"系统中,控制属性规则名称[{item.RuleName}]已存在"); } } #endregion iWare_RawMaterialWarehouse_Wms/Admin.NET.Application/Service/WmsBase/WmsMaterial/Dto/WmsMaterialInput.cs
@@ -458,4 +458,5 @@ public List<BaseCustomerInput> BaseCustomerList { get; set; } } } iWare_RawMaterialWarehouse_Wms/Admin.NET.Application/Service/WmsBase/WmsMaterial/Dto/WmsMaterialOutput.cs
@@ -139,4 +139,31 @@ public string UpdatedUserName { get; set; } } /// <summary> /// 物料业务信息实体出参--包含物料、物料客户关系、控制属性、替代品 /// </summary> public class WmsMaterialInfoOutput { /// <summary> /// 物料基础信息 /// </summary> public WmsMaterialOutput MaterialInfo { get; set; } /// <summary> /// 控制属性规则 /// </summary> public List<WmsControlRuleDetailOutput> ControlRuleDetailList { get; set; } /// <summary> /// 替代品 /// </summary> public List<WmsSubstituteGoodOutput> SubstituteGoodList { get; set; } /// <summary> /// 往来关系 /// </summary> public List<BaseCustomerOutput> BaseCustomerList { get; set; } } } iWare_RawMaterialWarehouse_Wms/Admin.NET.Application/Service/WmsBase/WmsMaterial/IWmsMaterialService.cs
@@ -8,7 +8,7 @@ { public interface IWmsMaterialService { Task<WmsMaterialOutput> Get([FromQuery] QueryeWmsMaterialInput input); Task<WmsMaterialInfoOutput> Get([FromQuery] QueryeWmsMaterialInput input); Task<List<WmsMaterialOutput>> List([FromQuery] WmsMaterialInput input); Task<PageResult<WmsMaterialOutput>> Page([FromQuery] WmsMaterialSearch input); Task<List<WmsMaterialOutput>> ListNonPageAsync([FromQuery] WmsMaterialSearchNonPage input); iWare_RawMaterialWarehouse_Wms/Admin.NET.Application/Service/WmsBase/WmsMaterial/WmsMaterialService.cs
@@ -28,14 +28,18 @@ private readonly ISysExcelTemplateService _sysExcelTemplateService; private readonly static object _lock = new(); private readonly IRepository<WmsMaterialCustomer, MasterDbContextLocator> _wmsMaterialCustomerRep; private readonly IRepository<BaseCustomer, MasterDbContextLocator> _baseCustomerRep; private readonly IRepository<WmsSubstituteGood, MasterDbContextLocator> _wmsSubstituteGoodRep; private readonly IRepository<WmsControlRuleDetail, MasterDbContextLocator> _wmsControlRuleDetailRep; public WmsMaterialService( IRepository<WmsMaterial,MasterDbContextLocator> wmsMaterialRep ,IRepository<SysDictType, MasterDbContextLocator> sysDictTypeRep ,IRepository<SysDictData, MasterDbContextLocator> sysDictDataRep ,ISysExcelTemplateService sysExcelTemplateService , IRepository<WmsMaterialCustomer, MasterDbContextLocator> wmsMaterialCustomerRep , IRepository<BaseCustomer, MasterDbContextLocator> baseCustomerRep , IRepository<WmsSubstituteGood, MasterDbContextLocator> wmsSubstituteGoodRep , IRepository<WmsControlRuleDetail, MasterDbContextLocator> wmsControlRuleDetailRep ) { _wmsMaterialRep = wmsMaterialRep; @@ -43,7 +47,9 @@ _sysDictDataRep = sysDictDataRep; _sysExcelTemplateService = sysExcelTemplateService; _wmsMaterialCustomerRep = wmsMaterialCustomerRep; _baseCustomerRep = baseCustomerRep; _wmsSubstituteGoodRep = wmsSubstituteGoodRep; _wmsControlRuleDetailRep = wmsControlRuleDetailRep; } /// <summary> /// 分页查询物料信息 @@ -156,9 +162,39 @@ /// <param name="input"></param> /// <returns></returns> [HttpGet("WmsMaterial/detail")] public async Task<WmsMaterialOutput> Get([FromQuery] QueryeWmsMaterialInput input) public async Task<WmsMaterialInfoOutput> Get([FromQuery] QueryeWmsMaterialInput input) { return (await _wmsMaterialRep.DetachedEntities.FirstOrDefaultAsync(u => u.Id == input.Id)).Adapt<WmsMaterialOutput>(); WmsMaterialInfoOutput resultInfo = new WmsMaterialInfoOutput(); //获取物料信息 var wmsMaterialInfo =(await _wmsMaterialRep.DetachedEntities.FirstOrDefaultAsync(u => u.Id == input.Id)).Adapt<WmsMaterialOutput>(); //获取替换物料信息 var wmsSubstituteGoods = await _wmsSubstituteGoodRep.DetachedEntities .Where(u => u.MaterialCode == wmsMaterialInfo.MaterialName) .Where(u => u.IsDeleted == false) .Where(u => u.IsDisabled == false) .OrderBy(o => o.CreatedTime) .ProjectToType<WmsSubstituteGoodOutput>() .ToListAsync(); //获取控制属性规则 var wmsControlRuleDetails = await _wmsControlRuleDetailRep.DetachedEntities .Where(u => u.Id == wmsMaterialInfo.ControlRuleId) .Where(u => u.IsDeleted == false) .Where(u => u.IsDisabled == false) .OrderBy(o=>o.CreatedTime) .ProjectToType<WmsControlRuleDetailOutput>() .ToListAsync(); //根据物料客户关联表获取往来信息 var baseCustomers = await _baseCustomerRep.DetachedEntities.Join(_wmsMaterialCustomerRep.DetachedEntities, bc => bc.Id, mc => mc.CustId, (bc, mc) => new { bc, mc }) .Where(p =>p.mc.MaterialId== wmsMaterialInfo.Id) .OrderBy(o => o.mc.CreatedTime) .ProjectToType<BaseCustomerOutput>() .ToListAsync(); resultInfo.MaterialInfo = wmsMaterialInfo; resultInfo.SubstituteGoodList = wmsSubstituteGoods; resultInfo.ControlRuleDetailList = wmsControlRuleDetails; return resultInfo; } /// <summary> @@ -220,6 +256,10 @@ //替代品信息 var substituteGoodList = input.SubstituteGoodList.Adapt<List<WmsSubstituteGood>>(); foreach (var item in substituteGoodList) { item.SubstituteCode = Yitter.IdGenerator.YitIdHelper.NextId().ToString();//TODO 要调用生成 编号的方法 先用雪花ID } wmsMaterial.UpdatedUserId = SysHelper.GetUserId(); wmsMaterial.UpdatedUserName = SysHelper.GetUserName(); @@ -314,6 +354,10 @@ //替代品信息 var substituteGoodList = input.SubstituteGoodList.Adapt<List<WmsSubstituteGood>>(); foreach (var item in substituteGoodList) { item.SubstituteCode = Yitter.IdGenerator.YitIdHelper.NextId().ToString();//TODO 要调用生成 编号的方法 先用雪花ID } if (materialCustomerList?.Count > 0) { iWare_RawMaterialWarehouse_Wms/Admin.NET.Core/Entity/WmsBase/WmsControlRuleDetail.cs
@@ -84,7 +84,7 @@ /// </summary> [Comment("是否免检")] public bool IsNotChek { get; set; } public bool? IsNotChek { get; set; } /// <summary>