|
|
@@ -121,29 +121,39 @@ Page({
|
|
|
code: 'pricePurchase',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("purchasePrice"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: true,
|
|
|
}, { //零售价
|
|
|
tip: mixins.$t("retailPricetip"),
|
|
|
code: 'priceStandard',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("retailPrice"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: true,
|
|
|
}, { //批发价
|
|
|
tip: mixins.$t("wholesalePricetip"),
|
|
|
code: 'priceWholesale',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("wholesalePrice"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: true,
|
|
|
}, { //销售限价
|
|
|
tip: mixins.$t("SaleSPriceLimittip"),
|
|
|
code: 'priceLimited',
|
|
|
type: 'number',
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
title: mixins.$t("SaleSPriceLimit"),
|
|
|
required: true,
|
|
|
}, { //其他价
|
|
|
tip: mixins.$t("otherPriceLimittip"),
|
|
|
code: 'priceOther',
|
|
|
type: 'number',
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
title: mixins.$t("otherPriceLimit"),
|
|
|
required: true,
|
|
|
}, ],
|
|
|
@@ -182,7 +192,7 @@ Page({
|
|
|
dataItem: JSON.stringify(dataItem)
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @desc : dk-form 里 str的点击回调 的输入回调
|
|
|
@@ -238,8 +248,8 @@ Page({
|
|
|
formData: JSON.stringify(formData)
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
+
|
|
|
+ /**
|
|
|
* @desc : dk-form 里 dk-number-input 的输入回调
|
|
|
* @date : 2024/2/1 15:49
|
|
|
* @author : 王英杰
|
|
|
@@ -247,7 +257,7 @@ Page({
|
|
|
triggerBindBlur(e) {
|
|
|
let code = e.detail.code
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
- formData[code] = formData[code] ?formData[code]:0
|
|
|
+ formData[code] = formData[code] ? formData[code] : 0
|
|
|
if (code == "packBox") { //包装
|
|
|
if (formData.intoQty || formData.packageBox) {
|
|
|
//提示
|
|
|
@@ -356,12 +366,12 @@ Page({
|
|
|
]
|
|
|
} else {
|
|
|
let formDataJson = JSON.parse(this.data.formData)
|
|
|
- if (formDataJson) {
|
|
|
- ['subUnitName', 'calculationFormula', 'packBox'].forEach(key => {
|
|
|
- if (formDataJson.hasOwnProperty(key)) {
|
|
|
+ if (formDataJson) {
|
|
|
+ ['subUnitName', 'calculationFormula', 'packBox'].forEach(key => {
|
|
|
+ if (formDataJson.hasOwnProperty(key)) {
|
|
|
delete formDataJson[key];
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
this.setData({
|
|
|
formData: JSON.stringify(formDataJson)
|
|
|
@@ -379,7 +389,7 @@ Page({
|
|
|
title: mixins.$t("subUnitId"),
|
|
|
code: 'flgSubUnit',
|
|
|
}, ]
|
|
|
- }
|
|
|
+ }
|
|
|
// 解决 (商品档案,如果先点开期初库存,然后再点开辅助单位,那么包装数量就不会显示出来) 问题
|
|
|
if (formData.flgOpeningInv) { //开了期初库存
|
|
|
if (checkFlag) { //开了辅助单位
|
|
|
@@ -442,7 +452,7 @@ Page({
|
|
|
type: 'textarea',
|
|
|
title: mixins.$t("iinventoryBatchNumber"),
|
|
|
required: checkFlag,
|
|
|
- tip: mixins.$t('tipPop'),
|
|
|
+ tip: mixins.$t('tipPop'),
|
|
|
},
|
|
|
{ //期初数量
|
|
|
code: 'intoQty',
|
|
|
@@ -450,7 +460,7 @@ Page({
|
|
|
sign: "",
|
|
|
digits: formData.decimalPlaces,
|
|
|
title: mixins.$t("openingInventoryQty"),
|
|
|
- required: checkFlag,
|
|
|
+ required: checkFlag,
|
|
|
},
|
|
|
{ //期初成本价
|
|
|
code: 'priceInto',
|
|
|
@@ -461,7 +471,7 @@ Page({
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
} else if (code == "flgOpeningInv") { //期初库存标识
|
|
|
if (checkFlag) {
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
@@ -534,7 +544,7 @@ Page({
|
|
|
type: 'textarea',
|
|
|
title: mixins.$t("iinventoryBatchNumber"),
|
|
|
required: checkFlag,
|
|
|
- tip: mixins.$t('tipPop'),
|
|
|
+ tip: mixins.$t('tipPop'),
|
|
|
},
|
|
|
{ //期初数量
|
|
|
code: 'intoQty',
|
|
|
@@ -542,7 +552,7 @@ Page({
|
|
|
sign: "",
|
|
|
digits: formData.decimalPlaces,
|
|
|
title: mixins.$t("openingInventoryQty"),
|
|
|
- required: checkFlag,
|
|
|
+ required: checkFlag,
|
|
|
},
|
|
|
{ //期初成本价
|
|
|
code: 'priceInto',
|
|
|
@@ -560,12 +570,12 @@ Page({
|
|
|
* @data 2024.06.04
|
|
|
*/
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
- if (formData) {
|
|
|
- ['packageBox', 'priceInto', 'intoQty', 'nonStdCode', 'whName', 'whId'].forEach(key => {
|
|
|
- if (formData.hasOwnProperty(key)) {
|
|
|
+ if (formData) {
|
|
|
+ ['packageBox', 'priceInto', 'intoQty', 'nonStdCode', 'whName', 'whId'].forEach(key => {
|
|
|
+ if (formData.hasOwnProperty(key)) {
|
|
|
delete formData[key];
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
this.setData({
|
|
|
formData: JSON.stringify(formData)
|
|
|
@@ -587,30 +597,40 @@ Page({
|
|
|
code: 'pricePurchase',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("purchasePrice"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: checkFlag,
|
|
|
}, { //零售价
|
|
|
tip: mixins.$t("retailPricetip"),
|
|
|
code: 'priceStandard',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("retailPrice"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: checkFlag,
|
|
|
}, { //批发价
|
|
|
tip: mixins.$t("wholesalePricetip"),
|
|
|
code: 'priceWholesale',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("wholesalePrice"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: checkFlag,
|
|
|
}, { //销售限价
|
|
|
tip: mixins.$t("SaleSPriceLimittip"),
|
|
|
code: 'priceLimited',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("SaleSPriceLimit"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: checkFlag,
|
|
|
}, { //其他价
|
|
|
tip: mixins.$t("otherPriceLimittip"),
|
|
|
code: 'priceOther',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("otherPriceLimit"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: checkFlag,
|
|
|
}, ]
|
|
|
} else {
|
|
|
@@ -643,7 +663,7 @@ Page({
|
|
|
handledata: false
|
|
|
})
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
- let data = this.data.chooseUnitData
|
|
|
+ let data = this.data.chooseUnitData
|
|
|
let Dialog_message = null
|
|
|
let code = this.data.chooseDataCode
|
|
|
if (code == "unitId") { //计量单位
|
|
|
@@ -665,7 +685,7 @@ Page({
|
|
|
formData.piece = null
|
|
|
Dialog_message = '更换包装单位将清空期初数量、包装数量'
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//提示
|
|
|
Dialog.confirm({
|
|
|
message: Dialog_message,
|
|
|
@@ -852,67 +872,72 @@ Page({
|
|
|
return this.excute(this.data.service, this.data.service.update, this.data.params)
|
|
|
} else { //新建接口
|
|
|
let excute = this.excute(this.data.service, this.data.service.insert, this.data.params)
|
|
|
- excute.then(res => {
|
|
|
- // 增加包装;数字类型正整数,默认1
|
|
|
- let formData = {}
|
|
|
- let contentObj = this.data.contentObj
|
|
|
- formData.flgPrice = true
|
|
|
- formData.flgOpeningInv = false
|
|
|
- formData.flgSubUnit = true
|
|
|
-
|
|
|
- that.setData({
|
|
|
- formData: JSON.stringify(formData),
|
|
|
- loading: false,
|
|
|
- contentObj: {
|
|
|
- main: [{ //商品型号
|
|
|
- code: 'skuModel',
|
|
|
- type: 'textarea',
|
|
|
- title: mixins.$t("skuModel"),
|
|
|
- required: true,
|
|
|
- }, { //商品名称
|
|
|
- code: 'skuName',
|
|
|
- type: 'textarea',
|
|
|
- title: mixins.$t("skuName"),
|
|
|
- }, {
|
|
|
- code: 'skuImages',
|
|
|
- name: mixins.$t("commodityPicture"), //商品图片
|
|
|
- type: 'uploader',
|
|
|
- },
|
|
|
+ excute.then(res => {
|
|
|
+ if (res && res.data && res.data.code === Constants.SUCESS_CODE) {
|
|
|
+ // 增加包装;数字类型正整数,默认1
|
|
|
+ let formData = {}
|
|
|
+ let contentObj = this.data.contentObj
|
|
|
+ formData.flgPrice = true
|
|
|
+ formData.flgOpeningInv = false
|
|
|
+ formData.flgSubUnit = true
|
|
|
+ formData.pricePurchase = 0
|
|
|
+ formData.priceStandard = 0
|
|
|
+ formData.priceWholesale = 0
|
|
|
+ formData.priceLimited = 0
|
|
|
+ formData.priceOther = 0
|
|
|
+ that.setData({
|
|
|
+ formData: JSON.stringify(formData),
|
|
|
+ loading: false,
|
|
|
+ contentObj: {
|
|
|
+ main: [{ //商品型号
|
|
|
+ code: 'skuModel',
|
|
|
+ type: 'textarea',
|
|
|
+ title: mixins.$t("skuModel"),
|
|
|
+ required: true,
|
|
|
+ }, { //商品名称
|
|
|
+ code: 'skuName',
|
|
|
+ type: 'textarea',
|
|
|
+ title: mixins.$t("skuName"),
|
|
|
+ }, {
|
|
|
+ code: 'skuImages',
|
|
|
+ name: mixins.$t("commodityPicture"), //商品图片
|
|
|
+ type: 'uploader',
|
|
|
+ },
|
|
|
|
|
|
- ],
|
|
|
- goods: [{ //商品品牌
|
|
|
- code: 'brandId',
|
|
|
- name: 'brandName',
|
|
|
- title: mixins.$t("goodsBrand"),
|
|
|
- type: 'choose',
|
|
|
- urlKey: 'goodsBrand',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- { //商品种类
|
|
|
- code: 'categoryId',
|
|
|
- name: 'catName',
|
|
|
- title: mixins.$t("goodsCategory"),
|
|
|
- type: 'choose',
|
|
|
- urlKey: 'goodsCategory',
|
|
|
- required: true,
|
|
|
+ ],
|
|
|
+ goods: [{ //商品品牌
|
|
|
+ code: 'brandId',
|
|
|
+ name: 'brandName',
|
|
|
+ title: mixins.$t("goodsBrand"),
|
|
|
+ type: 'choose',
|
|
|
+ urlKey: 'goodsBrand',
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
+ { //商品种类
|
|
|
+ code: 'categoryId',
|
|
|
+ name: 'catName',
|
|
|
+ title: mixins.$t("goodsCategory"),
|
|
|
+ type: 'choose',
|
|
|
+ urlKey: 'goodsCategory',
|
|
|
+ required: true,
|
|
|
|
|
|
- }, { //商品系列
|
|
|
- code: 'seriesId',
|
|
|
- name: 'seriesName',
|
|
|
- title: mixins.$t("goodsSeries"),
|
|
|
- type: 'choose',
|
|
|
- urlKey: 'goodsSeries',
|
|
|
+ }, { //商品系列
|
|
|
+ code: 'seriesId',
|
|
|
+ name: 'seriesName',
|
|
|
+ title: mixins.$t("goodsSeries"),
|
|
|
+ type: 'choose',
|
|
|
+ urlKey: 'goodsSeries',
|
|
|
|
|
|
|
|
|
- }, { //商品规格
|
|
|
- code: 'skuSpec',
|
|
|
- name: 'skuSpec',
|
|
|
- type: 'textarea',
|
|
|
- required: true,
|
|
|
- title: mixins.$t("sukSpec"),
|
|
|
- }
|
|
|
- ],
|
|
|
- unit: [{ //基本单位
|
|
|
+ }, { //商品规格
|
|
|
+ code: 'skuSpec',
|
|
|
+ name: 'skuSpec',
|
|
|
+ type: 'textarea',
|
|
|
+ required: true,
|
|
|
+ title: mixins.$t("sukSpec"),
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ unit: [{ //基本单位
|
|
|
code: 'unitId',
|
|
|
name: 'unitName',
|
|
|
title: mixins.$t("unit"),
|
|
|
@@ -924,56 +949,67 @@ Page({
|
|
|
type: 'switch',
|
|
|
title: mixins.$t("subUnitId"),
|
|
|
code: 'flgSubUnit',
|
|
|
- }
|
|
|
- ],
|
|
|
- warehouse: [{ //期初库存标识
|
|
|
- type: 'switch',
|
|
|
- title: mixins.$t("openingInv"),
|
|
|
- code: 'flgOpeningInv',
|
|
|
- }, ],
|
|
|
- price: [{ //期初库存标识
|
|
|
- type: 'switch',
|
|
|
- title: mixins.$t("flgPrice"),
|
|
|
- code: 'flgPrice',
|
|
|
- }, { //采购价
|
|
|
- tip: mixins.$t("purchasePricetip"),
|
|
|
- code: 'pricePurchase',
|
|
|
- type: 'number',
|
|
|
- title: mixins.$t("purchasePrice"),
|
|
|
- required: true,
|
|
|
- }, { //零售价
|
|
|
- tip: mixins.$t("retailPricetip"),
|
|
|
- code: 'priceStandard',
|
|
|
- type: 'number',
|
|
|
- title: mixins.$t("retailPrice"),
|
|
|
- required: true,
|
|
|
- }, { //批发价
|
|
|
- tip: mixins.$t("wholesalePricetip"),
|
|
|
- code: 'priceWholesale',
|
|
|
- type: 'number',
|
|
|
- title: mixins.$t("wholesalePrice"),
|
|
|
- required: true,
|
|
|
- }, { //销售限价
|
|
|
- tip: mixins.$t("SaleSPriceLimittip"),
|
|
|
- code: 'priceLimited',
|
|
|
- type: 'number',
|
|
|
- title: mixins.$t("SaleSPriceLimit"),
|
|
|
- required: true,
|
|
|
- }, { //其他价
|
|
|
- tip: mixins.$t("otherPriceLimittip"),
|
|
|
- code: 'priceOther',
|
|
|
- type: 'number',
|
|
|
- title: mixins.$t("otherPriceLimit"),
|
|
|
- required: true,
|
|
|
- }, ],
|
|
|
+ }],
|
|
|
+ warehouse: [{ //期初库存标识
|
|
|
+ type: 'switch',
|
|
|
+ title: mixins.$t("openingInv"),
|
|
|
+ code: 'flgOpeningInv',
|
|
|
+ }, ],
|
|
|
+ price: [{ //期初库存标识
|
|
|
+ type: 'switch',
|
|
|
+ title: mixins.$t("flgPrice"),
|
|
|
+ code: 'flgPrice',
|
|
|
+ }, { //采购价
|
|
|
+ tip: mixins.$t("purchasePricetip"),
|
|
|
+ code: 'pricePurchase',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t("purchasePrice"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
+ required: true,
|
|
|
+ }, { //零售价
|
|
|
+ tip: mixins.$t("retailPricetip"),
|
|
|
+ code: 'priceStandard',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t("retailPrice"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
+ required: true,
|
|
|
+ }, { //批发价
|
|
|
+ tip: mixins.$t("wholesalePricetip"),
|
|
|
+ code: 'priceWholesale',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t("wholesalePrice"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
+ required: true,
|
|
|
+ }, { //销售限价
|
|
|
+ tip: mixins.$t("SaleSPriceLimittip"),
|
|
|
+ code: 'priceLimited',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t("SaleSPriceLimit"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
+ required: true,
|
|
|
+ }, { //其他价
|
|
|
+ tip: mixins.$t("otherPriceLimittip"),
|
|
|
+ code: 'priceOther',
|
|
|
+ type: 'number',
|
|
|
+ title: mixins.$t("otherPriceLimit"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
+ required: true,
|
|
|
+ }, ],
|
|
|
+
|
|
|
+ other: [{
|
|
|
+ code: 'remarks',
|
|
|
+ type: 'textarea',
|
|
|
+ title: mixins.$t("remarks"),
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- other: [{
|
|
|
- code: 'remarks',
|
|
|
- type: 'textarea',
|
|
|
- title: mixins.$t("remarks"),
|
|
|
- }]
|
|
|
- }
|
|
|
- })
|
|
|
})
|
|
|
return excute;
|
|
|
}
|
|
|
@@ -1085,7 +1121,7 @@ Page({
|
|
|
// data.serviceCategories = (data.serviceCategories && data.serviceCategories.length > 0) ? data.serviceCategories.join(',') : undefined
|
|
|
data.annexPaths = data.skuImages
|
|
|
data.onlyCode = data.skuCode
|
|
|
-
|
|
|
+
|
|
|
let contentObj = this.data.contentObj
|
|
|
// 我们要添加的新对象是 编码 新建的时候没有 编辑的时候添加
|
|
|
contentObj.main = [{ //唯一编码
|
|
|
@@ -1210,7 +1246,7 @@ Page({
|
|
|
}
|
|
|
if (data.flgOpeningInv) {
|
|
|
if (data.flgSubUnit) { //开了辅助单位
|
|
|
- data.packageBox = data['box'] + data.subUnitName + data['piece'] + data.unitName
|
|
|
+ data.packageBox = data['box'] + data.subUnitName + data['piece'] + data.unitName
|
|
|
contentObj.warehouse = [{ //期初库存标识
|
|
|
type: 'switch',
|
|
|
title: mixins.$t("openingInv"),
|
|
|
@@ -1321,30 +1357,40 @@ Page({
|
|
|
code: 'pricePurchase',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("purchasePrice"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: true,
|
|
|
}, { //零售价
|
|
|
tip: mixins.$t("retailPricetip"),
|
|
|
code: 'priceStandard',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("retailPrice"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: true,
|
|
|
}, { //批发价
|
|
|
tip: mixins.$t("wholesalePricetip"),
|
|
|
code: 'priceWholesale',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("wholesalePrice"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: true,
|
|
|
}, { //销售限价
|
|
|
tip: mixins.$t("SaleSPriceLimittip"),
|
|
|
code: 'priceLimited',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("SaleSPriceLimit"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: true,
|
|
|
}, { //其他价
|
|
|
tip: mixins.$t("otherPriceLimittip"),
|
|
|
code: 'priceOther',
|
|
|
type: 'number',
|
|
|
title: mixins.$t("otherPriceLimit"),
|
|
|
+ max: 9999999,
|
|
|
+ maxFlag: true,
|
|
|
required: true,
|
|
|
}, ]
|
|
|
} else {
|