|
|
@@ -10,6 +10,7 @@ const mixins = require('@/mixins/index.js')
|
|
|
const app = getApp()
|
|
|
const util = require('@/utils/util.js')
|
|
|
const Constants = require('@/utils/Constants')
|
|
|
+import Dialog from '@/dist/dialog/dialog.js';
|
|
|
Page({
|
|
|
mixins: [mixins],
|
|
|
/**
|
|
|
@@ -79,7 +80,7 @@ Page({
|
|
|
type: 'choose',
|
|
|
urlKey: 'unit',
|
|
|
required: true,
|
|
|
-
|
|
|
+ clear:false,
|
|
|
}, { //辅助单位标识
|
|
|
type: 'switch',
|
|
|
title: mixins.$t("subUnitId"),
|
|
|
@@ -103,43 +104,14 @@ Page({
|
|
|
code: 'calculationFormula',
|
|
|
type: 'textarea',
|
|
|
title: mixins.$t("calculationFormula"),
|
|
|
- readonly:true,
|
|
|
+ readonly: true,
|
|
|
}
|
|
|
],
|
|
|
warehouse: [{ //期初库存标识
|
|
|
- type: 'switch',
|
|
|
- title: mixins.$t("openingInv"),
|
|
|
- code: 'flgOpeningInv',
|
|
|
- }, { //仓库名称
|
|
|
- code: 'whId',
|
|
|
- name: 'whName',
|
|
|
- title: mixins.$t("whName"),
|
|
|
- type: 'choose',
|
|
|
- urlKey: 'openingInventory',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- { //库存批号
|
|
|
- code: 'nonStdCode',
|
|
|
- type: 'textarea',
|
|
|
- title: mixins.$t("iinventoryBatchNumber"),
|
|
|
- required: true,
|
|
|
- },
|
|
|
- { //期初数量
|
|
|
- code: 'intoQty',
|
|
|
- type: 'number',
|
|
|
- sign: "",
|
|
|
- digits: 0,
|
|
|
- title: mixins.$t("openingInventoryQty"),
|
|
|
- required: true,
|
|
|
- },
|
|
|
- { //期初成本价
|
|
|
- code: 'priceInto',
|
|
|
- type: 'textarea',
|
|
|
- title: mixins.$t("iinitialCostPrice"),
|
|
|
- required: true,
|
|
|
- },
|
|
|
-
|
|
|
- ],
|
|
|
+ type: 'switch',
|
|
|
+ title: mixins.$t("openingInv"),
|
|
|
+ code: 'flgOpeningInv',
|
|
|
+ }, ],
|
|
|
price: [{ //期初库存标识
|
|
|
type: 'switch',
|
|
|
title: mixins.$t("flgPrice"),
|
|
|
@@ -185,22 +157,22 @@ Page({
|
|
|
// 路由
|
|
|
routeObjName: 'goodsSku',
|
|
|
},
|
|
|
- /**
|
|
|
+ /**
|
|
|
* @desc : dk-form 里 dk-number-input 的输入回调
|
|
|
* @date : 2024/2/1 15:49
|
|
|
* @author : 王英杰
|
|
|
*/
|
|
|
- changeNumberField(e){
|
|
|
- console.log("changeNumberField",e);
|
|
|
+ changeNumberField(e) {
|
|
|
+ console.log("changeNumberField", e);
|
|
|
let code = e.detail.code
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
- if(code = "packBox"){//包装
|
|
|
- if(formData.packBox&&formData.unitName&&formData.subUnitName){ //选了辅助计量单位 正好 包装也有值 那么直接给出公式
|
|
|
- formData.calculationFormula = formData.packBox+ formData.unitName + '= 1'+ formData.subUnitName
|
|
|
+ if (code = "packBox") { //包装
|
|
|
+ if (formData.packBox && formData.unitName && formData.subUnitName) { //选了辅助计量单位 正好 包装也有值 那么直接给出公式
|
|
|
+ formData.calculationFormula = formData.packBox + formData.unitName + '= 1' + formData.subUnitName
|
|
|
}
|
|
|
}
|
|
|
this.setData({
|
|
|
- formData:JSON.stringify(formData)
|
|
|
+ formData: JSON.stringify(formData)
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
@@ -222,7 +194,7 @@ Page({
|
|
|
type: 'choose',
|
|
|
urlKey: 'unit',
|
|
|
required: true,
|
|
|
-
|
|
|
+ clear:false,
|
|
|
}, { //辅助单位标识
|
|
|
type: 'switch',
|
|
|
title: mixins.$t("subUnitId"),
|
|
|
@@ -247,7 +219,7 @@ Page({
|
|
|
code: 'calculationFormula',
|
|
|
type: 'textarea',
|
|
|
title: mixins.$t("calculationFormula"),
|
|
|
- readonly:true,
|
|
|
+ readonly: true,
|
|
|
}
|
|
|
]
|
|
|
} else {
|
|
|
@@ -258,7 +230,7 @@ Page({
|
|
|
type: 'choose',
|
|
|
urlKey: 'unit',
|
|
|
required: true,
|
|
|
-
|
|
|
+ clear:false,
|
|
|
}, { //辅助单位标识
|
|
|
type: 'switch',
|
|
|
title: mixins.$t("subUnitId"),
|
|
|
@@ -268,6 +240,16 @@ Page({
|
|
|
|
|
|
} else if (code == "flgOpeningInv") { //期初库存标识
|
|
|
if (checkFlag) {
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
+ //打开期初库存的时候 要先判断 需要先选择基本单位
|
|
|
+ if (!formData.unitId) {
|
|
|
+ formData.flgOpeningInv = false
|
|
|
+ util.showToast('请先选择基本单位');
|
|
|
+ this.setData({
|
|
|
+ formData: JSON.stringify(formData)
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
contentObj.warehouse = [{ //期初库存标识
|
|
|
type: 'switch',
|
|
|
title: mixins.$t("openingInv"),
|
|
|
@@ -285,18 +267,19 @@ Page({
|
|
|
type: 'textarea',
|
|
|
title: mixins.$t("iinventoryBatchNumber"),
|
|
|
required: checkFlag,
|
|
|
+ tip: mixins.$t('tipPop'),
|
|
|
},
|
|
|
{ //期初数量
|
|
|
code: 'intoQty',
|
|
|
type: 'number',
|
|
|
sign: "",
|
|
|
- digits: 0,
|
|
|
+ digits: formData.decimalPlaces,
|
|
|
title: mixins.$t("openingInventoryQty"),
|
|
|
required: checkFlag,
|
|
|
},
|
|
|
{ //期初成本价
|
|
|
code: 'priceInto',
|
|
|
- type: 'textarea',
|
|
|
+ type: 'number',
|
|
|
title: mixins.$t("iinitialCostPrice"),
|
|
|
required: checkFlag,
|
|
|
},
|
|
|
@@ -359,13 +342,40 @@ Page({
|
|
|
contentObj: contentObj
|
|
|
})
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ console.log("onShow");
|
|
|
+ this.dialogShowChooseData();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 因为chooseData 的执行顺序要高于onshow 且 chooseData无法弹 dialog 所以在onshow执行
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 王英杰
|
|
|
+ */
|
|
|
+ dialogShowChooseData(){
|
|
|
+ if(!this.data.handledata){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ handledata:false
|
|
|
+ })
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
+ let data = this.data.chooseUnitData
|
|
|
+ formData.intoQty = null
|
|
|
+ //提示
|
|
|
+ Dialog.confirm({
|
|
|
+ message: '期初数量已输入,更换基础单位需要清空期初数量',
|
|
|
+ }).then(() => {
|
|
|
+ this.handleChooseDataUnit(formData, data)
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
/**
|
|
|
* @desc : 选择页面跳转回调事件
|
|
|
* @date : 2024/2/1 15:49
|
|
|
* @author : 王英杰
|
|
|
*/
|
|
|
chooseData(e) {
|
|
|
- console.log("t", e, this.data.formData);
|
|
|
+
|
|
|
+ console.log("chooseData", e, this.data.formData);
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
let code = e.detail.code
|
|
|
let data = e.detail.data.data
|
|
|
@@ -378,17 +388,22 @@ Page({
|
|
|
formData.catName = data.name
|
|
|
}
|
|
|
if (code == "unitId") { //计量单位
|
|
|
- formData.unitId = data.id
|
|
|
- formData.unitName = data.name
|
|
|
- if(formData.packBox&&formData.unitName&&formData.subUnitName){ //选了辅助计量单位 正好 包装也有值 那么直接给出公式
|
|
|
- formData.calculationFormula = formData.packBox+ formData.unitName + '= 1'+ formData.subUnitName
|
|
|
+ //当期初数量有值的时候 弹提示是否清除
|
|
|
+ if (formData.intoQty) { //在onshow执行 这里无法弹出dialog
|
|
|
+ this.setData({
|
|
|
+ chooseUnitData:data,
|
|
|
+ handledata:true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.handleChooseDataUnit(formData, data)
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
if (code == "subUnitId") { //辅助计量单位
|
|
|
formData.subUnitId = data.id
|
|
|
formData.subUnitName = data.name
|
|
|
- if(formData.packBox&&formData.unitName&&formData.subUnitName){ //选了辅助计量单位 正好 包装也有值 那么直接给出公式
|
|
|
- formData.calculationFormula = formData.packBox+ formData.unitName + '= 1'+ formData.subUnitName
|
|
|
+ if (formData.packBox && formData.unitName && formData.subUnitName) { //选了辅助计量单位 正好 包装也有值 那么直接给出公式
|
|
|
+ formData.calculationFormula = formData.packBox + formData.unitName + '= 1' + formData.subUnitName
|
|
|
}
|
|
|
}
|
|
|
if (code == "seriesId") { //商品系列
|
|
|
@@ -404,34 +419,65 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
+ * @desc : 处理 选择页面回来的 基本单位
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 王英杰
|
|
|
+ */
|
|
|
+ handleChooseDataUnit(formData, data) {
|
|
|
+ formData.unitId = data.id
|
|
|
+ formData.unitName = data.name
|
|
|
+ formData.decimalPlaces = data.decimalPlaces
|
|
|
+ if (formData.packBox && formData.unitName && formData.subUnitName) { //选了辅助计量单位 正好 包装也有值 那么直接给出公式
|
|
|
+ formData.calculationFormula = formData.packBox + formData.unitName + '= 1' + formData.subUnitName
|
|
|
+ }
|
|
|
+ let contentObj = this.data.contentObj
|
|
|
+ if (contentObj.warehouse.length > 0) {
|
|
|
+ // 遍历 contentObj.warehouse 数组
|
|
|
+ for (let i = 0; i < contentObj.warehouse.length; i++) {
|
|
|
+ // 检查当前对象的 code 是否为 'intoQty'
|
|
|
+ if (contentObj.warehouse[i].code === 'intoQty') {
|
|
|
+ // 如果是,则修改其 digits 属性
|
|
|
+ contentObj.warehouse[i].digits = formData.decimalPlaces;
|
|
|
+ // 找到后,可以跳出循环(如果确定只有一个匹配项)
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ contentObj: contentObj,
|
|
|
+ formData: JSON.stringify(formData)
|
|
|
+ })
|
|
|
+ return
|
|
|
+ },
|
|
|
+ /**
|
|
|
* @desc : 保存数据服务--校验
|
|
|
* @date : 2024/2/1 15:49
|
|
|
* @author : 王英杰
|
|
|
*/
|
|
|
validData() {
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
- if(!formData.flgSubUnit){//辅助单位标识未勾选 不存包装单位 包装
|
|
|
- delete formData.subUnitId
|
|
|
- delete formData.subUnitName
|
|
|
- delete formData.packBox
|
|
|
+ if (!formData.flgSubUnit) { //辅助单位标识未勾选 不存包装单位 包装
|
|
|
+ delete formData.subUnitId
|
|
|
+ delete formData.subUnitName
|
|
|
+ delete formData.packBox
|
|
|
}
|
|
|
//编辑的时候 就不用删除了 因为不允许修改
|
|
|
- if((!formData.flgOpeningInv)&&this.data.formMode !== Constants.formMode.edit){//期初库存标识未勾选 不存仓库名称 色号 起初数量 期初成本价
|
|
|
+ if ((!formData.flgOpeningInv) && this.data.formMode !== Constants.formMode.edit) { //期初库存标识未勾选 不存仓库名称 色号 起初数量 期初成本价
|
|
|
delete formData.whId
|
|
|
delete formData.whName
|
|
|
delete formData.nonStdCode
|
|
|
delete formData.priceInto
|
|
|
- }
|
|
|
- if(!formData.flgPrice){//价格体系标识未勾选 不存采购价 零售价 批发价 销售限价 其他价
|
|
|
+ }
|
|
|
+ if (!formData.flgPrice) { //价格体系标识未勾选 不存采购价 零售价 批发价 销售限价 其他价
|
|
|
delete formData.pricePurchase
|
|
|
delete formData.priceStandard
|
|
|
delete formData.priceWholesale
|
|
|
delete formData.priceLimited
|
|
|
delete formData.priceOther
|
|
|
- }
|
|
|
- this.setData({
|
|
|
- formData:JSON.stringify(formData)
|
|
|
- })
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ formData: JSON.stringify(formData)
|
|
|
+ })
|
|
|
return true
|
|
|
},
|
|
|
// 设置保存参数
|
|
|
@@ -461,6 +507,9 @@ Page({
|
|
|
// 增加包装;数字类型正整数,默认1
|
|
|
let formData = {}
|
|
|
formData.packBox = 1
|
|
|
+ formData.flgPrice = true
|
|
|
+ formData.flgOpeningInv = false
|
|
|
+ formData.flgSubUnit = true
|
|
|
that.setData({
|
|
|
formData: JSON.stringify(formData)
|
|
|
})
|
|
|
@@ -494,6 +543,7 @@ Page({
|
|
|
* @author : 王英杰
|
|
|
*/
|
|
|
loadInit() {
|
|
|
+
|
|
|
//标准版商品档案新建、编辑、详情不展示价格体系
|
|
|
if (this.data.gradeCode == Constants.gradeCode.STD) { //标准版
|
|
|
this.setData({
|
|
|
@@ -513,7 +563,7 @@ Page({
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
formData.packBox = 1
|
|
|
formData.flgPrice = true
|
|
|
- formData.flgOpeningInv = true
|
|
|
+ formData.flgOpeningInv = false
|
|
|
formData.flgSubUnit = true
|
|
|
this.setData({
|
|
|
formData: JSON.stringify(formData)
|
|
|
@@ -532,181 +582,186 @@ Page({
|
|
|
// data.serviceCategories = (data.serviceCategories && data.serviceCategories.length > 0) ? data.serviceCategories.join(',') : undefined
|
|
|
data.annexPaths = data.skuImages
|
|
|
data.onlyCode = data.skuCode
|
|
|
+ data.isflgOpeningInv = false //因为期初库存编辑的时候不让改 所以 即使数据库是true 那么也要置灰 取这个code
|
|
|
+ data.isflgOpeningInv = false // 库存量不为0不让更改 辅助单位取这个code
|
|
|
let contentObj = this.data.contentObj
|
|
|
// 我们要添加的新对象是 编码 新建的时候没有 编辑的时候添加
|
|
|
contentObj.main = [{ //唯一编码
|
|
|
- code: 'onlyCode',
|
|
|
- type: 'textarea',
|
|
|
- title: mixins.$t("onlyCode"),
|
|
|
- readonly: true
|
|
|
- }, { //商品型号
|
|
|
- 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',
|
|
|
- },
|
|
|
+ code: 'onlyCode',
|
|
|
+ type: 'textarea',
|
|
|
+ title: mixins.$t("onlyCode"),
|
|
|
+ readonly: true
|
|
|
+ }, { //商品型号
|
|
|
+ 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',
|
|
|
+ },
|
|
|
|
|
|
- ]
|
|
|
- if (data.flgSubUnit) {
|
|
|
- contentObj.unit = [{ //基本单位
|
|
|
- code: 'unitId',
|
|
|
- name: 'unitName',
|
|
|
- title: mixins.$t("unit"),
|
|
|
- type: 'choose',
|
|
|
- urlKey: 'unit',
|
|
|
- required: true,
|
|
|
- readonly: data.inventoryCount!==0 //要校验库存; 库存量不为0不让更改
|
|
|
- }, { //辅助单位标识
|
|
|
- type: 'switch',
|
|
|
- title: mixins.$t("subUnitId"),
|
|
|
- code: 'flgSubUnit',
|
|
|
- readonly: data.inventoryCount!==0 //要校验库存; 库存量不为0不让更改
|
|
|
- }, { //包装单位
|
|
|
- code: 'subUnitId',
|
|
|
- name: 'subUnitName',
|
|
|
- title: mixins.$t("packageUnit"),
|
|
|
- type: 'choose',
|
|
|
- urlKey: 'unit',
|
|
|
- required: true,
|
|
|
- readonly: data.inventoryCount!==0 //要校验库存; 库存量不为0不让更改
|
|
|
- }, { //包装
|
|
|
- code: 'packBox',
|
|
|
- title: mixins.$t("package"),
|
|
|
- type: 'number',
|
|
|
- sign: "",
|
|
|
- digits: 0,
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- code: 'calculationFormula',
|
|
|
- type: 'textarea',
|
|
|
- title: mixins.$t("calculationFormula"),
|
|
|
- readonly:true,
|
|
|
- }
|
|
|
- ]
|
|
|
- } else {
|
|
|
- contentObj.unit = [{ //基本单位
|
|
|
+ ]
|
|
|
+ if (data.flgSubUnit) {
|
|
|
+ contentObj.unit = [{ //基本单位
|
|
|
code: 'unitId',
|
|
|
name: 'unitName',
|
|
|
title: mixins.$t("unit"),
|
|
|
type: 'choose',
|
|
|
urlKey: 'unit',
|
|
|
required: true,
|
|
|
-
|
|
|
+ readonly: data.inventoryCount !== 0 //要校验库存; 库存量不为0不让更改
|
|
|
}, { //辅助单位标识
|
|
|
type: 'switch',
|
|
|
title: mixins.$t("subUnitId"),
|
|
|
- code: 'flgSubUnit',
|
|
|
- }, ]
|
|
|
- }
|
|
|
- if (data.flgOpeningInv) {
|
|
|
- contentObj.warehouse = [{ //期初库存标识
|
|
|
- type: 'switch',
|
|
|
- title: mixins.$t("openingInv"),
|
|
|
- code: 'flgOpeningInv',
|
|
|
- }, { //仓库名称
|
|
|
- code: 'whId',
|
|
|
- name: 'whName',
|
|
|
- title: mixins.$t("whName"),
|
|
|
- type: 'choose',
|
|
|
- urlKey: 'openingInventory',
|
|
|
- required: true,
|
|
|
- readonly:true,
|
|
|
- },
|
|
|
- { //库存批号
|
|
|
- code: 'nonStdCode',
|
|
|
- type: 'textarea',
|
|
|
- title: mixins.$t("iinventoryBatchNumber"),
|
|
|
- required: true,
|
|
|
- readonly:true,
|
|
|
- },
|
|
|
- { //期初数量
|
|
|
- code: 'intoQty',
|
|
|
- type: 'number',
|
|
|
- sign: "",
|
|
|
- digits: 0,
|
|
|
- title: mixins.$t("openingInventoryQty"),
|
|
|
- required: true,
|
|
|
- readonly:true,
|
|
|
- },
|
|
|
- { //期初成本价
|
|
|
- code: 'priceInto',
|
|
|
- type: 'textarea',
|
|
|
- title: mixins.$t("iinitialCostPrice"),
|
|
|
- required: true,
|
|
|
- readonly:true,
|
|
|
- },
|
|
|
- ]
|
|
|
- } else {
|
|
|
- contentObj.warehouse = [{ //期初库存标识
|
|
|
- type: 'switch',
|
|
|
- title: mixins.$t("openingInv"),
|
|
|
- code: 'flgOpeningInv',
|
|
|
- }, ]
|
|
|
- }
|
|
|
- if (data.flgPrice) {
|
|
|
- contentObj.price = [{ //期初库存标识
|
|
|
- type: 'switch',
|
|
|
- title: mixins.$t("flgPrice"),
|
|
|
- code: 'flgPrice',
|
|
|
- }, { //采购价
|
|
|
- tip: mixins.$t("purchasePricetip"),
|
|
|
- code: 'pricePurchase',
|
|
|
- type: 'number',
|
|
|
- title: mixins.$t("purchasePrice"),
|
|
|
+ code: (data.inventoryCount !== 0) ? 'isflgOpeningInv' : 'flgSubUnit',
|
|
|
+ readonly: data.inventoryCount !== 0 //要校验库存; 库存量不为0不让更改
|
|
|
+ }, { //包装单位
|
|
|
+ code: 'subUnitId',
|
|
|
+ name: 'subUnitName',
|
|
|
+ title: mixins.$t("packageUnit"),
|
|
|
+ type: 'choose',
|
|
|
+ urlKey: 'unit',
|
|
|
required: true,
|
|
|
- }, { //零售价
|
|
|
- tip: mixins.$t("retailPricetip"),
|
|
|
- code: 'priceStandard',
|
|
|
+ readonly: data.inventoryCount !== 0 //要校验库存; 库存量不为0不让更改
|
|
|
+ }, { //包装
|
|
|
+ code: 'packBox',
|
|
|
+ title: mixins.$t("package"),
|
|
|
type: 'number',
|
|
|
- title: mixins.$t("retailPrice"),
|
|
|
+ sign: "",
|
|
|
+ digits: 0,
|
|
|
required: true,
|
|
|
- }, { //批发价
|
|
|
- tip: mixins.$t("wholesalePricetip"),
|
|
|
- code: 'priceWholesale',
|
|
|
- type: 'number',
|
|
|
- title: mixins.$t("wholesalePrice"),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'calculationFormula',
|
|
|
+ type: 'textarea',
|
|
|
+ title: mixins.$t("calculationFormula"),
|
|
|
+ readonly: true,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ } else {
|
|
|
+ contentObj.unit = [{ //基本单位
|
|
|
+ code: 'unitId',
|
|
|
+ name: 'unitName',
|
|
|
+ title: mixins.$t("unit"),
|
|
|
+ type: 'choose',
|
|
|
+ urlKey: 'unit',
|
|
|
+ required: true,
|
|
|
+
|
|
|
+ }, { //辅助单位标识
|
|
|
+ type: 'switch',
|
|
|
+ title: mixins.$t("subUnitId"),
|
|
|
+ code: 'flgSubUnit',
|
|
|
+ }, ]
|
|
|
+ }
|
|
|
+ if (data.flgOpeningInv) {
|
|
|
+ contentObj.warehouse = [{ //期初库存标识
|
|
|
+ type: 'switch',
|
|
|
+ title: mixins.$t("openingInv"),
|
|
|
+ code: 'isflgOpeningInv',
|
|
|
+ readonly: true,
|
|
|
+ }, { //仓库名称
|
|
|
+ code: 'whId',
|
|
|
+ name: 'whName',
|
|
|
+ title: mixins.$t("whName"),
|
|
|
+ type: 'choose',
|
|
|
+ urlKey: 'openingInventory',
|
|
|
required: true,
|
|
|
- }, { //销售限价
|
|
|
- tip: mixins.$t("SaleSPriceLimittip"),
|
|
|
- code: 'priceLimited',
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ { //库存批号
|
|
|
+ code: 'nonStdCode',
|
|
|
+ type: 'textarea',
|
|
|
+ title: mixins.$t("iinventoryBatchNumber"),
|
|
|
+ required: true,
|
|
|
+ readonly: true,
|
|
|
+ tip: mixins.$t('tipPop'),
|
|
|
+ },
|
|
|
+ { //期初数量
|
|
|
+ code: 'intoQty',
|
|
|
type: 'number',
|
|
|
- title: mixins.$t("SaleSPriceLimit"),
|
|
|
+ sign: "",
|
|
|
+ digits: 0,
|
|
|
+ title: mixins.$t("openingInventoryQty"),
|
|
|
required: true,
|
|
|
- }, { //其他价
|
|
|
- tip: mixins.$t("otherPriceLimittip"),
|
|
|
- code: 'priceOther',
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ { //期初成本价
|
|
|
+ code: 'priceInto',
|
|
|
type: 'number',
|
|
|
- title: mixins.$t("otherPriceLimit"),
|
|
|
+ title: mixins.$t("iinitialCostPrice"),
|
|
|
required: true,
|
|
|
- }, ]
|
|
|
- } else {
|
|
|
- contentObj.price = [{ //期初库存标识
|
|
|
- type: 'switch',
|
|
|
- title: mixins.$t("flgPrice"),
|
|
|
- code: 'flgPrice',
|
|
|
- }, ]
|
|
|
- }
|
|
|
- if(data.packBox&&data.unitName&&data.subUnitName){ //选了辅助计量单位 正好 包装也有值 那么直接给出公式
|
|
|
- data.calculationFormula = data.packBox+ data.unitName + '= 1'+ data.subUnitName
|
|
|
- }
|
|
|
-
|
|
|
- this.setData({
|
|
|
- contentObj: contentObj,
|
|
|
- formData: JSON.stringify(data),
|
|
|
- buttonList: [{
|
|
|
- name: 'merge',
|
|
|
- title: mixins.$t("save"), //'保存'
|
|
|
- }],
|
|
|
- })
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ } else {
|
|
|
+ contentObj.warehouse = [{ //期初库存标识
|
|
|
+ type: 'switch',
|
|
|
+ title: mixins.$t("openingInv"),
|
|
|
+ code: 'isflgOpeningInv',
|
|
|
+ readonly: true,
|
|
|
+ }, ]
|
|
|
+ }
|
|
|
+ if (data.flgPrice) {
|
|
|
+ contentObj.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,
|
|
|
+ }, ]
|
|
|
+ } else {
|
|
|
+ contentObj.price = [{ //期初库存标识
|
|
|
+ type: 'switch',
|
|
|
+ title: mixins.$t("flgPrice"),
|
|
|
+ code: 'flgPrice',
|
|
|
+ }, ]
|
|
|
+ }
|
|
|
+ if (data.packBox && data.unitName && data.subUnitName) { //选了辅助计量单位 正好 包装也有值 那么直接给出公式
|
|
|
+ data.calculationFormula = data.packBox + data.unitName + '= 1' + data.subUnitName
|
|
|
+ }
|
|
|
+
|
|
|
+ this.setData({
|
|
|
+ contentObj: contentObj,
|
|
|
+ formData: JSON.stringify(data),
|
|
|
+ buttonList: [{
|
|
|
+ name: 'merge',
|
|
|
+ title: mixins.$t("save"), //'保存'
|
|
|
+ }],
|
|
|
+ })
|
|
|
|
|
|
},
|
|
|
})
|