diff --git a/jshERP-web/src/api/api.js b/jshERP-web/src/api/api.js
index 39fd38e50..9a1eb1d56 100644
--- a/jshERP-web/src/api/api.js
+++ b/jshERP-web/src/api/api.js
@@ -46,7 +46,7 @@ const addDepot = (params)=>postAction("/depot/add",params);
const editDepot = (params)=>putAction("/depot/update",params);
const checkDepot = (params)=>getAction("/depot/checkIsNameExist",params);
//商品属性
-const editMaterialProperty = (params)=>putAction("/materialProperty/update",params);
+const addOrUpdateMaterialProperty = (params)=>postAction("/materialProperty/addOrUpdate",params);
//商品类型
const queryMaterialCategoryTreeList = (params)=>getAction("/materialCategory/getMaterialCategoryTree",params);
const queryMaterialCategoryById = (params)=>getAction("/materialCategory/findById",params);
@@ -149,7 +149,7 @@ export {
addDepot,
editDepot,
checkDepot,
- editMaterialProperty,
+ addOrUpdateMaterialProperty,
queryMaterialCategoryTreeList,
queryMaterialCategoryById,
checkMaterialCategory,
diff --git a/jshERP-web/src/mixins/JeecgListMixin.js b/jshERP-web/src/mixins/JeecgListMixin.js
index c253d9bc7..1518bdfee 100644
--- a/jshERP-web/src/mixins/JeecgListMixin.js
+++ b/jshERP-web/src/mixins/JeecgListMixin.js
@@ -149,7 +149,6 @@ export const JeecgListMixin = {
});
return str;
},
-
onSelectChange(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
diff --git a/jshERP-web/src/utils/util.js b/jshERP-web/src/utils/util.js
index 391440ae4..2d192b1c0 100644
--- a/jshERP-web/src/utils/util.js
+++ b/jshERP-web/src/utils/util.js
@@ -418,14 +418,12 @@ export function replaceAll(text, checker, replacer) {
*/
export function getMpListShort(thisRows, checker, replacer) {
let mPropertyListShort = ''
- let nativeNameStr = ''
+ let anotherNameStr = ''
for (let i = 0; i < thisRows.length; i++) {
- if (thisRows[i].enabled) {
- nativeNameStr += thisRows[i].nativeName + ",";
- }
+ anotherNameStr += thisRows[i].anotherName + ",";
}
- if (nativeNameStr) {
- mPropertyListShort = nativeNameStr.substring(0, nativeNameStr.length - 1);
+ if (anotherNameStr) {
+ mPropertyListShort = anotherNameStr.substring(0, anotherNameStr.length - 1);
}
return mPropertyListShort
}
diff --git a/jshERP-web/src/views/material/MaterialList.vue b/jshERP-web/src/views/material/MaterialList.vue
index e3e2c6635..dd73cafd4 100644
--- a/jshERP-web/src/views/material/MaterialList.vue
+++ b/jshERP-web/src/views/material/MaterialList.vue
@@ -59,17 +59,17 @@
-
+
-
+
-
+
@@ -260,6 +260,11 @@
span: 18,
offset: 1
},
+ queryTitle: {
+ mp1: '扩展1',
+ mp2: '扩展2',
+ mp3: '扩展3'
+ },
// 查询条件
queryParam: {
categoryId: undefined,
@@ -289,7 +294,7 @@
// 实际列
columns:[],
// 默认索引
- defDataIndex:['action','mBarCode','name','standard','model','color','categoryName','materialOther','unit', 'stock',
+ defDataIndex:['action','mBarCode','name','standard','model','color','categoryName','unit', 'stock',
'purchaseDecimal','commodityDecimal','wholesaleDecimal','lowDecimal','enabled'],
// 默认列
defColumns: [
@@ -358,7 +363,8 @@
created() {
this.model = Object.assign({}, {});
this.initColumnsSetting()
- this.loadTreeData();
+ this.loadTreeData()
+ this.handleChangeOtherField()
},
computed: {
importExcelUrl: function () {
@@ -391,6 +397,29 @@
Vue.ls.remove('materialColumns')
this.initColumnsSetting()
},
+ //动态替换扩展字段
+ handleChangeOtherField() {
+ let mpStr = getMpListShort(Vue.ls.get('materialPropertyList'))
+ if(mpStr) {
+ let mpArr = mpStr.split(',')
+ if(mpArr.length ===3) {
+ this.queryTitle.mp1 = mpArr[0]
+ this.queryTitle.mp2 = mpArr[1]
+ this.queryTitle.mp3 = mpArr[2]
+ for (let i = 0; i < this.defColumns.length; i++) {
+ if(this.defColumns[i].dataIndex === 'otherField1') {
+ this.defColumns[i].title = mpArr[0]
+ }
+ if(this.defColumns[i].dataIndex === 'otherField2') {
+ this.defColumns[i].title = mpArr[1]
+ }
+ if(this.defColumns[i].dataIndex === 'otherField3') {
+ this.defColumns[i].title = mpArr[2]
+ }
+ }
+ }
+ }
+ },
loadTreeData(){
let that = this;
let params = {};
diff --git a/jshERP-web/src/views/material/MaterialPropertyList.vue b/jshERP-web/src/views/material/MaterialPropertyList.vue
index 5ec3053f8..fe5ae9673 100644
--- a/jshERP-web/src/views/material/MaterialPropertyList.vue
+++ b/jshERP-web/src/views/material/MaterialPropertyList.vue
@@ -3,25 +3,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 查询
- 重置
-
-
-
-
-
@@ -55,6 +31,8 @@
import MaterialPropertyModal from './modules/MaterialPropertyModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate'
+ import { getAction } from '@/api/manage'
+ import Vue from 'vue'
export default {
name: "MaterialPropertyList",
mixins:[JeecgListMixin],
@@ -88,16 +66,11 @@
{
title: '操作',
dataIndex: 'action',
- width: 200,
+ width: 100,
align:"center",
scopedSlots: { customRender: 'action' },
},
{title: '名称', dataIndex: 'nativeName', width: 100},
- {
- title: '是否启用', dataIndex: 'enabled', width: 100, align: "center",
- scopedSlots: { customRender: 'customRenderFlag' }
- },
- {title: '排序', dataIndex: 'sort', width: 100},
{title: '别名', dataIndex: 'anotherName', width: 100}
],
url: {
@@ -111,7 +84,23 @@
},
methods: {
-
+ loadData(arg) {
+ let params = this.getQueryParams() //查询条件
+ this.loading = true
+ getAction(this.url.list, params).then((res) => {
+ if (res.code===200) {
+ this.dataSource = res.data.rows
+ this.ipagination.total = res.data.total
+ Vue.ls.set('materialPropertyList', res.data.rows, 7 * 24 * 60 * 60 * 1000);
+ } else if(res.code===510){
+ this.$message.warning(res.data)
+ } else {
+ this.$message.warning(res.data.message)
+ }
+ this.loading = false
+ this.onClearSelected()
+ })
+ },
}
}
diff --git a/jshERP-web/src/views/material/modules/MaterialModal.vue b/jshERP-web/src/views/material/modules/MaterialModal.vue
index 0b7836f95..70bea17ab 100644
--- a/jshERP-web/src/views/material/modules/MaterialModal.vue
+++ b/jshERP-web/src/views/material/modules/MaterialModal.vue
@@ -118,17 +118,17 @@
-
+
-
+
-
+
@@ -1107,21 +1107,14 @@
loadParseMaterialProperty() {
let mpList = Vue.ls.get('materialPropertyList')
for (let i = 0; i < mpList.length; i++) {
- if (mpList[i].nativeName === "制造商") {
- this.mpShort.mfrs.name = mpList[i].anotherName
- this.mpShort.mfrs.enabled = mpList[i].enabled
- }
if (mpList[i].nativeName === "扩展1") {
this.mpShort.otherField1.name = mpList[i].anotherName
- this.mpShort.otherField1.enabled = mpList[i].enabled
}
if (mpList[i].nativeName === "扩展2") {
this.mpShort.otherField2.name = mpList[i].anotherName
- this.mpShort.otherField2.enabled = mpList[i].enabled
}
if (mpList[i].nativeName === "扩展3") {
this.mpShort.otherField3.name = mpList[i].anotherName
- this.mpShort.otherField3.enabled = mpList[i].enabled
}
}
},
diff --git a/jshERP-web/src/views/material/modules/MaterialPropertyModal.vue b/jshERP-web/src/views/material/modules/MaterialPropertyModal.vue
index 87a3cf52d..bb52b792c 100644
--- a/jshERP-web/src/views/material/modules/MaterialPropertyModal.vue
+++ b/jshERP-web/src/views/material/modules/MaterialPropertyModal.vue
@@ -17,13 +17,7 @@
-
-
-
-
-
-
-
+ {{model.nativeName}}
@@ -36,7 +30,7 @@