|
|
@@ -19,7 +19,7 @@ Page({
|
|
|
|
|
|
goodsBrandService: app.globalData['goodsBrandService'],
|
|
|
goodsCategoryService: app.globalData['goodsCategoryService'],
|
|
|
- goodsCategoryService: app.globalData['goodsCategoryService'],
|
|
|
+ goodsSeriesService: app.globalData['goodsSeriesService'],
|
|
|
UnitService: app.globalData['UnitService'],
|
|
|
// 路由
|
|
|
routeObjName: 'product-attribute',
|
|
|
@@ -29,8 +29,20 @@ Page({
|
|
|
{ name: 'brandName', title: '品牌名称' },
|
|
|
{ name: 'supName', title: '供应商' }
|
|
|
],
|
|
|
-
|
|
|
-
|
|
|
+ sidebarList: [
|
|
|
+ { id: 0, name: '商品品牌' },
|
|
|
+ { id: 1, name: '商品种类' },
|
|
|
+ { id: 2, name: '商品系列' },
|
|
|
+ { id: 3, name: '计量单位' }
|
|
|
+ ],
|
|
|
+ formDataName: '商品品牌',
|
|
|
+ popContent:
|
|
|
+ [
|
|
|
+ { code: 'brandCode', type: 'str', title: '品牌编码', required: false, readonly: true, },
|
|
|
+ { code: 'brandName', type: 'str', title: '品牌名称', required: true },
|
|
|
+ { code: 'supplierId', name: 'supplierName', title: 'supplier', type: 'choose', required: true, dropType: 'supplier', required: true },
|
|
|
+ { code: 'remarks', type: 'str', title: '备注', required: false }
|
|
|
+ ],
|
|
|
|
|
|
|
|
|
sideKey: 0,
|
|
|
@@ -48,302 +60,114 @@ Page({
|
|
|
{ checked: false, text: '无效', value: 0 },
|
|
|
{ checked: true, text: '全部', value: -1 },
|
|
|
], //状态
|
|
|
- fieldList: [
|
|
|
- {
|
|
|
- typeName: '商品品牌',
|
|
|
- code: '品牌编码',
|
|
|
- name: '品牌名称',
|
|
|
- supplierName: '供应商'
|
|
|
- },
|
|
|
- {
|
|
|
- typeName: '商品种类',
|
|
|
- channelCode: '渠道编码',
|
|
|
- channelName: '渠道名称'
|
|
|
- },
|
|
|
- {
|
|
|
- typeName: '商品系列',
|
|
|
- incomeCode: '收入编码',
|
|
|
- incomeName: '收入名称'
|
|
|
- },
|
|
|
- {
|
|
|
- typeName: '计量单位',
|
|
|
- expenditureCode: '支出编码',
|
|
|
- expenditureName: '支出名称'
|
|
|
- },
|
|
|
- {
|
|
|
- typeName: '入库原因',
|
|
|
- reasonCode: '原因编码',
|
|
|
- reasonName: '原因名称'
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
- ], //字段渲染
|
|
|
- // 渲染数据
|
|
|
- test00: [{
|
|
|
- code: 'PP00001',
|
|
|
- name: '蒙娜丽莎瓷砖',
|
|
|
- supplierName: '广东蒙娜丽莎新型材料集团有限公司',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- code: 'PP00002',
|
|
|
- name: '箭牌卫浴',
|
|
|
- supplierName: 'ARROW箭牌家居集团',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- code: 'PP00003',
|
|
|
- name: '恒洁卫浴',
|
|
|
- supplierName: '恒洁卫浴集团有限公司',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- ],
|
|
|
- test01: [
|
|
|
- {
|
|
|
- name: '陶瓷类',
|
|
|
- code: 'PP00001',
|
|
|
- supplierName: '广东蒙娜丽莎新型材料集团有限公司',
|
|
|
- flagValue: true,
|
|
|
- arrow_1: false,
|
|
|
- arrow_1_list: []
|
|
|
- },
|
|
|
- {
|
|
|
- name: '浴室柜类',
|
|
|
- code: 'PP00002',
|
|
|
- flagValue: true,
|
|
|
- arrow_1: true,
|
|
|
- arrow_1_list: [
|
|
|
- {
|
|
|
- name: '原木柜',
|
|
|
- code: 'PP00002',
|
|
|
- flagValue: true,
|
|
|
- arrow_2: true,
|
|
|
- arrow_2_list: [
|
|
|
- {
|
|
|
- name: '原木柜(主柜)',
|
|
|
- code: 'PP00002',
|
|
|
- flagValue: true,
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- name: '古典柜',
|
|
|
- code: 'PP00002',
|
|
|
- flagValue: false,
|
|
|
- arrow_2: true,
|
|
|
- arrow_2_list: [
|
|
|
- {
|
|
|
- name: '金属柜',
|
|
|
- code: 'PP00002',
|
|
|
- flagValue: false,
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- ],
|
|
|
- test02: [
|
|
|
- {
|
|
|
- name: '原木系列',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- name: '金属系列',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- name: '古典系列',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- name: '沐浴系列',
|
|
|
- flagValue: false
|
|
|
- },
|
|
|
- ],
|
|
|
- test03: [
|
|
|
- {
|
|
|
- name: '米',
|
|
|
- decimal: '2',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- name: '箱',
|
|
|
- decimal: '0',
|
|
|
- flagValue: true,
|
|
|
- list: [
|
|
|
- {
|
|
|
- name: '包*5',
|
|
|
- decimal: '0',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- name: '片*3',
|
|
|
- decimal: '0',
|
|
|
- flagValue: false
|
|
|
- },
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- name: '平方米',
|
|
|
- decimal: '6',
|
|
|
- flagValue: false
|
|
|
- },
|
|
|
- {
|
|
|
- name: '个',
|
|
|
- decimal: '0',
|
|
|
- flagValue: false
|
|
|
- },
|
|
|
- ],
|
|
|
- test04: [
|
|
|
- {
|
|
|
- reasonCode: 'RK00001',
|
|
|
- reasonName: '期初入库',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- reasonCode: 'RK00002',
|
|
|
- reasonName: '其他入库',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- reasonCode: 'RK00003',
|
|
|
- reasonName: '采购入库',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- reasonCode: 'RK00004',
|
|
|
- reasonName: '销售回库',
|
|
|
- flagValue: true
|
|
|
- }
|
|
|
- ],
|
|
|
- test05: [
|
|
|
- {
|
|
|
- reasonCode: 'CK00001',
|
|
|
- reasonName: '销售出库',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- reasonCode: 'CK00002',
|
|
|
- reasonName: '其他出库',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- reasonCode: 'CK00003',
|
|
|
- reasonName: '采购退货出库',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- reasonCode: 'CK00004',
|
|
|
- reasonName: '调货出库',
|
|
|
- flagValue: true
|
|
|
- }
|
|
|
- ],
|
|
|
- test06: [
|
|
|
- {
|
|
|
- paymentCode: 'SF00001',
|
|
|
- paymentName: '微信',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- paymentCode: 'SF00002',
|
|
|
- paymentName: '现金',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- paymentCode: 'SF00003',
|
|
|
- paymentName: '银行转账',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- paymentCode: 'SF00004',
|
|
|
- paymentName: '支付宝',
|
|
|
- flagValue: true
|
|
|
- }
|
|
|
- ],
|
|
|
},
|
|
|
|
|
|
- /**
|
|
|
+ /**
|
|
|
* @desc : 侧滑事件
|
|
|
* @author : 于继渤
|
|
|
* @date : 2024/1/26 11:46
|
|
|
*/
|
|
|
- changeSwipe(e){
|
|
|
- console.log(e)
|
|
|
+ changeSwipe(e) {
|
|
|
+ console.log('changeSwipe', e)
|
|
|
+ let item = e.detail.item
|
|
|
+ //停用启用
|
|
|
+ let param = {
|
|
|
+ brandId: item.brandId,
|
|
|
+ flgValid: !item.flgValid,
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ formData: JSON.stringify(param)
|
|
|
+ })
|
|
|
+ //执行编辑操作
|
|
|
+ this.save({})
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc : 启用停用
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
+ deactivateEnable(e) {
|
|
|
+ let item = e.detail.item
|
|
|
+ let service = null
|
|
|
+ let id = null
|
|
|
+ if (this.data.formDataName == '商品品牌') {
|
|
|
+ service = this.data.goodsBrandService
|
|
|
+ id = item.brandId
|
|
|
+ }
|
|
|
+ let method = item.flgValid ? service.disable : service.enable;
|
|
|
+ return this.excute(service, method, id).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '操作成功',
|
|
|
+ image: '/static/image/success.png',
|
|
|
+ duration: 1000
|
|
|
+ })
|
|
|
+ //查询列表
|
|
|
+ this.searchData()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
-
|
|
|
- dropdownSwitchCommit(e) {
|
|
|
- console.log(e)
|
|
|
+ /**
|
|
|
+ * @desc : 新建编辑事件
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2024/1/26 11:46
|
|
|
+ */
|
|
|
+ editItems(e) {
|
|
|
+ let data = e.detail.form
|
|
|
+ this.setData({
|
|
|
+ formData: JSON.stringify(data)
|
|
|
+ })
|
|
|
+ //执行保存编辑操作
|
|
|
+ this.save({})
|
|
|
},
|
|
|
|
|
|
|
|
|
- openSingle(e) {
|
|
|
- console.log(e)
|
|
|
- let key = e.currentTarget.dataset.key
|
|
|
- wx.navigateTo({
|
|
|
- url: './' + key + '/' + key,
|
|
|
- })
|
|
|
+ saveData(params) {
|
|
|
+ if (this.data.formDataName == '商品品牌') {
|
|
|
+ if (params.brandId) { //编辑
|
|
|
+ return this.excute(this.data.goodsBrandService, this.data.goodsBrandService.update, params);
|
|
|
+ } else { //新建
|
|
|
+ return this.excute(this.data.goodsBrandService, this.data.goodsBrandService.insert, params);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* @desc : 分类切换
|
|
|
* @author : 于继渤
|
|
|
* @date : 2022/5/26 20:16
|
|
|
*/
|
|
|
changeSidebar(e) {
|
|
|
- console.log(e)
|
|
|
- let id = this.data.leftData[e.detail].id
|
|
|
- let name = this.data.leftData[e.detail].name
|
|
|
- let fieldList = this.data.fieldList
|
|
|
- let tableData = this.data.tableData
|
|
|
- console.log('name', name)
|
|
|
- // let sidebarList = fieldList.filter(res => {
|
|
|
- // return res.typeName == name
|
|
|
- // })
|
|
|
- if (name == '商品品牌') {
|
|
|
- tableData = this.data.test00
|
|
|
- }
|
|
|
- if (name == '商品种类') {
|
|
|
- tableData = this.data.test01
|
|
|
- }
|
|
|
- if (name == '商品系列') {
|
|
|
- tableData = this.data.test02
|
|
|
- }
|
|
|
- if (name == '计量单位') {
|
|
|
- tableData = this.data.test03
|
|
|
- }
|
|
|
-
|
|
|
+ console.log(e.detail)
|
|
|
+ let detail = e.detail
|
|
|
this.setData({
|
|
|
- sideKey: e.detail,
|
|
|
- tableData: tableData,
|
|
|
- listTitle: name,
|
|
|
- searchText: ''
|
|
|
+ formDataName: this.data.sidebarList[detail].name
|
|
|
})
|
|
|
|
|
|
- // 查询
|
|
|
- // this.doSearch()
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 左滑功能
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2024/1/23 9:16
|
|
|
- */
|
|
|
- onCloseDel(e) {
|
|
|
- console.log(e)
|
|
|
+ this.searchData()
|
|
|
},
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* @desc : 列表对象点击
|
|
|
* @author : 于继渤
|
|
|
* @date : 2024/1/23 9:16
|
|
|
*/
|
|
|
toDetail(e) {
|
|
|
- console.log(e)
|
|
|
- let index = e.currentTarget.dataset.index
|
|
|
- let tableData = this.data.tableData
|
|
|
+ console.log('toDetail', e)
|
|
|
+ let item = e.detail.item
|
|
|
+
|
|
|
this.setData({
|
|
|
- showPopup: true,
|
|
|
- showPopupItem: tableData[index]
|
|
|
+ popContent: this.data.popContent,
|
|
|
+ showPop: true,
|
|
|
+ dataItem: JSON.stringify(item)
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
@@ -363,13 +187,21 @@ Page({
|
|
|
*/
|
|
|
toAdd() {
|
|
|
this.setData({
|
|
|
- showPopupItem: {},
|
|
|
- showPopup: true
|
|
|
+ popContent: this.data.popContentAdd,
|
|
|
+ dataItem: '',
|
|
|
+ showPop: true,
|
|
|
})
|
|
|
},
|
|
|
|
|
|
getData(params) {
|
|
|
- return this.excute(this.data.goodsBrandService, this.data.goodsBrandService.selectByCond, params);
|
|
|
+ if (this.data.formDataName == '商品品牌') { //商品品牌
|
|
|
+ return this.excute(this.data.goodsBrandService, this.data.goodsBrandService.selectByCond, params);
|
|
|
+ } else if (this.data.formDataName == '商品总类') { //商品总类
|
|
|
+
|
|
|
+ } else if (this.data.formDataName == '商品系列') { //商品系列
|
|
|
+ return this.excute(this.data.goodsSeriesService, this.data.goodsSeriesService.selectByCond, params);
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -388,33 +220,8 @@ Page({
|
|
|
|
|
|
|
|
|
|
|
|
- let leftData = [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '商品品牌'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- name: '商品种类'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 3,
|
|
|
- name: '商品系列'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 4,
|
|
|
- name: '计量单位'
|
|
|
- }
|
|
|
|
|
|
- ]
|
|
|
- let tableData = this.data.test00
|
|
|
- this.setData({
|
|
|
- leftData: leftData,
|
|
|
- tableData: tableData,
|
|
|
- listTitle: leftData[0].name,
|
|
|
- fieldData: this.data.fieldList[0]
|
|
|
|
|
|
- })
|
|
|
},
|
|
|
|
|
|
/**
|