|
@@ -53,21 +53,24 @@ Component({
|
|
|
data: {
|
|
data: {
|
|
|
// 是否显示pop
|
|
// 是否显示pop
|
|
|
show: false,
|
|
show: false,
|
|
|
- showDate:false,
|
|
|
|
|
- showPop:false,
|
|
|
|
|
|
|
+ showDate: false,
|
|
|
|
|
+ showPop: false,
|
|
|
$t: app.globalData.lang,
|
|
$t: app.globalData.lang,
|
|
|
routeUrl: app.globalData['routeUrl'],
|
|
routeUrl: app.globalData['routeUrl'],
|
|
|
item: null,
|
|
item: null,
|
|
|
- dataItem:null,
|
|
|
|
|
index: null,
|
|
index: null,
|
|
|
|
|
+ dataItem: null,
|
|
|
|
|
+ dataIndex: null,
|
|
|
card: null,
|
|
card: null,
|
|
|
- key:null,
|
|
|
|
|
|
|
+ key: null,
|
|
|
// 下拉类型
|
|
// 下拉类型
|
|
|
dropType: null,
|
|
dropType: null,
|
|
|
dropCode: null,
|
|
dropCode: null,
|
|
|
dropName: null,
|
|
dropName: null,
|
|
|
itemName: 'goodsList',
|
|
itemName: 'goodsList',
|
|
|
selectGoodsUrl: null,
|
|
selectGoodsUrl: null,
|
|
|
|
|
+ popContent:
|
|
|
|
|
+ [{ code: 'quantity', type: 'step', title: '数量', required: true }, { code: 'pricePromotion', type: 'number', title: '销售价格', required: true }, { code: 'warehouseId', name: 'warehouseName', type: 'drop', required: true, dropType: 'warehouse' , required: true}, { code: 'color', type: 'str', title: '批次号' , required: true}, { code: 'giftFlag', type: 'checkbox', title: '赠品标识' }],
|
|
|
form: {}
|
|
form: {}
|
|
|
},
|
|
},
|
|
|
lifetimes: {
|
|
lifetimes: {
|
|
@@ -103,13 +106,30 @@ Component({
|
|
|
* @author : 周兴
|
|
* @author : 周兴
|
|
|
* @date : 2024/1/26 11:46
|
|
* @date : 2024/1/26 11:46
|
|
|
*/
|
|
*/
|
|
|
- openChoosedItemInfo(e){
|
|
|
|
|
- console.log('eeee',e);
|
|
|
|
|
- let dataItem = e.currentTarget.dataset.item
|
|
|
|
|
-
|
|
|
|
|
|
|
+ openChoosedItemInfo(e) {
|
|
|
|
|
+ let ds = e.currentTarget.dataset;
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- dataItem:JSON.stringify(dataItem) ,
|
|
|
|
|
- showPop:true,
|
|
|
|
|
|
|
+ dataIndex: ds.index,
|
|
|
|
|
+ dataItem: JSON.stringify(ds.item),
|
|
|
|
|
+ showPop: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log('ffff', this.data.form, this.data.form[this.data.itemName][ds.index]);
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @desc : 关闭Pop后修改数据
|
|
|
|
|
+ * @author : 周兴
|
|
|
|
|
+ * @date : 2024/1/26 11:46
|
|
|
|
|
+ */
|
|
|
|
|
+ editItems(data) {
|
|
|
|
|
+ console.log('data', data);
|
|
|
|
|
+ let form = this.data.form;
|
|
|
|
|
+ let itemName = this.data.itemName;
|
|
|
|
|
+ if (form[itemName]) {
|
|
|
|
|
+ form[itemName][this.data.dataIndex] = data.detail.form;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ form: form,
|
|
|
|
|
+ value: JSON.stringify(value)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
@@ -157,35 +177,35 @@ Component({
|
|
|
* @author : 周兴
|
|
* @author : 周兴
|
|
|
* @date : 2024/2/20 11:46
|
|
* @date : 2024/2/20 11:46
|
|
|
*/
|
|
*/
|
|
|
- openMulti(e){
|
|
|
|
|
|
|
+ openMulti(e) {
|
|
|
let type = e.currentTarget.dataset.type
|
|
let type = e.currentTarget.dataset.type
|
|
|
let _this = this
|
|
let _this = this
|
|
|
// 选择主从业务员
|
|
// 选择主从业务员
|
|
|
- if(type == 'staff'){
|
|
|
|
|
|
|
+ if (type == 'staff') {
|
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
|
url: '/package-base-select/pages/select-customers/select-customers',
|
|
url: '/package-base-select/pages/select-customers/select-customers',
|
|
|
- events:{
|
|
|
|
|
|
|
+ events: {
|
|
|
// 回调后
|
|
// 回调后
|
|
|
- bindData:function(data) {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ bindData: function (data) {
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- success: function(res) {
|
|
|
|
|
|
|
+ success: function (res) {
|
|
|
// 通过eventChannel向被打开页面传送数据
|
|
// 通过eventChannel向被打开页面传送数据
|
|
|
res.eventChannel.emit('params', { data: 'test' })
|
|
res.eventChannel.emit('params', { data: 'test' })
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- // 选择主从业务部门
|
|
|
|
|
- }else if(type == 'org'){
|
|
|
|
|
|
|
+ // 选择主从业务部门
|
|
|
|
|
+ } else if (type == 'org') {
|
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
|
url: '/package-base-select/pages/select-suppliers/select-suppliers',
|
|
url: '/package-base-select/pages/select-suppliers/select-suppliers',
|
|
|
- events:{
|
|
|
|
|
|
|
+ events: {
|
|
|
// 回调后
|
|
// 回调后
|
|
|
- bindData:function(data) {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ bindData: function (data) {
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- success: function(res) {
|
|
|
|
|
|
|
+ success: function (res) {
|
|
|
// 通过eventChannel向被打开页面传送数据
|
|
// 通过eventChannel向被打开页面传送数据
|
|
|
res.eventChannel.emit('params', { data: 'test' })
|
|
res.eventChannel.emit('params', { data: 'test' })
|
|
|
}
|
|
}
|
|
@@ -256,17 +276,17 @@ Component({
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- /**
|
|
|
|
|
- * @desc : 打开日期pop
|
|
|
|
|
- * @author : 周兴
|
|
|
|
|
- * @date : 2024/1/26 11:46
|
|
|
|
|
- */
|
|
|
|
|
- openDatePop(e){
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @desc : 打开日期pop
|
|
|
|
|
+ * @author : 周兴
|
|
|
|
|
+ * @date : 2024/1/26 11:46
|
|
|
|
|
+ */
|
|
|
|
|
+ openDatePop(e) {
|
|
|
let item = e.currentTarget.dataset;
|
|
let item = e.currentTarget.dataset;
|
|
|
this.setData({
|
|
this.setData({
|
|
|
showDate: true,
|
|
showDate: true,
|
|
|
index: item.index,
|
|
index: item.index,
|
|
|
- key:item.key,
|
|
|
|
|
|
|
+ key: item.key,
|
|
|
card: item.card
|
|
card: item.card
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -275,9 +295,9 @@ Component({
|
|
|
* @author : 周兴
|
|
* @author : 周兴
|
|
|
* @date : 2024/1/26 11:46
|
|
* @date : 2024/1/26 11:46
|
|
|
*/
|
|
*/
|
|
|
- cancelDatePop(){
|
|
|
|
|
|
|
+ cancelDatePop() {
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- showDate:false
|
|
|
|
|
|
|
+ showDate: false
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
@@ -285,13 +305,13 @@ Component({
|
|
|
* @author : 周兴
|
|
* @author : 周兴
|
|
|
* @date : 2024/1/26 11:46
|
|
* @date : 2024/1/26 11:46
|
|
|
*/
|
|
*/
|
|
|
- chooseDate(e){
|
|
|
|
|
|
|
+ chooseDate(e) {
|
|
|
let form = this.data.form;
|
|
let form = this.data.form;
|
|
|
let index = this.data.index;
|
|
let index = this.data.index;
|
|
|
let card = this.data.card;
|
|
let card = this.data.card;
|
|
|
let code = this.data.key;
|
|
let code = this.data.key;
|
|
|
form[code + '_time'] = e.detail
|
|
form[code + '_time'] = e.detail
|
|
|
- form[code] = util.toDateStr(e.detail);
|
|
|
|
|
|
|
+ form[code] = util.toDateStr(e.detail);
|
|
|
let contentObj = this.data.contentObj;
|
|
let contentObj = this.data.contentObj;
|
|
|
if (card && contentObj[card][index]?.errMsg && e.detail) {
|
|
if (card && contentObj[card][index]?.errMsg && e.detail) {
|
|
|
contentObj[card][index].errMsg = undefined;
|
|
contentObj[card][index].errMsg = undefined;
|
|
@@ -299,8 +319,8 @@ Component({
|
|
|
this.setData({
|
|
this.setData({
|
|
|
value: JSON.stringify(form),
|
|
value: JSON.stringify(form),
|
|
|
form: form,
|
|
form: form,
|
|
|
- contentObj:contentObj,
|
|
|
|
|
- showDate:false
|
|
|
|
|
|
|
+ contentObj: contentObj,
|
|
|
|
|
+ showDate: false
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|