diff --git a/jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue b/jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue
index 17ca1aa5..7d066649 100644
--- a/jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue
+++ b/jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue
@@ -107,14 +107,14 @@
{dataIndex: 'standard', title: '规格', width: 80},
{dataIndex: 'model', title: '型号', width: 80},
{dataIndex: 'color', title: '颜色', width: 80},
- {dataIndex: 'unit', title: '单位', width: 60},
+ {dataIndex: 'unit', title: '单位', width: 70, ellipsis:true},
{dataIndex: 'sku', title: '多属性', width: 80},
{dataIndex: 'stock', title: '库存', width: 60},
{dataIndex: 'expand', title: '扩展信息', width: 80},
{dataIndex: 'enableSerialNumber', title: '序列号', width: 60, align: "center",
scopedSlots: { customRender: 'customRenderEnableSerialNumber' }
},
- {dataIndex: 'enableBatchNumber', title: '批号', width: 60, align: "center",
+ {dataIndex: 'enableBatchNumber', title: '批号', width: 50, align: "center",
scopedSlots: { customRender: 'customRenderEnableBatchNumber' }
}
],
diff --git a/jshERP-web/src/views/material/MaterialList.vue b/jshERP-web/src/views/material/MaterialList.vue
index fa26b088..53b9b155 100644
--- a/jshERP-web/src/views/material/MaterialList.vue
+++ b/jshERP-web/src/views/material/MaterialList.vue
@@ -95,10 +95,6 @@
删除
-
- {{text?text:record.unitName}}
- SKU
-
启用
禁用
@@ -165,8 +161,17 @@
{title: '颜色', dataIndex: 'color', width: '4%'},
{title: '类别', dataIndex: 'categoryName', width: '6%'},
{title: '扩展信息', dataIndex: 'materialOther', width: '6%'},
- {title: '单位', dataIndex: 'unit', width: '6%',
- scopedSlots: { customRender: 'customRenderUnit' }
+ {title: '单位', dataIndex: 'unit', width: '6%', ellipsis:true,
+ customRender:function (t,r,index) {
+ if (r) {
+ let name = t?t:r.unitName
+ if(r.sku) {
+ return name + '[SKU]';
+ } else {
+ return name;
+ }
+ }
+ }
},
{title: '保质期', dataIndex: 'expiryNum', width: '4%'},
{title: '库存', dataIndex: 'stock', width: '5%'},
diff --git a/jshERP-web/src/views/material/modules/MaterialModal.vue b/jshERP-web/src/views/material/modules/MaterialModal.vue
index 9517070d..2912f69a 100644
--- a/jshERP-web/src/views/material/modules/MaterialModal.vue
+++ b/jshERP-web/src/views/material/modules/MaterialModal.vue
@@ -590,30 +590,36 @@
return;
} else {
//进一步校验单位
- let manyUnitselected = ''
+ let basicUnit = '', otherUnit = '', otherUnitTwo = '', otherUnitThree = ''
if(formData.unitId) {
- for(let i=0; i {
@@ -968,11 +1003,26 @@
basicWholesaleDecimal = mInfo.wholesaleDecimal
basicLowDecimal = mInfo.lowDecimal
} else {
+ //副单位进行换算
mInfo.commodityUnit = otherUnit
if(basicPurchaseDecimal) { mInfo.purchaseDecimal = basicPurchaseDecimal*ratio}
if(basicCommodityDecimal) { mInfo.commodityDecimal = basicCommodityDecimal*ratio}
if(basicWholesaleDecimal) { mInfo.wholesaleDecimal = basicWholesaleDecimal*ratio}
if(basicLowDecimal) { mInfo.lowDecimal = basicLowDecimal*ratio}
+ if(otherUnitTwo && i===2) {
+ mInfo.commodityUnit = otherUnitTwo
+ if(basicPurchaseDecimal) { mInfo.purchaseDecimal = basicPurchaseDecimal*ratioTwo}
+ if(basicCommodityDecimal) { mInfo.commodityDecimal = basicCommodityDecimal*ratioTwo}
+ if(basicWholesaleDecimal) { mInfo.wholesaleDecimal = basicWholesaleDecimal*ratioTwo}
+ if(basicLowDecimal) { mInfo.lowDecimal = basicLowDecimal*ratioTwo}
+ }
+ if(otherUnitThree && i===3) {
+ mInfo.commodityUnit = otherUnitThree
+ if(basicPurchaseDecimal) { mInfo.purchaseDecimal = basicPurchaseDecimal*ratioThree}
+ if(basicCommodityDecimal) { mInfo.commodityDecimal = basicCommodityDecimal*ratioThree}
+ if(basicWholesaleDecimal) { mInfo.wholesaleDecimal = basicWholesaleDecimal*ratioThree}
+ if(basicLowDecimal) { mInfo.lowDecimal = basicLowDecimal*ratioThree}
+ }
}
}
this.meTable.dataSource = mArr
diff --git a/jshERP-web/src/views/system/UnitList.vue b/jshERP-web/src/views/system/UnitList.vue
index 3b02b221..0acc7ace 100644
--- a/jshERP-web/src/views/system/UnitList.vue
+++ b/jshERP-web/src/views/system/UnitList.vue
@@ -98,10 +98,33 @@
return parseInt(index)+1;
}
},
- { title: '计量单位', align:"center", dataIndex: 'name', width:100 },
+ { title: '计量单位', align:"center", dataIndex: 'name', width:150 },
{ title: '基本单位', align:"center", dataIndex: 'basicUnit', width:100 },
- { title: '副单位', align:"center", dataIndex: 'otherUnit', width:100 },
- { title: '比例', align:"center", dataIndex: 'ratio', width:100 },
+ { title: '副单位', align:"center", dataIndex: 'otherUnit', width:100,
+ customRender:function (t,r,index) {
+ if (r) {
+ return r.otherUnit + '=' + r.ratio + r.basicUnit;
+ }
+ }
+ },
+ { title: '副单位2', align:"center", dataIndex: 'otherUnitTwo', width:100,
+ customRender:function (t,r,index) {
+ if (r) {
+ if(r.otherUnitTwo) {
+ return r.otherUnitTwo + '=' + r.ratioTwo + r.basicUnit;
+ }
+ }
+ }
+ },
+ { title: '副单位3', align:"center", dataIndex: 'otherUnitThree', width:100,
+ customRender:function (t,r,index) {
+ if (r) {
+ if(r.otherUnitThree) {
+ return r.otherUnitThree + '=' + r.ratioThree + r.basicUnit;
+ }
+ }
+ }
+ },
{
title: '操作',
dataIndex: 'action',
diff --git a/jshERP-web/src/views/system/modules/UnitModal.vue b/jshERP-web/src/views/system/modules/UnitModal.vue
index 0850dcf3..c1948256 100644
--- a/jshERP-web/src/views/system/modules/UnitModal.vue
+++ b/jshERP-web/src/views/system/modules/UnitModal.vue
@@ -1,14 +1,14 @@
+ style="top:25%; height:50%; overflow-y:hidden">
关闭
@@ -22,12 +22,23 @@
-
+
+ =
+
-
-
+
+
+ =
+
+
+
+
+
+
+ =
+
@@ -85,7 +96,7 @@
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
- this.form.setFieldsValue(pick(this.model,'basicUnit','otherUnit','ratio'))
+ this.form.setFieldsValue(pick(this.model,'basicUnit','otherUnit','ratio','otherUnitTwo','ratioTwo','otherUnitThree','ratioThree'))
autoJumpNextInput('unitModal')
});
},
@@ -100,27 +111,57 @@
if (!err) {
that.confirmLoading = true;
let formData = Object.assign(this.model, values);
+ if(!formData.otherUnit) {
+ that.$message.warning('抱歉,副单位不能为空!');
+ that.confirmLoading = false;
+ return;
+ }
+ if(!formData.ratio) {
+ that.$message.warning('抱歉,此时比例不能为空!');
+ that.confirmLoading = false;
+ return;
+ }
+ if(formData.otherUnitTwo && !formData.ratioTwo) {
+ that.$message.warning('抱歉,此时比例2不能为空!');
+ that.confirmLoading = false;
+ return;
+ }
+ if(formData.otherUnitThree && !formData.ratioThree) {
+ that.$message.warning('抱歉,此时比例3不能为空!');
+ that.confirmLoading = false;
+ return;
+ }
if(formData.basicUnit === formData.otherUnit) {
that.$message.warning('抱歉,基本单位与副单位不能相同!');
that.confirmLoading = false;
- } else {
- let obj;
- if(!this.model.id){
- obj=addUnit(formData);
- }else{
- obj=editUnit(formData);
- }
- obj.then((res)=>{
- if(res.code === 200){
- that.$emit('ok');
- }else{
- that.$message.warning(res.data.message);
- }
- }).finally(() => {
- that.confirmLoading = false;
- that.close();
- })
+ return;
}
+ if(formData.basicUnit === formData.otherUnitTwo) {
+ that.$message.warning('抱歉,基本单位与副单位2不能相同!');
+ that.confirmLoading = false;
+ return;
+ }
+ if(formData.basicUnit === formData.otherUnitThree) {
+ that.$message.warning('抱歉,基本单位与副单位3不能相同!');
+ that.confirmLoading = false;
+ return;
+ }
+ let obj;
+ if(!this.model.id){
+ obj=addUnit(formData);
+ }else{
+ obj=editUnit(formData);
+ }
+ obj.then((res)=>{
+ if(res.code === 200){
+ that.$emit('ok');
+ }else{
+ that.$message.warning(res.data.message);
+ }
+ }).finally(() => {
+ that.confirmLoading = false;
+ that.close();
+ })
}
})
},