|
@@ -17,7 +17,7 @@ Page({
|
|
|
* 页面的初始数据
|
|
* 页面的初始数据
|
|
|
*/
|
|
*/
|
|
|
data: {
|
|
data: {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
firstFlag: true,
|
|
firstFlag: true,
|
|
|
orderBy: [{
|
|
orderBy: [{
|
|
|
"text": "可售量升序",
|
|
"text": "可售量升序",
|
|
@@ -78,13 +78,13 @@ Page({
|
|
|
contentList: []
|
|
contentList: []
|
|
|
},
|
|
},
|
|
|
selectedProduct(e) {
|
|
selectedProduct(e) {
|
|
|
- if(e.currentTarget.dataset.active == 0&&this.data.controlFlags&& this.data.controlFlags.choosewhFlag){
|
|
|
|
|
|
|
+ if (e.currentTarget.dataset.active == 0 && this.data.controlFlags && this.data.controlFlags.choosewhFlag) {
|
|
|
this.setData({
|
|
this.setData({
|
|
|
searchContent: [
|
|
searchContent: [
|
|
|
- { code: 'whId', title: mixins.$t('whName'), dropType: 'warehouse',searchType:'dropSingle' },
|
|
|
|
|
|
|
+ { code: 'whId', title: mixins.$t('whName'), dropType: 'warehouse', searchType: 'dropSingle' },
|
|
|
],
|
|
],
|
|
|
})
|
|
})
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
this.setData({
|
|
this.setData({
|
|
|
searchContent: [],
|
|
searchContent: [],
|
|
|
})
|
|
})
|
|
@@ -240,10 +240,10 @@ Page({
|
|
|
//controlFlags.paramsByWhId 查询商品列表 是否开启顶部选择库区的 库区id 作为参数查询
|
|
//controlFlags.paramsByWhId 查询商品列表 是否开启顶部选择库区的 库区id 作为参数查询
|
|
|
//controlFlags.choosewhReadonly 顶部的选择库区是否可点击选择 直接用布尔值在xml控制了
|
|
//controlFlags.choosewhReadonly 顶部的选择库区是否可点击选择 直接用布尔值在xml控制了
|
|
|
//controlFlags.chooseWhByUserDefault 顶部的选择库区是否选择用户默认的库区
|
|
//controlFlags.chooseWhByUserDefault 顶部的选择库区是否选择用户默认的库区
|
|
|
- if(controlFlags.choosewhFlag){
|
|
|
|
|
|
|
+ if (controlFlags.choosewhFlag) {
|
|
|
this.setData({
|
|
this.setData({
|
|
|
searchContent: [
|
|
searchContent: [
|
|
|
- { code: 'whId', title: mixins.$t('whName'), dropType: 'warehouse',searchType:'dropSingle' },
|
|
|
|
|
|
|
+ { code: 'whId', title: mixins.$t('whName'), dropType: 'warehouse', searchType: 'dropSingle' },
|
|
|
],
|
|
],
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -350,13 +350,29 @@ Page({
|
|
|
element.skuImages.forEach(item => {
|
|
element.skuImages.forEach(item => {
|
|
|
item.url = config.image_url + item.path
|
|
item.url = config.image_url + item.path
|
|
|
});
|
|
});
|
|
|
- element.imagesUrl = element.skuImages[0].url
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ element.imagesUrl = element.skuImages[0].url
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
this.setData({
|
|
this.setData({
|
|
|
tableData: tableData
|
|
tableData: tableData
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+ if (this.data.billType == 'sale' || this.data.billType == 'saleOut' || this.data.billType == 'saleOutReturn') {
|
|
|
|
|
+ //处理图片
|
|
|
|
|
+ if (tableData && tableData.length > 0) {
|
|
|
|
|
+ tableData.forEach(item => {
|
|
|
|
|
+ if (item.skuImages && item.skuImages.value) {
|
|
|
|
|
+ item.skuImages.value = JSON.parse(item.skuImages.value)
|
|
|
|
|
+ console.log('item.skuImages.value', item.skuImages.value[0].url)
|
|
|
|
|
+ item['imagesUrl'] = item.skuImages.value.length > 0 ? item.skuImages.value[0].url : null
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ tableData: tableData
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
if (this.data.controlFlags && this.data.controlFlags.sourcePage == "inventory-adjustment") { //库存调整 设置
|
|
if (this.data.controlFlags && this.data.controlFlags.sourcePage == "inventory-adjustment") { //库存调整 设置
|
|
|
let popContent = this.data.popContent
|
|
let popContent = this.data.popContent
|
|
@@ -380,7 +396,7 @@ Page({
|
|
|
res.nonStdCode = ''
|
|
res.nonStdCode = ''
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.setData({
|
|
this.setData({
|
|
|
popContent: popContent,
|
|
popContent: popContent,
|
|
|
tableData: tableData
|
|
tableData: tableData
|
|
@@ -447,10 +463,10 @@ Page({
|
|
|
skuId: item.skuId,
|
|
skuId: item.skuId,
|
|
|
cpId: app.globalData.company.cpId,
|
|
cpId: app.globalData.company.cpId,
|
|
|
nonStdCode: item.nonStdCode,
|
|
nonStdCode: item.nonStdCode,
|
|
|
- }).then(it=>{
|
|
|
|
|
- if(it.length > 0){
|
|
|
|
|
- console.log('invId',it[0].invId)
|
|
|
|
|
- console.log('invQty',it[0].invQty)
|
|
|
|
|
|
|
+ }).then(it => {
|
|
|
|
|
+ if (it.length > 0) {
|
|
|
|
|
+ console.log('invId', it[0].invId)
|
|
|
|
|
+ console.log('invQty', it[0].invQty)
|
|
|
item.invId = it[0].invId
|
|
item.invId = it[0].invId
|
|
|
item.invQty = it[0].invQty
|
|
item.invQty = it[0].invQty
|
|
|
item.usableQty = it[0].usableQty
|
|
item.usableQty = it[0].usableQty
|
|
@@ -458,9 +474,9 @@ Page({
|
|
|
dataItem: JSON.stringify(item)
|
|
dataItem: JSON.stringify(item)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
- console.log('item',item)
|
|
|
|
|
|
|
+ console.log('item', item)
|
|
|
}
|
|
}
|
|
|
if (this.data.item == Constants.billType.sale) {
|
|
if (this.data.item == Constants.billType.sale) {
|
|
|
item.nonStdCode = item.nonStdCode ? item.nonStdCode : '-'
|
|
item.nonStdCode = item.nonStdCode ? item.nonStdCode : '-'
|