|
|
@@ -276,6 +276,10 @@ Component({
|
|
|
goodsTagColor: { //标签颜色
|
|
|
type: String,
|
|
|
},
|
|
|
+ satffAndOrgReadonly:{
|
|
|
+ type: Boolean,
|
|
|
+ value:false
|
|
|
+ },
|
|
|
// 结果集
|
|
|
value: {
|
|
|
type: String,
|
|
|
@@ -345,26 +349,26 @@ Component({
|
|
|
// [{ 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: {},
|
|
|
popChangePrice: [{
|
|
|
- code: 'priceSale',
|
|
|
- type: 'number',
|
|
|
- title: mixins.$t("priceSale"),
|
|
|
- center: 'right',
|
|
|
- readonly: true
|
|
|
- },
|
|
|
- {
|
|
|
- code: 'factPrice',
|
|
|
- type: 'number',
|
|
|
- title: mixins.$t("factPrice"),
|
|
|
- required: true,
|
|
|
- readonly: false
|
|
|
- },
|
|
|
- {
|
|
|
- code: 'factAmt',
|
|
|
- type: 'number',
|
|
|
- title: mixins.$t("factAmt"),
|
|
|
- required: true,
|
|
|
- readonly: false
|
|
|
- },
|
|
|
+ code: 'priceSale',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t("priceSale"),
|
|
|
+ center: 'right',
|
|
|
+ readonly: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'factPrice',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t("factPrice"),
|
|
|
+ required: true,
|
|
|
+ readonly: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'factAmt',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t("factAmt"),
|
|
|
+ required: true,
|
|
|
+ readonly: false
|
|
|
+ },
|
|
|
],
|
|
|
},
|
|
|
lifetimes: {
|
|
|
@@ -565,7 +569,7 @@ Component({
|
|
|
element.readonly = true
|
|
|
});
|
|
|
this.setData({
|
|
|
- popChangePrice:popChangePrice
|
|
|
+ popChangePrice: popChangePrice
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -645,17 +649,17 @@ Component({
|
|
|
) {
|
|
|
this.setData({
|
|
|
popContentBox: [{
|
|
|
- code: 'box',
|
|
|
- type: 'step',
|
|
|
- title: dataItem.subUnitName,
|
|
|
- required: true
|
|
|
- },
|
|
|
- {
|
|
|
- code: 'piece',
|
|
|
- type: 'step',
|
|
|
- title: dataItem.unitName,
|
|
|
- required: true
|
|
|
- },
|
|
|
+ code: 'box',
|
|
|
+ type: 'step',
|
|
|
+ title: dataItem.subUnitName,
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'piece',
|
|
|
+ type: 'step',
|
|
|
+ title: dataItem.unitName,
|
|
|
+ required: true
|
|
|
+ },
|
|
|
],
|
|
|
})
|
|
|
}
|
|
|
@@ -686,7 +690,7 @@ Component({
|
|
|
this.setGoodsOutAmount()
|
|
|
}
|
|
|
if (this.data.type == Constants.billType.saleOutReturn) {
|
|
|
- form = this.setGoodsOutReturnAmount(form)
|
|
|
+ form = this.setGoodsOutReturnAmount(form)
|
|
|
}
|
|
|
// 外露关闭pop后事件
|
|
|
this.triggerEvent("editItems", {
|
|
|
@@ -855,7 +859,7 @@ Component({
|
|
|
// 是否弹出询问框
|
|
|
Dialog.confirm({
|
|
|
message: item.item.titpsMessage, //提示信息
|
|
|
- }).then(() => {}).catch(() => {})
|
|
|
+ }).then(() => { }).catch(() => { })
|
|
|
return
|
|
|
}
|
|
|
//控制校验提示删除明细
|
|
|
@@ -863,7 +867,7 @@ Component({
|
|
|
// 是否弹出询问框
|
|
|
Dialog.confirm({
|
|
|
message: '请先删除商品明细中的商品', //提示信息
|
|
|
- }).then(() => {}).catch(() => {})
|
|
|
+ }).then(() => { }).catch(() => { })
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -923,13 +927,15 @@ Component({
|
|
|
chooseVisible: false
|
|
|
})
|
|
|
}
|
|
|
- let contentObj = that.data.contentObj;
|
|
|
- if (item.card && contentObj[item.card][item.index]?.errMsg && data) {
|
|
|
- contentObj[item.card][item.index].errMsg = undefined;
|
|
|
- that.setData({
|
|
|
- contentObj: contentObj
|
|
|
- })
|
|
|
- }
|
|
|
+ // let contentObj = that.data.contentObj;
|
|
|
+ // if (item.card && contentObj[item.card][item.index]?.errMsg && data) {
|
|
|
+ // contentObj[item.card][item.index].errMsg = undefined;
|
|
|
+ // that.setData({
|
|
|
+ // contentObj: contentObj
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // 清除错误信息
|
|
|
+ that.clearErrMsg(that);
|
|
|
}
|
|
|
},
|
|
|
success: function (res) {
|
|
|
@@ -969,6 +975,8 @@ Component({
|
|
|
chooseVisible: false
|
|
|
})
|
|
|
}
|
|
|
+ // 清除错误信息
|
|
|
+ that.clearErrMsg(that);
|
|
|
}
|
|
|
},
|
|
|
success: function (res) {
|
|
|
@@ -983,6 +991,26 @@ Component({
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
+ * @desc : 清除掉错误提示信息
|
|
|
+ * @author : 周兴
|
|
|
+ * @date : 2024/2/20 11:46
|
|
|
+ */
|
|
|
+ clearErrMsg(that) {
|
|
|
+ let cardList = that.data.cardList
|
|
|
+ let contentObj = that.data.contentObj
|
|
|
+ cardList.forEach(c => {
|
|
|
+ if (contentObj[c.name]) {
|
|
|
+ contentObj[c.name].forEach(it => {
|
|
|
+ it.errMsg = undefined
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ that.setData({
|
|
|
+ contentObj: contentObj
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
* @desc : 打开选择主从业务员/业务部门组件
|
|
|
* @author : 周兴
|
|
|
* @date : 2024/2/20 11:46
|
|
|
@@ -991,6 +1019,9 @@ Component({
|
|
|
if (this.data.readonly) {
|
|
|
return;
|
|
|
}
|
|
|
+ if (this.data.satffAndOrgReadonly) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
let type = e.currentTarget.dataset.type
|
|
|
let _this = this
|
|
|
// 选择主从业务员
|
|
|
@@ -1778,11 +1809,11 @@ Component({
|
|
|
onCloseDel(e) {
|
|
|
let deleteFlag = true;
|
|
|
let item = e.currentTarget.dataset.item
|
|
|
- //受 销售订单编辑逻辑 限制 转出库后(订单上的出库中加上已出库数量大于0 即证明有后续出库)
|
|
|
- // cannotModifyFlag ==true不能删除明细
|
|
|
- if (item.cannotModifyFlag) {
|
|
|
- return
|
|
|
- }
|
|
|
+ //受 销售订单编辑逻辑 限制 转出库后(订单上的出库中加上已出库数量大于0 即证明有后续出库)
|
|
|
+ // cannotModifyFlag ==true不能删除明细
|
|
|
+ if (item.cannotModifyFlag) {
|
|
|
+ return
|
|
|
+ }
|
|
|
// 判断删除前是否需要判断
|
|
|
if (this.data.delValidFlag) {
|
|
|
// 行不允许删除
|
|
|
@@ -2063,7 +2094,7 @@ Component({
|
|
|
* @date : 2024/1/19
|
|
|
*/
|
|
|
setGoodsOutReturnAmount(form) {
|
|
|
- let cardList = this.data.cardList
|
|
|
+ let cardList = this.data.cardList
|
|
|
let index = cardList.findIndex(it => it.name == 'items');
|
|
|
if (form.goodsList && form.goodsList.length > 0) {
|
|
|
let sumAmount = Number(0)
|
|
|
@@ -2076,7 +2107,7 @@ Component({
|
|
|
item.priceOut = item.priceOut
|
|
|
sumQuantity += Number(item.outingQty) //数量
|
|
|
sumAmount += item.priceOut * item.outingQty //没有售价默认取标价
|
|
|
- })
|
|
|
+ })
|
|
|
//合计金额
|
|
|
cardList[index].sumAmount = sumAmount
|
|
|
cardList[index].sumQuantity = sumQuantity
|
|
|
@@ -2096,9 +2127,9 @@ Component({
|
|
|
form.outingQty = sumQuantity
|
|
|
}
|
|
|
this.setData({
|
|
|
- cardList: cardList,
|
|
|
+ cardList: cardList,
|
|
|
})
|
|
|
- return form
|
|
|
+ return form
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 销售出库设置选品参数
|
|
|
@@ -2297,7 +2328,7 @@ Component({
|
|
|
delete item['pricePurchase']
|
|
|
delete item['priceWholesale']
|
|
|
})
|
|
|
- }
|
|
|
+ }
|
|
|
form = this.setGoodsOutReturnAmount(form)
|
|
|
this.setData({
|
|
|
form: form
|
|
|
@@ -2406,14 +2437,29 @@ Component({
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
- * @desc : 上传附件
|
|
|
+ * @desc : 点击上传附件
|
|
|
+ * @author : 周兴
|
|
|
+ * @date : 2024/6/24
|
|
|
+ */
|
|
|
+ clickAttach(e) {
|
|
|
+ this.triggerEvent("clickAttach", {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 点击上传附件(取消)
|
|
|
+ * @author : 周兴
|
|
|
+ * @date : 2024/6/24
|
|
|
+ */
|
|
|
+ uploadError(e){
|
|
|
+ this.triggerEvent("uploadError", {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 上传附件—(上传完成)
|
|
|
* @author : 周兴
|
|
|
* @date : 2024/3/27 16:16
|
|
|
*/
|
|
|
afterRead(e) {
|
|
|
- // this.setData({
|
|
|
- // uploadFileFlag:true
|
|
|
- // })
|
|
|
const _this = this;
|
|
|
const {
|
|
|
file
|
|
|
@@ -2422,7 +2468,7 @@ Component({
|
|
|
let folder = app.globalData.company.cpCode + '/' + this.data.table + '/' + new Date().toYearMonth2() + '/' + new Date().toDay()
|
|
|
let url = config.upload_url;
|
|
|
url = url.replace('mdm-server', 'mdm-server' + '-' + app.globalData.company.svcCode.replace('_', '-'))
|
|
|
- file.forEach(res => {
|
|
|
+ file.forEach((res, index) => {
|
|
|
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
|
|
wx.uploadFile({
|
|
|
url: url,
|
|
|
@@ -2437,9 +2483,6 @@ Component({
|
|
|
success(res) {
|
|
|
let data = JSON.parse(res.data)
|
|
|
if (data.code === 200) {
|
|
|
- _this.setData({
|
|
|
- uploadFileFlag: false
|
|
|
- })
|
|
|
let form = _this.data.form
|
|
|
let annexPaths = form['annexPaths'] || []
|
|
|
data.data.url = config.image_url + data.data.path
|
|
|
@@ -2449,6 +2492,11 @@ Component({
|
|
|
form: form,
|
|
|
value: JSON.stringify(form)
|
|
|
})
|
|
|
+ // 如果是最后一条
|
|
|
+ if (index == file.length - 1) {
|
|
|
+ _this.triggerEvent("uploadSucess", {
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
})
|
|
|
@@ -2468,17 +2516,17 @@ Component({
|
|
|
if (this.data.type == Constants.billType.sale || this.data.type == Constants.billType.pur || this.data.type == Constants.billType.out) {
|
|
|
this.setData({
|
|
|
popContentBox: [{
|
|
|
- code: 'box',
|
|
|
- type: 'step',
|
|
|
- title: mixins.$t("goodsBox"),
|
|
|
- required: true
|
|
|
- },
|
|
|
- {
|
|
|
- code: 'piece',
|
|
|
- type: 'step',
|
|
|
- title: mixins.$t("goodsPiece"),
|
|
|
- required: true
|
|
|
- },
|
|
|
+ code: 'box',
|
|
|
+ type: 'step',
|
|
|
+ title: mixins.$t("goodsBox"),
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'piece',
|
|
|
+ type: 'step',
|
|
|
+ title: mixins.$t("goodsPiece"),
|
|
|
+ required: true
|
|
|
+ },
|
|
|
],
|
|
|
|
|
|
})
|
|
|
@@ -2487,17 +2535,17 @@ Component({
|
|
|
if (this.data.type == Constants.billType.saleOut) {
|
|
|
this.setData({
|
|
|
popContentBox: [{
|
|
|
- code: 'box',
|
|
|
- type: 'step',
|
|
|
- title: mixins.$t("goodsBox"),
|
|
|
- required: true
|
|
|
- },
|
|
|
- {
|
|
|
- code: 'piece',
|
|
|
- type: 'step',
|
|
|
- title: mixins.$t("goodsPiece"),
|
|
|
- required: true
|
|
|
- },
|
|
|
+ code: 'box',
|
|
|
+ type: 'step',
|
|
|
+ title: mixins.$t("goodsBox"),
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'piece',
|
|
|
+ type: 'step',
|
|
|
+ title: mixins.$t("goodsPiece"),
|
|
|
+ required: true
|
|
|
+ },
|
|
|
],
|
|
|
|
|
|
})
|
|
|
@@ -2520,17 +2568,17 @@ Component({
|
|
|
if (this.data.type == Constants.billType.purInto || this.data.type == Constants.billType.saleOutReturn) {
|
|
|
this.setData({
|
|
|
popContentBox: [{
|
|
|
- code: 'box',
|
|
|
- type: 'step',
|
|
|
- title: mixins.$t("goodsBox"),
|
|
|
- required: true
|
|
|
- },
|
|
|
- {
|
|
|
- code: 'piece',
|
|
|
- type: 'step',
|
|
|
- title: mixins.$t("goodsPiece"),
|
|
|
- required: true
|
|
|
- },
|
|
|
+ code: 'box',
|
|
|
+ type: 'step',
|
|
|
+ title: mixins.$t("goodsBox"),
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'piece',
|
|
|
+ type: 'step',
|
|
|
+ title: mixins.$t("goodsPiece"),
|
|
|
+ required: true
|
|
|
+ },
|
|
|
],
|
|
|
|
|
|
})
|