diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue
index b648360..daaf96e 100644
--- a/pages/billing/changeGoods1.vue
+++ b/pages/billing/changeGoods1.vue
@@ -65,15 +65,18 @@
-
-
-
+
+
+
@@ -180,16 +187,21 @@
goodsDetail: [],
attrNameList: [],
temporaryList: [],
- carList: [],
- columns: [],
- keyList: [],
- specsList:[],
- evalue:[],
- attributeList:[]
+ carList: [],
+ columns: [],
+ keyList: [],
+ specsList: [],
+ evalue: [],
+ attributeList: [],
+ purchasePrice: 0,
+ zPrice:0,
+ zNum:0,
+ storageType:0
}
},
onLoad() {
- this.getGategoryList()
+ this.getGategoryList()
+ this.storageType = uni.getStorageSync('type')
},
methods: {
//初始化获取分类列表
@@ -207,8 +219,8 @@
}
}
this.getShareList(this.indexList[0].id);
- } else {
- this.tui.toast(res.message)
+ } else {
+ this.tui.toast(res.message)
}
}).catch((res) => {})
},
@@ -218,53 +230,71 @@
})
this.goodsDetail.attributeList[index].isChecked = true;
this.goodsDetail.attributeList[index].value[index1].isChecked = true;
- console.log(this.goodsDetail)
- var name = '',
- evalue = []
+ var name = '',
+ evalue = [],
+ obj = {},
+ specsList = []
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) {
- console.log(Ien[m])
if (Ien[m].isChecked == true) {
- evalue.push(Ien[m].value)
+ evalue.push(Ien[m].value)
name += Ien[m].value
}
}
- }
- this.evalue = evalue;
- this.temporaryList = [{
- id: this.goodsDetail.id,
- barcode: this.goodsDetail.barcode,
- price: this.goodsDetail.price,
- name: name,
- num: this.temporaryNum,
- productName: this.goodsDetail.productName,
- productSn: this.goodsDetail.productSn,
- productPicture:this.goodsDetail.productPicture,
- supplierName:this.goodsDetail.supplierName
- }]
+ }
+ this.keyList.map((item, index) => {
+ obj[item] = evalue[index]
+ })
+ let jishuqi = 0;
+ for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
+ if (this.goodsDetail.attributeList[i].isChecked == true) {
+ jishuqi++
+ }
+ }
+ if (this.goodsDetail.attributeList.length == jishuqi) {
+ let data = {}
+ this.attributeList = {
+ attributeList: JSON.stringify(obj),
+ productCount: this.temporaryNum,
+ name:name,
+ price:this.purchasePrice
+ }
+ if (this.temporaryList.length == 0) {
+ this.temporaryList.push(this.attributeList);
+ } else {
+ for (var i = 0; i < this.temporaryList.length; i++) {
+ if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) {
+ this.temporaryList[i] = this.attributeList
+ return
+ } else {
+ if (this.temporaryList.length == (i+1)) {
+ this.temporaryList.push(this.attributeList);
+ return
+ }
+ }
+ }
+
+ }
+ }
+
},
temporaryChange(val) {
- console.log(val)
- this.temporaryList[0].num = val
-
- },
- //点击底部选好了,返回上一页
- backPrevPage(){
- this.specsList.map((item, index) => {
- this.attributeList[index] = {
- attributeList: JSON.stringify(item),
- productCount: this.carList[index].num
- }
- })
- for (var i=0;i {})
},
@@ -292,7 +322,8 @@
this.type = type
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (type == 'carPopup') {
- this.$refs.carPopup.open('bottom')
+ this.$refs.carPopup.open('bottom')
+
} else {
this.checkGoods(item);
this.$refs.popup.open('bottom')
@@ -323,10 +354,10 @@
value: valueObj
})
}
- this.goodsDetail.attributeList = newArr;
- this.goodsDetail.attributeList.forEach((item, index) => {
- this.columns[index] = item.value;
- this.keyList[index] = item.name;
+ this.goodsDetail.attributeList = newArr;
+ this.goodsDetail.attributeList.forEach((item, index) => {
+ this.columns[index] = item.value;
+ this.keyList[index] = item.name;
})
}
@@ -358,26 +389,74 @@
this.goodsDetail.price = this.temporaryList[0].price = val
},
//弹窗选择规格后,点击弹窗中选好了按钮
- temporaryCheck() {
- this.carList.push(this.temporaryList[0]);
- this.$refs.popup.close()
- var obj = {};
- this.keyList.map((item, index) => {
- obj[item] = this.evalue[index]
- })
- this.specsList.push(obj);
- console.log(this.specsList);
- // this.specsList.map((item, index) => {
- // this.attributeList[index] = {
- // attributeList: JSON.stringify(item),
- // productCount: this.numList[index]
- // }
- // })
- // for (var i =0;i {
- console.log(typeof(res.result))
+ console.log(res.result)
this.toggle('bottom', res.result);
},
@@ -304,9 +304,7 @@
},
//通过商品id查询商品详细信息
getById(id) {
- this.tui.request("/app/product/getById", "POST", {
- id: "XD1718301576285786112"
- }, false, true).then((res) => {
+ this.tui.request("/app/product/getById/"+id, "POST", {}, false, true).then((res) => {
if (res.code == 200) {
} else {
diff --git a/pages/index/downStearmList.vue b/pages/index/downStearmList.vue
index 817af30..424854c 100644
--- a/pages/index/downStearmList.vue
+++ b/pages/index/downStearmList.vue
@@ -48,105 +48,109 @@
开单
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -180,44 +184,204 @@
this.khid = options.khid;
this.getShareList(options.khid);
},
- methods: {
- attrNameChange(index, index1) {
- this.goodsDetail.attributeList[index].value.forEach(item => {
- item.isChecked = false;
+ methods: {
+ attrNameChange(index, index1) {
+ this.goodsDetail.attributeList[index].value.forEach(item => {
+ item.isChecked = false;
})
-
- this.goodsDetail.attributeList[index].isChecked = true;
- this.goodsDetail.attributeList[index].value[index1].isChecked = true;
-
- var name = '', //选中后弹出层显示的名字
- evalue = [] //临时储存的数组
- for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
- for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) {
-
- if (Ien[m].isChecked == true) {
+ this.goodsDetail.attributeList[index].isChecked = true;
+ this.goodsDetail.attributeList[index].value[index1].isChecked = true;
+ var name = '',
+ evalue = [],
+ obj = {},
+ specsList = []
+ for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
+ for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) {
+ if (Ien[m].isChecked == true) {
evalue.push(Ien[m].value)
- name += Ien[m].value
- }
- }
+ name += Ien[m].value
+ }
+ }
+ }
+ this.keyList.map((item, index) => {
+ obj[item] = evalue[index]
+ })
+ let jishuqi = 0;
+ for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
+ if (this.goodsDetail.attributeList[i].isChecked == true) {
+ jishuqi++
+ }
+ }
+ if (this.goodsDetail.attributeList.length == jishuqi) {
+ let data = {}
+ this.attributeList = {
+ attributeList: JSON.stringify(obj),
+ productCount: this.temporaryNum,
+ name:name,
+ price:this.purchasePrice
+ }
+ if (this.temporaryList.length == 0) {
+ this.temporaryList.push(this.attributeList);
+ } else {
+ for (var i = 0; i < this.temporaryList.length; i++) {
+ if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) {
+ this.temporaryList[i] = this.attributeList
+ return
+ } else {
+ if (this.temporaryList.length == (i+1)) {
+ this.temporaryList.push(this.attributeList);
+ return
+ }
+ }
+ }
+
+ }
+ }
+
+ },
+ temporaryChange(val) {
+ console.log(val)
+ this.zNum = 0
+ console.log(this.temporaryList)
+ for (var i=0;i {
+ this.columns[index] = item.value;
+ this.keyList[index] = item.name;
+ })
+ }
+
+ },
+ //顶部搜索框
+ search(res) {
+ this.searchName = res.value
+ uni.showToast({
+ title: '搜索:' + res.value,
+ icon: 'none'
+ })
+ },
+ inputDialogToggle() {
+ this.$refs.inputDialog.open()
+ },
+ //临时改价
+ changePrice(val) {
+ this.goodsDetail.price = this.temporaryList[0].price = val
+ },
+ //弹窗选择规格后,点击弹窗中选好了按钮
+ temporaryCheck() {
+ if(this.storageType == 0 && this.purchasePrice == 0){
+ uni.showToast({
+ title: "请输入采购价!",
+ icon: 'none'
+ })
+ }else{
+ let data = {
+ id: this.goodsDetail.id,
+ price: this.zPrice,
+ num: this.zNum,
+ productName: this.goodsDetail.productName,
+ productSn: this.goodsDetail.productSn,
+ productPicture: this.goodsDetail.productPicture,
+ supplierName: this.goodsDetail.supplierName,
+ saleDetailQueryDTO:this.temporaryList
+ }
+ this.carList.push(data)
+ this.temporaryList = []
+ this.purchasePrice = ''
+ this.zPrice = ''
+ this.zNum = ''
+ for(let i=0;i {})
- },
- //获取弹出层状态
- change(e) {
-
- },
- //弹出购物车或者商品规格选择弹窗
- toggle(type, item) {
-
- this.type = type
- // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
- if (type == 'carPopup') {
- this.$refs.carPopup.open('bottom')
- } else {
- this.checkGoods(item);
- this.$refs.popup.open('bottom')
- }
-
- },
- //选择商品查询商品规格
- checkGoods(item) {
- this.goodsDetail = item
- if (typeof(this.goodsDetail.attributeList) == 'string') {
- let newObj = JSON.parse(this.goodsDetail.attributeList)
- let newArr = []
- for (let val in newObj) {
- let valueObj = [];
- for (var i = 0; i < newObj[val].length; i++) {
- valueObj.push({
- value: newObj[val][i],
- isChecked: false
- })
- this.attrNameList.push({
- value: newObj[val][i],
- name: val,
- isChecked: false
- })
- }
- newArr.push({
- name: val,
- value: valueObj
- })
- }
- this.goodsDetail.attributeList = newArr;
- this.goodsDetail.attributeList.forEach((item, index) => {
- this.columns[index] = item.value;
- this.keyList[index] = item.name;
- })
- }
-
- },
- //顶部搜索框
- search(res) {
- this.keywords = res.value
- this.getShareList(this.khid)
- },
- //点击左侧菜单切换
- clickLeftBtn(index) {
- for (var i = 0; i < this.indexList.length; i++) {
- if (i == index) {
- this.indexList[i].parentId = true
- } else {
- this.indexList[i].parentId = false
- }
- }
- this.getShareList(this.indexList[index].id)
- },
- inputDialogToggle() {
- this.$refs.inputDialog.open()
- },
- //临时改价
- changePrice(val) {
- this.goodsDetail.price = this.temporaryList[0].price = val
- },
- //弹窗选择规格后,点击弹窗中选好了按钮
- temporaryCheck() {
- this.carList.push(this.temporaryList[0]);
- this.$refs.popup.close()
- var obj = {};
- this.keyList.map((item, index) => {
- obj[item] = this.evalue[index]
- })
- this.specsList.push(obj);
-
- // this.specsList.map((item, index) => {
- // this.attributeList[index] = {
- // attributeList: JSON.stringify(item),
- // productCount: this.numList[index]
- // }
- // })
- // for (var i =0;i
品名:{{item.productName}}
- 货号:{{item.barcode}}
+ 货号:{{item.productSn}}
供应商:{{item.supplierName}}
-
- {{item.saleDetailQueryDTO.attributeList}}
- ¥{{item.price * item.num}}
- {{item.num}}
+
+ {{items.name}}
+ ¥{{items.price}}
+ {{items.productCount}}
@@ -48,33 +48,33 @@
- 实付金额
+ 应付金额
-
+
- 未付金额
+ 已付金额
-
+
欠款
-
+
其他费用
-
+
备注
-
+
@@ -82,8 +82,8 @@
- 合计:2
- ¥20.00
+ 合计:{{totalAmount}}
+ ¥{{shouldPay}}
@@ -108,12 +108,25 @@
single: ''
},
khName:[],
- carList:[]
+ carList:[],
+ remask:'',
+ otherPay: 0,
+ noPay: 0,
+ alreadyPay: 0,
+ realAmount: 0,
+ shouldPay:0,
+ totalAmount:0
}
},
onShow(){
this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
this.carList = this.carList || ''
+ console.log(this.carList)
+ for (let i=0;i
+
+
+
+
+
+
+
+ {{item.categoryName}}
+
+
+
+
+
+
+
+
+ {{item.productName}}
+ {{item.productSn}}
+
+
+ {{item.purchasePrice}}
+ 采购价
+
+
+ {{item.wholesalePrice}}
+ 批发价
+
+
+ {{item.price}}
+ 零售价
+
+
+ {{item.stockCount}}
+ 库存
+
+
+
+
+
+
+
+
+
+
+ 已选择
+
+ {{carList.length}}
+
+
+ 选好了
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file