diff --git a/pages/index/waitStorageDetail.vue b/pages/index/waitStorageDetail.vue
index 5d85953..af950f8 100644
--- a/pages/index/waitStorageDetail.vue
+++ b/pages/index/waitStorageDetail.vue
@@ -1,66 +1,63 @@
-
+
{{sales.province + sales.area + sales.city + sales.receiveAddress}}
-
-
-
-
- 品名:{{value[1].productName}}
- 货号:{{value[1].productSn}}
- 总价:{{value[1].price}} 数量:{{value[1].productCount}}
-
-
-
-
-
- {{values[0] | sliceMsg}}
-
- 数量:{{values[1]}}
-
-
+
+
+
+
+ 品名:{{item.productName}}
+ 货号:{{item.productSn}}
+ 总价:{{item.price}} 数量:{{item.productCount}}
+
+
维护采购价
-
-
-
-
-
- 应付金额
-
- ¥
- {{ sales.totalAmount }}
-
- 已付金额
-
- ¥
- {{ sales.alreadyEarn }}
+
+
+ {{items.attributeList | sliceMsg}}
+
+ 数量:{{items.productCount}}
-
- 欠款
-
- ¥
- {{ sales.noEarn}}
-
-
-
- 其他费用
-
- ¥
- {{ sales.otherExpense}}
+
+
+
+
+
+ 应付金额
+
+
+
+
+
+ 已付金额
+
+
+
+
+
+ 欠款
+
+
+
+
+
+ 其他费用
+
+
+
-
-
- 备注
-
- {{ sales.remark}}
+
+ 备注
+
+
+
@@ -69,7 +66,12 @@
确认提交
-
+
+
+
+
+
@@ -78,50 +80,127 @@
data() {
return {
sales: {},
- list: [],
- isReturn: false
+ goodsList: [],
+ isReturn: false,
+ shouldPay:0,
+ noPay:0,
+ alreadyPay:0,
+ otherPay:0,
+ remark:'',
+ }
+ },
+ filters: {
+ sliceMsg(val) {
+ var name = ''
+ if (typeof(val) == 'string') {
+ let newObj = JSON.parse(val)
+ for (let as in newObj) {
+ name += newObj[as] + '/'
+ }
+ }
+ return name;
}
},
- onLoad(option) {
+ onLoad(option) {
this.getWaitStorage(option.id)
},
methods: {
- getWaitStorage(id){
- this.tui.request("/app/purchase/getPurchaseAllData", "post", {
- id: id
- }, false, true).then((res) => {
- if (res.code == 200) {
+ getWaitStorage(id) {
+ this.tui.request("/app/purchase/getPurchaseAllData", "post", {
+ id: id
+ }, false, true).then((res) => {
+ if (res.code == 200) {
this.sales = res.result.purchase
- this.list = res.result.purchaseDetails
-
+ this.remark = res.result.purchase.remark
+ this.goodsList = res.result.purchaseDetails
+
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
+ },
+ //计算欠款
+ changePay() {
+ this.noPay = this.shouldPay - this.alreadyPay
+ },
+ inventorySubmit() {
+ if (this.noPay == 0 || this.alreadyPay == 0 || this.shouldPay == 0) {
+ uni.showToast({
+ title: "信息填写完成后入库!",
+ icon: 'none'
+ })
+ }
+ let that = this;
+ let purchase = {
+ alreadyPay: this.alreadyPay, //已付金额
+ noPay: this.noPay, //欠款
+ shouldPay: this.shouldPay, //应付金额
+ totalAmount: this.sales.totalAmount, //总数量
+ remark: this.remark,
+ supplierId: this.sales.supplierId, //供应商id和姓名
+ supplierName: this.sales.supplierName
+ }
+ let purchaseDetails = [];
+ this.carList.forEach(function(value, key) {
+ value.stockLogList.forEach(function(values, keys) {
+ let obj = {
+ productCount: values,
+ attributeList: keys
+ }
+ value.stockLogList1.push(obj)
+ })
+ purchaseDetails.push(value)
+ })
+ this.tui.request("/app/stock/putInOfProduct", "post", {
+ purchase: purchase,
+ purchaseDetails: purchaseDetails
+ }, false, false).then((res) => {
+ if (res.code == 200) {
+ uni.showToast({
+ title: "入库成功",
+ icon: 'none'
+ })
+ uni.navigateBack({
+ delta: 2
+ })
} else {
- this.tui.toast(res.message)
+ uni.showToast({
+ title: "入库失败",
+ icon: 'none'
+ })
}
- }).catch((res) => {})
+ })
+ },
+ //编辑每一个的单价
+ clickCollapse(index) {
+ this.index = index
+ this.$refs.inputDialog.val = ''
+ this.$refs.inputDialog.open()
+ },
+ //计算价格
+ changePrice(val) {
+ let that = this;
+ that.shouldPay = 0
+ console.log(that.goodsList)
+ console.log(this.index)
+ that.goodsList[that.index].purchasePrice = val
+ that.goodsList[that.index].price = val * that.goodsList[that.index].productCount;
+ that.goodsList.forEach(function(value, key) {
+ that.shouldPay += value.price
+ })
+
}
},
}
\ No newline at end of file
diff --git a/pages/inventory/addinventory.vue b/pages/inventory/addinventory.vue
index 509f279..73968fe 100644
--- a/pages/inventory/addinventory.vue
+++ b/pages/inventory/addinventory.vue
@@ -409,12 +409,9 @@
border-bottom: 1px solid #eee;
font-size: 28rpx;
font-weight: bold;
- display: flex;
- }
-
- .shop-name {
- .uni-icons {
- color: #088FEB !important;
+ display: flex;
+ .uni-icons {
+ color: #088FEB !important;
}
}