|
@@ -49,7 +49,7 @@
|
|
|
<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 big defalut" style="margin-right:60upx;" @click="gotoSelectPage">返回修改</button>
|
|
<button class="admin-button-com big defalut" style="margin-right:60upx;" @click="gotoSelectPage">返回修改</button>
|
|
|
- <button class="admin-button-com big blue" @click="confirmPop()">确认盘点</button>
|
|
|
|
|
|
|
+ <button class="admin-button-com big blue" @click="confirmPd()">确认盘点</button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -58,8 +58,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 { updateCheckOrderToDraftApi, savaCheckOrderDraftApi, getCheckOrderDetailApi, checkOrderApi } from "@/api/inventory";
|
|
|
|
|
-import {currentShop} from "@/api/shop";
|
|
|
|
|
|
|
+import { createGdGoods } from "@/api/pd"
|
|
|
export default {
|
|
export default {
|
|
|
components: { TuiListCell },
|
|
components: { TuiListCell },
|
|
|
mixins: [productMins],
|
|
mixins: [productMins],
|
|
@@ -99,73 +98,11 @@ export default {
|
|
|
]
|
|
]
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- onLoad(option) {
|
|
|
|
|
- const { orderSn } = option;
|
|
|
|
|
- if (orderSn) {
|
|
|
|
|
- this.orderSn = orderSn;
|
|
|
|
|
- this.initInfo();
|
|
|
|
|
- }
|
|
|
|
|
- this.getInfo();
|
|
|
|
|
- if (!this.getMerchantInfo) {
|
|
|
|
|
- this.initMerchantInfo();
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- computed: {
|
|
|
|
|
- ...mapGetters(["getMerchantInfo"])
|
|
|
|
|
- },
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
- ...mapActions(["initMerchantInfo"]),
|
|
|
|
|
- async initInfo() {
|
|
|
|
|
- const { data } = await getCheckOrderDetailApi(this.orderSn);
|
|
|
|
|
- this.infoData = data;
|
|
|
|
|
- const { remark, itemInfo } = data;
|
|
|
|
|
- this.remark = remark;
|
|
|
|
|
- this.setSelectInfoByType({
|
|
|
|
|
- type: this.pageType,
|
|
|
|
|
- info: itemInfo.map(ele => {
|
|
|
|
|
- return {
|
|
|
|
|
- ...ele,
|
|
|
|
|
- bigNum: Number(ele.bigNumStock),
|
|
|
|
|
- smallNum: Number(ele.smallNumStock),
|
|
|
|
|
- bigCount: Number(ele.bigNum),
|
|
|
|
|
- smallCount: Number(ele.smallNum)
|
|
|
|
|
- };
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
gotoSelectPage() {
|
|
gotoSelectPage() {
|
|
|
- uni.navigateTo({url: "/pagesStorehouse/inventory/select"})
|
|
|
|
|
|
|
+ uni.navigateTo({url: "/admin/goods/pdGoods"})
|
|
|
},
|
|
},
|
|
|
- getInfo(){
|
|
|
|
|
- return currentShop().then(res => {
|
|
|
|
|
- this.shopInfo = res.data
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- async saveToDraft() {
|
|
|
|
|
- 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
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
- params.itemInfo = JSON.stringify(formatList);
|
|
|
|
|
- const { data: { orderSn } } = await api(params);
|
|
|
|
|
- this.orderSn = orderSn;
|
|
|
|
|
- this.$msg("保存成功");
|
|
|
|
|
- },
|
|
|
|
|
- confirmPop() {
|
|
|
|
|
|
|
+ confirmPd() {
|
|
|
let that = this;
|
|
let that = this;
|
|
|
that.$util.confirmModal({content:'确认盘点?'},() => {
|
|
that.$util.confirmModal({content:'确认盘点?'},() => {
|
|
|
that.saveCheckOrder()
|
|
that.saveCheckOrder()
|
|
@@ -174,15 +111,18 @@ export default {
|
|
|
saveCheckOrder() {
|
|
saveCheckOrder() {
|
|
|
let params = {remark: this.remark}
|
|
let params = {remark: this.remark}
|
|
|
let formatList = this.selectList.map(ele => {
|
|
let formatList = this.selectList.map(ele => {
|
|
|
- return { bigNum: ele.bigCount, smallNum: ele.smallCount, productId: ele.id }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ return { num: ele.bigCount, goodsId: ele.id,name:ele.name,cover:ele.shortCover,flower:ele.flower,kindId:ele.kindId }
|
|
|
|
|
+ })
|
|
|
let that = this
|
|
let that = this
|
|
|
- params.itemInfo = JSON.stringify(formatList);
|
|
|
|
|
- checkOrderApi(params).then(res=>{
|
|
|
|
|
|
|
+ params.goodsInfo = JSON.stringify(formatList)
|
|
|
|
|
+ uni.showLoading({mask:true})
|
|
|
|
|
+ createGdGoods(params).then(res=>{
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
- that.$msg("盘点成功");
|
|
|
|
|
- that.removeFromSaveDirect()
|
|
|
|
|
- uni.navigateBack()
|
|
|
|
|
|
|
+ that.$msg("盘点成功")
|
|
|
|
|
+ setTimeout(function(){
|
|
|
|
|
+ that.removeFromSaveDirect()
|
|
|
|
|
+ uni.navigateBack()
|
|
|
|
|
+ },1500)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|