|
@@ -63,7 +63,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="bar-view" v-if="selectList.length>0">
|
|
<view class="bar-view" v-if="selectList.length>0">
|
|
|
<view class="btn-view">
|
|
<view class="btn-view">
|
|
|
- <button class="admin-button-com middle" @click="removeFromSave(0)" style="margin-left:30upx;">清空花材</button>
|
|
|
|
|
|
|
+ <button class="admin-button-com middle default" @click="removeFromSave(0)" style="margin-left:30upx;">清空花材</button>
|
|
|
<button :class="['admin-button-com', 'middle']" @click="gotoSelectPage"> 修改花材 </button>
|
|
<button :class="['admin-button-com', 'middle']" @click="gotoSelectPage"> 修改花材 </button>
|
|
|
<button v-if="!orderSn" :class="['admin-button-com', 'middle', { disabled: allCount == 0 }]" :disabled="allCount == 0" @click="confirmPop(1)"> 确认盘点 </button>
|
|
<button v-if="!orderSn" :class="['admin-button-com', 'middle', { disabled: allCount == 0 }]" :disabled="allCount == 0" @click="confirmPop(1)"> 确认盘点 </button>
|
|
|
<button v-if="orderSn" :class="['admin-button-com', 'middle', { disabled: allCount == 0 }]" :disabled="allCount == 0" @click="confirmPop(2)"> 确认盘点 </button>
|
|
<button v-if="orderSn" :class="['admin-button-com', 'middle', { disabled: allCount == 0 }]" :disabled="allCount == 0" @click="confirmPop(2)"> 确认盘点 </button>
|
|
@@ -75,13 +75,7 @@
|
|
|
import TuiListCell from "@/components/plugin/list-cell";
|
|
import TuiListCell from "@/components/plugin/list-cell";
|
|
|
import productMins from "@/mixins/product";
|
|
import productMins from "@/mixins/product";
|
|
|
import { mapActions, mapGetters } from "vuex";
|
|
import { mapActions, mapGetters } from "vuex";
|
|
|
-import {
|
|
|
|
|
- updateCheckOrderApi,
|
|
|
|
|
- updateCheckOrderToDraftApi,
|
|
|
|
|
- savaCheckOrderDraftApi,
|
|
|
|
|
- getCheckOrderDetailApi,
|
|
|
|
|
- checkOrderApi
|
|
|
|
|
-} from "@/api/inventory/index";
|
|
|
|
|
|
|
+import { updateCheckOrderApi, updateCheckOrderToDraftApi, savaCheckOrderDraftApi, getCheckOrderDetailApi, checkOrderApi } from "@/api/inventory/index";
|
|
|
import {currentShop} from "@/api/shop/index";
|
|
import {currentShop} from "@/api/shop/index";
|
|
|
export default {
|
|
export default {
|
|
|
components: { TuiListCell },
|
|
components: { TuiListCell },
|
|
@@ -90,29 +84,14 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
orderSn: null,
|
|
orderSn: null,
|
|
|
infoData: null,
|
|
infoData: null,
|
|
|
- autoLoad: false,
|
|
|
|
|
|
|
+ autoLoad: true,
|
|
|
shopInfo:{shopName:''},
|
|
shopInfo:{shopName:''},
|
|
|
remark: "",
|
|
remark: "",
|
|
|
selectJobType: "inventory",
|
|
selectJobType: "inventory",
|
|
|
columns: [
|
|
columns: [
|
|
|
- {
|
|
|
|
|
- name: "名称",
|
|
|
|
|
- custom: "icon"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "库存",
|
|
|
|
|
- custom: "stock",
|
|
|
|
|
- // color: "success",
|
|
|
|
|
- width: 120,
|
|
|
|
|
- align: "center"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "盘点数",
|
|
|
|
|
- custom: "inventory",
|
|
|
|
|
- color: "warn",
|
|
|
|
|
- width: 120,
|
|
|
|
|
- align: "center"
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ { name: "名称", custom: "icon" },
|
|
|
|
|
+ { name: "库存", custom: "stock", width: 120, align: "center" },
|
|
|
|
|
+ { name: "盘点数", custom: "inventory", color: "warn", width: 120, align: "center" },
|
|
|
{
|
|
{
|
|
|
name: "盈亏数",
|
|
name: "盈亏数",
|
|
|
color: "success",
|
|
color: "success",
|
|
@@ -147,50 +126,32 @@ export default {
|
|
|
methods: {
|
|
methods: {
|
|
|
...mapActions(["initMerchantInfo"]),
|
|
...mapActions(["initMerchantInfo"]),
|
|
|
async initInfo() {
|
|
async initInfo() {
|
|
|
- try {
|
|
|
|
|
- const { data } = await getCheckOrderDetailApi(this.orderSn);
|
|
|
|
|
- this.infoData = data;
|
|
|
|
|
- const { remark, itemInfo } = data;
|
|
|
|
|
- this.remark = remark;
|
|
|
|
|
- this.setSelectInfo({
|
|
|
|
|
- selectJobType: this.selectJobType,
|
|
|
|
|
- info: itemInfo.map(ele => {
|
|
|
|
|
- return { ...ele, bigNum: Number(ele.bigNumStock), smallNum: Number(ele.smallNumStock), bigCount: Number(ele.bigNum), smallCount: Number(ele.smallNum) }
|
|
|
|
|
- }),
|
|
|
|
|
- selectJobId:this.selectJobId
|
|
|
|
|
- });
|
|
|
|
|
- } catch (error) {}
|
|
|
|
|
|
|
+ const { data } = await getCheckOrderDetailApi(this.orderSn);
|
|
|
|
|
+ this.infoData = data;
|
|
|
|
|
+ const { remark, itemInfo } = data;
|
|
|
|
|
+ this.remark = remark;
|
|
|
|
|
+ this.setSelectInfo({
|
|
|
|
|
+ selectJobType: this.selectJobType,
|
|
|
|
|
+ info: itemInfo.map(ele => {
|
|
|
|
|
+ return { ...ele, bigNum: Number(ele.bigNumStock), smallNum: Number(ele.smallNumStock), bigCount: Number(ele.bigNum), smallCount: Number(ele.smallNum) }
|
|
|
|
|
+ }),
|
|
|
|
|
+ selectJobId:this.selectJobId
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
gotoSelectPage() {
|
|
gotoSelectPage() {
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: "/pagesStorehouse/inventory/select",
|
|
|
|
|
- success: result => {},
|
|
|
|
|
- fail: () => {},
|
|
|
|
|
- complete: () => {}
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ uni.navigateTo({ url: "/pagesStorehouse/inventory/select" })
|
|
|
},
|
|
},
|
|
|
getInfo(){
|
|
getInfo(){
|
|
|
return currentShop().then(res => {
|
|
return currentShop().then(res => {
|
|
|
this.shopInfo = res.data
|
|
this.shopInfo = res.data
|
|
|
- console.log('getInfo',res)
|
|
|
|
|
- })
|
|
|
|
|
- .catch(err => {});
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- /**
|
|
|
|
|
- * 获取当前选中商品总价
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ //获取当前选中商品总价
|
|
|
getSelectItemProfitPrice(item) {
|
|
getSelectItemProfitPrice(item) {
|
|
|
- let price = 0;
|
|
|
|
|
- const {
|
|
|
|
|
- bigCount,
|
|
|
|
|
- smallCount,
|
|
|
|
|
- bigNum,
|
|
|
|
|
- smallNum,
|
|
|
|
|
- bigPrice,
|
|
|
|
|
- smallPrice
|
|
|
|
|
- } = item;
|
|
|
|
|
- let bigNumProfitLoss = Number(bigCount) - Number(bigNum);
|
|
|
|
|
- let smallNumProfitLoss = Number(smallCount) - Number(smallNum);
|
|
|
|
|
|
|
+ let price = 0
|
|
|
|
|
+ const { bigCount, smallCount, bigNum, smallNum, bigPrice, smallPrice } = item
|
|
|
|
|
+ let bigNumProfitLoss = Number(bigCount) - Number(bigNum)
|
|
|
|
|
+ let smallNumProfitLoss = Number(smallCount) - Number(smallNum)
|
|
|
// let sum = Number(bigCount) * Number(bigPrice) + Number(smallCount) * Number(smallPrice);
|
|
// let sum = Number(bigCount) * Number(bigPrice) + Number(smallCount) * Number(smallPrice);
|
|
|
// price = Math.round(sum * 100) / 100;
|
|
// price = Math.round(sum * 100) / 100;
|
|
|
// let stockSum = Number(bigNum) * Number(bigPrice) + Number(smallNum) * Number(smallPrice);
|
|
// let stockSum = Number(bigNum) * Number(bigPrice) + Number(smallNum) * Number(smallPrice);
|
|
@@ -200,32 +161,28 @@ export default {
|
|
|
return diff;
|
|
return diff;
|
|
|
},
|
|
},
|
|
|
async saveToDraft() {
|
|
async saveToDraft() {
|
|
|
- try {
|
|
|
|
|
- let api = savaCheckOrderDraftApi;
|
|
|
|
|
- if (this.orderSn) {
|
|
|
|
|
- api = updateCheckOrderToDraftApi;
|
|
|
|
|
- }
|
|
|
|
|
- let params = {
|
|
|
|
|
- remark: this.remark
|
|
|
|
|
|
|
+ let api = savaCheckOrderDraftApi;
|
|
|
|
|
+ if (this.orderSn) {
|
|
|
|
|
+ api = updateCheckOrderToDraftApi;
|
|
|
|
|
+ }
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ remark: this.remark
|
|
|
|
|
+ };
|
|
|
|
|
+ if (this.orderSn) {
|
|
|
|
|
+ params.orderSn = this.orderSn;
|
|
|
|
|
+ }
|
|
|
|
|
+ let formatList = this.selectList.map(ele => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ bigNum: ele.bigCount,
|
|
|
|
|
+ smallNum: ele.smallCount,
|
|
|
|
|
+ productId: ele.id,classId:ele.classId,itemId:ele.itemId
|
|
|
};
|
|
};
|
|
|
- if (this.orderSn) {
|
|
|
|
|
- params.orderSn = this.orderSn;
|
|
|
|
|
- }
|
|
|
|
|
- let formatList = this.selectList.map(ele => {
|
|
|
|
|
- return {
|
|
|
|
|
- bigNum: ele.bigCount,
|
|
|
|
|
- smallNum: ele.smallCount,
|
|
|
|
|
- productId: ele.id,classId:ele.classId,itemId:ele.itemId
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
- params.itemInfo = JSON.stringify(formatList);
|
|
|
|
|
- const {
|
|
|
|
|
- data: { orderSn }
|
|
|
|
|
- } = await api(params);
|
|
|
|
|
- this.orderSn = orderSn;
|
|
|
|
|
- this.$msg("保存成功");
|
|
|
|
|
- this.initInfo();
|
|
|
|
|
- } catch (error) {}
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ params.itemInfo = JSON.stringify(formatList);
|
|
|
|
|
+ const { data: { orderSn } } = await api(params)
|
|
|
|
|
+ this.orderSn = orderSn
|
|
|
|
|
+ this.$msg("保存成功")
|
|
|
|
|
+ this.initInfo()
|
|
|
},
|
|
},
|
|
|
confirmPop(type) {
|
|
confirmPop(type) {
|
|
|
let that = this;
|
|
let that = this;
|
|
@@ -234,32 +191,29 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
async saveCheckOrder(type) {
|
|
async saveCheckOrder(type) {
|
|
|
- try {
|
|
|
|
|
- console.log(type)
|
|
|
|
|
- let params = {
|
|
|
|
|
- remark: this.remark
|
|
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ remark: this.remark
|
|
|
|
|
+ };
|
|
|
|
|
+ if (this.orderSn) {
|
|
|
|
|
+ params.orderSn = this.orderSn;
|
|
|
|
|
+ }
|
|
|
|
|
+ let formatList = this.selectList.map(ele => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ bigNum: ele.bigCount,
|
|
|
|
|
+ smallNum: ele.smallCount,
|
|
|
|
|
+ productId: ele.id
|
|
|
};
|
|
};
|
|
|
- if (this.orderSn) {
|
|
|
|
|
- params.orderSn = this.orderSn;
|
|
|
|
|
- }
|
|
|
|
|
- let formatList = this.selectList.map(ele => {
|
|
|
|
|
- return {
|
|
|
|
|
- bigNum: ele.bigCount,
|
|
|
|
|
- smallNum: ele.smallCount,
|
|
|
|
|
- productId: ele.id
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
- params.itemInfo = JSON.stringify(formatList);
|
|
|
|
|
- //type 1直接确定 2保存草稿后在确定
|
|
|
|
|
- if(type==1){
|
|
|
|
|
- await checkOrderApi(params)
|
|
|
|
|
- }else{
|
|
|
|
|
- await updateCheckOrderApi(params)
|
|
|
|
|
- }
|
|
|
|
|
- this.$msg("盘点成功");
|
|
|
|
|
- this.removeFromSaveDirect()
|
|
|
|
|
- uni.navigateBack({delta: 1});
|
|
|
|
|
- } catch (error) {}
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ params.itemInfo = JSON.stringify(formatList);
|
|
|
|
|
+ //type 1直接确定 2保存草稿后在确定
|
|
|
|
|
+ if(type==1){
|
|
|
|
|
+ await checkOrderApi(params)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ await updateCheckOrderApi(params)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$msg("盘点成功");
|
|
|
|
|
+ this.removeFromSaveDirect()
|
|
|
|
|
+ uni.navigateBack({delta: 1})
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -335,9 +289,7 @@ export default {
|
|
|
padding: 0 30upx;
|
|
padding: 0 30upx;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100upx;
|
|
height: 100upx;
|
|
|
-
|
|
|
|
|
box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
|
|
box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
|
|
|
-
|
|
|
|
|
.btn-view {
|
|
.btn-view {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
.admin-button-com {
|
|
.admin-button-com {
|
|
@@ -350,7 +302,6 @@ export default {
|
|
|
.table-header {
|
|
.table-header {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
padding: 20upx 30upx;
|
|
padding: 20upx 30upx;
|
|
|
-
|
|
|
|
|
box-shadow: 0upx 1upx 0upx 0upx #eeeeee;
|
|
box-shadow: 0upx 1upx 0upx 0upx #eeeeee;
|
|
|
color: #999999;
|
|
color: #999999;
|
|
|
.table-th {
|
|
.table-th {
|
|
@@ -379,4 +330,4 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|