|
|
@@ -16,7 +16,7 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
-
|
|
|
+ routeObjNameGoTo: '',
|
|
|
goodsBrandService: app.globalData['goodsBrandService'],
|
|
|
goodsCategoryService: app.globalData['goodsCategoryService'],
|
|
|
goodsSeriesService: app.globalData['goodsSeriesService'],
|
|
|
@@ -25,8 +25,8 @@ Page({
|
|
|
routeObjName: 'product-attribute',
|
|
|
// 列表区(内容)商品品牌
|
|
|
contentList: [
|
|
|
- { name: 'brandCode' , title: mixins.$t('brandCode')},
|
|
|
- { name: 'brandName', title:mixins.$t('brandName') },
|
|
|
+ { name: 'brandCode', title: mixins.$t('brandCode') },
|
|
|
+ { name: 'brandName', title: mixins.$t('brandName') },
|
|
|
{ name: 'supplierName', title: mixins.$t('supplier') }
|
|
|
],
|
|
|
sidebarList: [
|
|
|
@@ -35,13 +35,13 @@ Page({
|
|
|
{ id: 2, name: mixins.$t('goodsSeries') },
|
|
|
{ id: 3, name: mixins.$t('unit') }
|
|
|
],
|
|
|
- formDataName: mixins.$t('goodsBrand') ,
|
|
|
+ formDataName: mixins.$t('goodsBrand'),
|
|
|
popContent:
|
|
|
[
|
|
|
{ code: 'brandCode', type: 'str', title: mixins.$t('brandCode'), required: false, readonly: true, },
|
|
|
- { code: 'brandName', type: 'str', title: mixins.$t('brandName') , required: true },
|
|
|
+ { code: 'brandName', type: 'str', title: mixins.$t('brandName'), required: true },
|
|
|
{ code: 'supplierId', name: 'supplierName', title: 'supplier', type: 'choose', required: true, dropType: 'supplier', required: true },
|
|
|
- { code: 'remarks', type: 'str', title: mixins.$t('remarks') , required: false }
|
|
|
+ { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
],
|
|
|
|
|
|
|
|
|
@@ -88,11 +88,11 @@ Page({
|
|
|
let item = e.detail.item
|
|
|
let service = null
|
|
|
let id = null
|
|
|
- if (this.data.formDataName == mixins.$t('goodsBrand')) {
|
|
|
+ if (this.data.formDataName == mixins.$t('goodsBrand')) {
|
|
|
service = this.data.goodsBrandService
|
|
|
id = 'brandId'
|
|
|
}
|
|
|
- if (this.data.formDataName == mixins.$t('goodsCategory')) {
|
|
|
+ if (this.data.formDataName == mixins.$t('goodsCategory')) {
|
|
|
service = this.data.goodsCategoryService
|
|
|
id = 'catId'
|
|
|
}
|
|
|
@@ -124,6 +124,17 @@ Page({
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
+ * @desc : 商品种类停用启用
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2024/1/26 11:46
|
|
|
+ */
|
|
|
+ onSwipe(e) {
|
|
|
+ console.log('商品种类停用启用',e)
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* @desc : 保存编辑
|
|
|
* @author : 于继渤
|
|
|
* @date : 2022/5/26 20:16
|
|
|
@@ -203,9 +214,44 @@ Page({
|
|
|
this.setPopContent();
|
|
|
this.setData({
|
|
|
dataItem: null,
|
|
|
+ formData: null,
|
|
|
showPop: true,
|
|
|
})
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 处理接口返回数据
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
+ handleSearchData(tableData) {
|
|
|
+ console.log('this.data.formDataName', this.data.formDataName, tableData)
|
|
|
+ if (this.data.formDataName == mixins.$t('goodsCategory')) {
|
|
|
+ this.setData({
|
|
|
+ tableData: util.convertToChildren(tableData, 'parentId', 'catId', null)
|
|
|
+ })
|
|
|
+ const myComponent = this.selectComponent('#treeSelect');
|
|
|
+ myComponent.setDataFromPage(this.data.tableData);
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 设置查询参数
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2024/1/23 9:16
|
|
|
+ */
|
|
|
+ setSearchParams(params) {
|
|
|
+ if (this.data.formDataName == mixins.$t('goodsCategory')) {
|
|
|
+ params.pageSize = 100000
|
|
|
+ params.currentPage = 1
|
|
|
+ }
|
|
|
+
|
|
|
+ return params
|
|
|
},
|
|
|
+
|
|
|
/**
|
|
|
* @desc : 加载数据
|
|
|
* @author : 于继渤
|
|
|
@@ -231,23 +277,31 @@ Page({
|
|
|
setPopContent() {
|
|
|
let formDataName = this.data.formDataName
|
|
|
let popContent = this.data.popContent
|
|
|
+ let routeObjNameGoTo = this.data.routeObjNameGoTo
|
|
|
console.log('formDataName', formDataName)
|
|
|
- if (formDataName == mixins.$t('goodsBrand')) {//商品品牌
|
|
|
+ if (formDataName == mixins.$t('goodsBrand')) {//商品品牌
|
|
|
popContent =
|
|
|
[
|
|
|
{ code: 'brandCode', type: 'str', title: mixins.$t('brandCode'), required: false, readonly: true, },
|
|
|
{ code: 'brandName', type: 'str', title: mixins.$t('brandName'), required: true },
|
|
|
{ code: 'supplierId', name: 'supplierName', title: 'supplier', type: 'choose', required: true, dropType: 'supplier', required: true },
|
|
|
- { code: 'remarks', type: 'str', title:mixins.$t('remarks'), required: false }
|
|
|
+ { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
]
|
|
|
- }
|
|
|
- if (formDataName == mixins.$t('goodsCategory')) { //商品种类
|
|
|
-
|
|
|
}
|
|
|
- if (formDataName == mixins.$t('goodsSeries')) { //商品系列
|
|
|
+ if (formDataName == mixins.$t('goodsCategory')) { //商品种类
|
|
|
+ popContent =
|
|
|
+ [
|
|
|
+ { code: 'catCode', type: 'str', title: mixins.$t('catCode'), required: false, readonly: true, },
|
|
|
+ { code: 'parentId', name: 'parentName', title: 'parent', type: 'choose', required: true, dropType: 'supplier', required: true, urlKey: 'selectProductTypes', },
|
|
|
+ { code: 'catName', type: 'str', title: mixins.$t('catName'), required: true },
|
|
|
+ { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ ]
|
|
|
+ routeObjNameGoTo = 'goodsCategory'
|
|
|
+ }
|
|
|
+ if (formDataName == mixins.$t('goodsSeries')) { //商品系列
|
|
|
popContent =
|
|
|
[
|
|
|
- { code: 'seriesCode', type: 'str', title: mixins.$t('seriesCode'), required: false, readonly: true, },
|
|
|
+ { 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 }
|
|
|
]
|
|
|
@@ -257,12 +311,13 @@ 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', type: 'number',title: mixins.$t('decimalPlaces'), required: true },
|
|
|
+ { code: 'decimalPlaces', type: 'number', title: mixins.$t('decimalPlaces'), required: true },
|
|
|
{ code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
]
|
|
|
}
|
|
|
this.setData({
|
|
|
- popContent: popContent
|
|
|
+ popContent: popContent,
|
|
|
+ routeObjNameGoTo: routeObjNameGoTo
|
|
|
})
|
|
|
},
|
|
|
|