|
|
@@ -54,11 +54,11 @@ Page({
|
|
|
code: 'supplierIds', formMode: 'index', idKey: 'roleId', chooseType: true, name: 'supplierNames',
|
|
|
title: mixins.$t('supplier'), type: 'choose', required: true, dropType: 'supplier', required: true,
|
|
|
},
|
|
|
- { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ { code: 'remarks', type: 'textarea', title: mixins.$t('remarks'), required: false }
|
|
|
],
|
|
|
sideKey: 0,
|
|
|
pageFlag: false,
|
|
|
- navigateBackFlag:true,
|
|
|
+ navigateBackFlag: true,
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -100,7 +100,6 @@ Page({
|
|
|
} else {
|
|
|
this.excute(goodService, goodService.getGoods, { brandId: item.brandId }).then(res => {
|
|
|
if (res.data.code == Constants.SUCESS_CODE) {
|
|
|
- console.log('ree', res.data);
|
|
|
if (res.data && res.data.data && res.data.data.length > 0) {
|
|
|
//提示信息
|
|
|
Dialog.confirm({
|
|
|
@@ -152,24 +151,24 @@ Page({
|
|
|
let data = e.detail.form
|
|
|
this.setData({
|
|
|
formData: JSON.stringify(data)
|
|
|
- })
|
|
|
+ })
|
|
|
//执行保存编辑操作
|
|
|
this.save({})
|
|
|
},
|
|
|
|
|
|
- /**
|
|
|
- * @desc : 保存数据服务--校验
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 王英杰
|
|
|
- */
|
|
|
+ /**
|
|
|
+ * @desc : 保存数据服务--校验
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 王英杰
|
|
|
+ */
|
|
|
validData() {
|
|
|
- let formData = JSON.parse(this.data.formData)
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
// //商品种类
|
|
|
- if (this.data.formDataName == mixins.$t('goodsCategorySys')
|
|
|
- && formData.catId == formData.parentId){
|
|
|
- util.showToast('父级不能和该种类相同');
|
|
|
- this.selectComponent('#popup').setLoading(false);
|
|
|
- return false
|
|
|
+ if (this.data.formDataName == mixins.$t('goodsCategorySys')
|
|
|
+ && formData.catId != null && formData.catId == formData.parentId) {
|
|
|
+ util.showToast('父级不能和该种类相同');
|
|
|
+ this.selectComponent('#popup').setLoading(false);
|
|
|
+ return false
|
|
|
}
|
|
|
return true
|
|
|
},
|
|
|
@@ -182,7 +181,6 @@ Page({
|
|
|
onSwipeBind(e) {
|
|
|
let swipeFlag = true
|
|
|
let item = e.detail.currentTarget.dataset.item
|
|
|
- console.log(e)
|
|
|
// return
|
|
|
let flgValidList = []
|
|
|
if (item && item.children && item.children.length > 0) {
|
|
|
@@ -190,7 +188,6 @@ Page({
|
|
|
return res.flgValid == true
|
|
|
})
|
|
|
}
|
|
|
- console.log('flgValidList', flgValidList, item.children)
|
|
|
if (!item.children || (flgValidList.length == (item.children && item.children.length)) || flgValidList.length == 0) {
|
|
|
this.handleMoreDataIsValid(this.data.goodsCategoryService, item, 'catId')
|
|
|
|
|
|
@@ -233,26 +230,23 @@ Page({
|
|
|
return this.excute(service, service.update, params);
|
|
|
} else { //新建 TODO
|
|
|
return this.excute(service, service.insert, params).then(result => {
|
|
|
- console.log('insert_result', result);
|
|
|
if (result && result.data && result.data.code === Constants.SUCESS_CODE) {
|
|
|
wx.showToast({
|
|
|
title: '保存成功',
|
|
|
image: '/static/image/success.png',
|
|
|
duration: 2000
|
|
|
})
|
|
|
- // console.log('dataItem', this.data.dataItem)
|
|
|
this.setData({
|
|
|
dataItem: null
|
|
|
})
|
|
|
// 商品种类
|
|
|
if (this.data.formDataName == mixins.$t('goodsCategorySys')) {
|
|
|
- console.log('dddttt', this.data.dataItem);
|
|
|
}
|
|
|
//清除组件数据
|
|
|
this.selectComponent('#popup').setFormNull()
|
|
|
// 执行查询方法
|
|
|
this.searchData()
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.selectComponent('#popup').setLoading(false);
|
|
|
}
|
|
|
});;
|
|
|
@@ -263,9 +257,9 @@ Page({
|
|
|
* @author : 刘尧
|
|
|
* @date : 2022/5/28 17:28
|
|
|
*/
|
|
|
- handleData(){
|
|
|
+ handleData() {
|
|
|
this.setData({
|
|
|
- showPop:false
|
|
|
+ showPop: false
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
@@ -314,7 +308,7 @@ Page({
|
|
|
toAdd() {
|
|
|
this.setPopContent();
|
|
|
this.setData({
|
|
|
- dataItem: JSON.stringify({decimalPlaces: 0}),
|
|
|
+ dataItem: JSON.stringify({ decimalPlaces: 0 }),
|
|
|
formData: null,
|
|
|
showPop: true,
|
|
|
})
|
|
|
@@ -407,7 +401,7 @@ Page({
|
|
|
{ code: 'brandCode', type: 'str', title: mixins.$t('brandCode'), required: false, readonly: true, },
|
|
|
{ code: 'brandName', type: 'str', title: mixins.$t('brandName'), required: true },
|
|
|
// { code: 'shortName', type: 'str', title: mixins.$t('abbreviation'), required: false },
|
|
|
- { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ { code: 'remarks', type: 'textarea', title: mixins.$t('remarks'), required: false }
|
|
|
]
|
|
|
} else {
|
|
|
popContent =
|
|
|
@@ -417,7 +411,7 @@ Page({
|
|
|
// { code: 'shortName', type: 'str', title: mixins.$t('abbreviation'), required: false },
|
|
|
{ code: 'supplierIds', name: 'supplierNames', title: 'supplier', type: 'choose', required: true, dropType: 'supplier', required: true, urlKey: 'selectProductAttributeSuppliers', code: 'supplierIds', formMode: 'index', idKey: 'roleId', title: mixins.$t('supplier') },
|
|
|
|
|
|
- { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ { code: 'remarks', type: 'textarea', title: mixins.$t('remarks'), required: false }
|
|
|
]
|
|
|
}
|
|
|
|
|
|
@@ -437,7 +431,7 @@ Page({
|
|
|
{ code: 'brandName', type: 'str', title: mixins.$t('brandName'), required: true },
|
|
|
// { code: 'shortName', type: 'str', title: mixins.$t('abbreviation'), required: false },
|
|
|
{ code: 'supplierIds', name: 'supplierNames', title: 'supplier', type: 'choose', required: true, dropType: 'supplier', required: true, urlKey: 'selectProductAttributeSuppliers', code: 'supplierIds', formMode: 'index', idKey: 'roleId', title: mixins.$t('supplier') },
|
|
|
- { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ { code: 'remarks', type: 'textarea', title: mixins.$t('remarks'), required: false }
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
@@ -449,17 +443,17 @@ Page({
|
|
|
popContent =
|
|
|
[
|
|
|
{ code: 'catCode', type: 'str', title: mixins.$t('catCode'), required: false, readonly: true },
|
|
|
- { code: 'parentId', name: 'parentName', title: mixins.$t('parent'), type: 'choose', required: false, urlKey: 'selectProductTypes', notClear: true,clear:true },
|
|
|
+ { code: 'parentId', name: 'parentName', title: mixins.$t('parent'), type: 'choose', required: false, urlKey: 'selectProductTypes', notClear: true, clear: true },
|
|
|
{ code: 'catName', type: 'str', title: mixins.$t('catName'), required: true },
|
|
|
- { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ { code: 'remarks', type: 'textarea', title: mixins.$t('remarks'), required: false }
|
|
|
]
|
|
|
} else {
|
|
|
popContent =
|
|
|
[
|
|
|
// { code: 'catCode', type: 'str', title: mixins.$t('catCode'), required: false, readonly: true, },
|
|
|
- { code: 'parentId', name: 'parentName', title: mixins.$t('parent'), type: 'choose', required: false, urlKey: 'selectProductTypes', notClear: true,clear:true },
|
|
|
+ { code: 'parentId', name: 'parentName', title: mixins.$t('parent'), type: 'choose', required: false, urlKey: 'selectProductTypes', notClear: true, clear: true },
|
|
|
{ code: 'catName', type: 'str', title: mixins.$t('catName'), required: true },
|
|
|
- { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ { code: 'remarks', type: 'textarea', title: mixins.$t('remarks'), required: false }
|
|
|
]
|
|
|
}
|
|
|
|
|
|
@@ -471,14 +465,14 @@ Page({
|
|
|
[
|
|
|
{ code: 'seriesCode', type: 'str', title: mixins.$t('seriesCode'), required: false, readonly: true, },
|
|
|
{ code: 'seriesName', type: 'str', title: mixins.$t('seriesName'), required: true },
|
|
|
- { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ { code: 'remarks', type: 'textarea', title: mixins.$t('remarks'), required: false }
|
|
|
]
|
|
|
} else {
|
|
|
popContent =
|
|
|
[
|
|
|
// { code: 'seriesCode', type: 'str', title: mixins.$t('seriesCode'), required: false, readonly: true, },
|
|
|
{ code: 'seriesName', type: 'str', title: mixins.$t('seriesName'), required: true },
|
|
|
- { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ { code: 'remarks', type: 'textarea', title: mixins.$t('remarks'), required: false }
|
|
|
]
|
|
|
}
|
|
|
|
|
|
@@ -491,7 +485,7 @@ Page({
|
|
|
{ code: 'unitCode', type: 'str', title: mixins.$t('unitCode'), required: false, readonly: true, },
|
|
|
{ code: 'unitName', type: 'str', title: mixins.$t('unitName'), required: true },
|
|
|
{ code: 'decimalPlaces', max: 6, min: 0, type: 'number', sign: "", digits: 0, title: mixins.$t('decimalPlaces'), required: true, formatThousandth: false },
|
|
|
- { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ { code: 'remarks', type: 'textarea', title: mixins.$t('remarks'), required: false }
|
|
|
]
|
|
|
} else {
|
|
|
popContent =
|
|
|
@@ -499,7 +493,7 @@ Page({
|
|
|
// { code: 'unitCode', type: 'str', title: mixins.$t('unitCode'), required: false, readonly: true, },
|
|
|
{ code: 'unitName', type: 'str', title: mixins.$t('unitName'), required: true },
|
|
|
{ code: 'decimalPlaces', max: 6, min: 0, type: 'number', sign: "", digits: 0, title: mixins.$t('decimalPlaces'), required: true, formatThousandth: false },
|
|
|
- { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ { code: 'remarks', type: 'textarea', title: mixins.$t('remarks'), required: false }
|
|
|
]
|
|
|
}
|
|
|
|