|
|
@@ -9,6 +9,7 @@
|
|
|
*******************************************************************************/
|
|
|
const common = require('@/utils/common');
|
|
|
const Constants = require('@/utils/Constants');
|
|
|
+const config = require('@/config/config.js')
|
|
|
const chooseLocation = requirePlugin('chooseLocation');
|
|
|
const util = require('@/utils/util.js')
|
|
|
const app = getApp();
|
|
|
@@ -130,6 +131,7 @@ Component({
|
|
|
* 组件的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
+ maxSize: Constants.uploadFileConfig.maxSize,
|
|
|
// 是否显示pop
|
|
|
show: false,
|
|
|
showDate: false,
|
|
|
@@ -177,7 +179,8 @@ Component({
|
|
|
* @date : 2024/2/19 12:16
|
|
|
*/
|
|
|
show: function () {
|
|
|
- const location = chooseLocation.getLocation();
|
|
|
+ const location = chooseLocation.getLocation();
|
|
|
+ // console.log('loc', location);
|
|
|
let form = this.data.form
|
|
|
if (location) {
|
|
|
form['address'] = location;
|
|
|
@@ -208,10 +211,6 @@ Component({
|
|
|
* @date : 2024/2/22 18:16
|
|
|
*/
|
|
|
choose(e) {
|
|
|
- // 只读
|
|
|
- if (this.data.readonly) {
|
|
|
- return;
|
|
|
- }
|
|
|
let item = e.currentTarget.dataset;
|
|
|
let cardIndex = e.currentTarget.dataset.index
|
|
|
let cardList = this.data.cardList
|
|
|
@@ -233,13 +232,6 @@ Component({
|
|
|
// that.setData({
|
|
|
// form: form
|
|
|
// })
|
|
|
- let form = that.data.form
|
|
|
- console.log('fff1',form);
|
|
|
- form[that.data.itemName] = util.filterArrayEmpty(form[that.data.itemName])
|
|
|
- console.log('fff2',util.filterArrayEmpty(form[that.data.itemName]));
|
|
|
- that.setData({
|
|
|
- form:form
|
|
|
- })
|
|
|
that.triggerEvent("chooseData", { code: cardList[cardIndex].name, data: data, index: item.index })
|
|
|
// // 如果需要联动控制选商品按钮
|
|
|
// if (item.item.controlChooseFlag) {
|
|
|
@@ -255,7 +247,7 @@ Component({
|
|
|
success: function (res) {
|
|
|
// 通过eventChannel向被打开页面传送数据
|
|
|
let item = {}
|
|
|
- let form = that.data.form
|
|
|
+ let form = that.data.form
|
|
|
item[that.data.objIdCol] = form[that.data.objIdCol]
|
|
|
if (form && form[that.data.itemName]) {
|
|
|
item.data = util.filterArrayEmpty(form[that.data.itemName])
|
|
|
@@ -349,13 +341,15 @@ Component({
|
|
|
url: '/package-base-select/pages/select-customers/select-customers',
|
|
|
events: {
|
|
|
// 回调后
|
|
|
- bindData: function (data) {
|
|
|
+ bindData: function (data) {
|
|
|
+ console.log('rr', data);
|
|
|
let form = _this.data.form
|
|
|
- let objIdCol = _this.data.objIdCol;
|
|
|
+ let objIdCol = _this.data.objIdCol;
|
|
|
// 赋值对象Id
|
|
|
if (objIdCol && data[objIdCol]) {
|
|
|
form[objIdCol] = data[objIdCol]
|
|
|
- }
|
|
|
+ }
|
|
|
+ console.log('ddd', form);
|
|
|
form.objInfo = data;
|
|
|
_this.setData({
|
|
|
form: form,
|
|
|
@@ -379,7 +373,7 @@ Component({
|
|
|
bindData: function (data) {
|
|
|
let dataitem = data.data.item
|
|
|
let form = _this.data.form
|
|
|
- let objIdCol = _this.data.objIdCol;
|
|
|
+ let objIdCol = _this.data.objIdCol;
|
|
|
// 赋值对象Id
|
|
|
if (objIdCol && dataitem[objIdCol]) {
|
|
|
form[objIdCol] = dataitem[objIdCol]
|
|
|
@@ -394,8 +388,9 @@ Component({
|
|
|
},
|
|
|
success: function (res) {
|
|
|
// 通过eventChannel向被打开页面传送数据
|
|
|
- let item = {}
|
|
|
- let route = _this.data.routeUrl[_this.data.routeObjName];
|
|
|
+ let item = {}
|
|
|
+ console.log('re', _this.data.routeObjName, _this.data.routeUrl);
|
|
|
+ let route = _this.data.routeUrl[_this.data.routeObjName];
|
|
|
res.eventChannel.emit('params', { item: item, route: route['chooseSupplier'] })
|
|
|
}
|
|
|
})
|
|
|
@@ -559,7 +554,8 @@ Component({
|
|
|
}
|
|
|
that.setData({
|
|
|
form: form
|
|
|
- })
|
|
|
+ })
|
|
|
+ console.log('form', form)
|
|
|
that.triggerEvent("chooseData", { code: item.key, data: data, index: item.index })
|
|
|
// 如果需要联动控制选商品按钮
|
|
|
if (item.item.controlChooseFlag) {
|
|
|
@@ -608,7 +604,8 @@ Component({
|
|
|
let title = this.$t(item.title ? item.title : item.code)
|
|
|
// 如果必须输入,就要进行判断
|
|
|
if (item.required && form[this.data.itemName] && form[this.data.itemName].length > 0) {
|
|
|
- form[this.data.itemName].forEach(t => {
|
|
|
+ form[this.data.itemName].forEach(t => {
|
|
|
+ console.log('tt', t, item.code);
|
|
|
if (!t[item.code]) {
|
|
|
t[item.code + '_errMsg'] = title + '不为空'
|
|
|
flag = false;
|
|
|
@@ -709,7 +706,8 @@ Component({
|
|
|
_this.setData({
|
|
|
form: form,
|
|
|
value: JSON.stringify(form)
|
|
|
- })
|
|
|
+ })
|
|
|
+ console.log('ff', _this.data.form);
|
|
|
}
|
|
|
},
|
|
|
})
|
|
|
@@ -800,7 +798,8 @@ Component({
|
|
|
value: JSON.stringify(form),
|
|
|
form: form,
|
|
|
contentObj: contentObj
|
|
|
- })
|
|
|
+ })
|
|
|
+ console.log("changeNumber组件", form);
|
|
|
this.triggerEvent("changeNumber", { code: key, data: e.detail.value })
|
|
|
},
|
|
|
/**
|
|
|
@@ -890,7 +889,8 @@ Component({
|
|
|
* @author : 周兴
|
|
|
* @date : 2024/1/26 11:46
|
|
|
*/
|
|
|
- onChange(e) {
|
|
|
+ onChange(e) {
|
|
|
+ console.log("onChange", e);
|
|
|
// 只读
|
|
|
if (this.data.readonly) {
|
|
|
return;
|