|
@@ -10,11 +10,6 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="order-item">
|
|
<view class="order-item">
|
|
|
|
|
|
|
|
- <view v-if="beginCount > 0 && orderInfo.fromType == 4" style="min-height:35upx;height:auto;">
|
|
|
|
|
- <text class="left">开始制作</text>
|
|
|
|
|
- <text class="right" style="color:red;font-weight:bold;font-size:20upx;">{{beginCount}} 秒后</text>
|
|
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
<view>
|
|
<view>
|
|
|
<text class="left">配送</text>
|
|
<text class="left">配送</text>
|
|
|
<text class="right" v-if="orderInfo.sendType == 1" style="color:red;font-weight:bold;">到店自取</text>
|
|
<text class="right" v-if="orderInfo.sendType == 1" style="color:red;font-weight:bold;">到店自取</text>
|
|
@@ -149,8 +144,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import { getFullInfo,finish,lockWork,cancelWork,print } from '@/api/work'
|
|
|
|
|
-import {modifyWastage} from '@/api/work-item'
|
|
|
|
|
|
|
+import { getDetail } from '@/api/order'
|
|
|
import wastageSelectNum from './wastageSelectNum.vue'
|
|
import wastageSelectNum from './wastageSelectNum.vue'
|
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
|
import productMins from "@/mixins/product";
|
|
import productMins from "@/mixins/product";
|
|
@@ -196,7 +190,6 @@ export default {
|
|
|
// #endif
|
|
// #endif
|
|
|
},
|
|
},
|
|
|
destroyed(){
|
|
destroyed(){
|
|
|
-
|
|
|
|
|
if(this.INT){
|
|
if(this.INT){
|
|
|
clearInterval(this.INT)
|
|
clearInterval(this.INT)
|
|
|
}
|
|
}
|
|
@@ -212,106 +205,6 @@ export default {
|
|
|
previewImage(url){
|
|
previewImage(url){
|
|
|
uni.previewImage({urls:[url]})
|
|
uni.previewImage({urls:[url]})
|
|
|
},
|
|
},
|
|
|
- calcFn(){
|
|
|
|
|
- this.calc = this.calc == 'add' ? 'sub' : 'add'
|
|
|
|
|
- this.$emit('calcFn',this.calc)
|
|
|
|
|
- },
|
|
|
|
|
- printFn(item){
|
|
|
|
|
- if(item.status ==1){
|
|
|
|
|
- print({id:item.id}).then(res=>{
|
|
|
|
|
- if(res.code == 1){
|
|
|
|
|
- this.$msg(res.msg)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- lockFn(info){
|
|
|
|
|
- if(info.stockLock == 0){
|
|
|
|
|
- this.$refs.lockWorkRef.open('center')
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- confirmLock(){
|
|
|
|
|
- uni.showLoading({mask:true})
|
|
|
|
|
- lockWork({id:this.orderInfo.id}).then(res=>{
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
- if(res.code == 1){
|
|
|
|
|
- this.$msg('已锁定')
|
|
|
|
|
- this.getOrderDetail(this.orderInfo.id)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- cancelFn(info){
|
|
|
|
|
- this.$msg('开发中')
|
|
|
|
|
- return false
|
|
|
|
|
- this.$util.hitVoice()
|
|
|
|
|
- if(info.status == 0){
|
|
|
|
|
- this.$refs.cancelWorkRef.open('center')
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- confirmCancel(){
|
|
|
|
|
- uni.showLoading({mask:true})
|
|
|
|
|
- cancelWork({id:this.orderInfo.id}).then(res=>{
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
- if(res.code == 1){
|
|
|
|
|
- this.$msg('已取消')
|
|
|
|
|
- this.getOrderDetail(this.orderInfo.id)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- wastageFn(item){
|
|
|
|
|
- this.customData = {...item,currentNum:1,property:1}
|
|
|
|
|
- this.$refs.wastageSelectNumRef.open('center')
|
|
|
|
|
- this.workItemId = item.id
|
|
|
|
|
- },
|
|
|
|
|
- confirmWastageSelectNum(info){
|
|
|
|
|
- this.$refs.wastageSelectNumRef.close()
|
|
|
|
|
- modifyWastage({...info,id:this.workItemId,num:info.currentNum}).then(res=>{
|
|
|
|
|
- if(res.code == 1){
|
|
|
|
|
- this.getOrderDetail(this.orderInfo.id)
|
|
|
|
|
- }else{
|
|
|
|
|
- this.$msg('报损失败,请重试')
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- cancelWastageSelectNum(){
|
|
|
|
|
- this.$util.hitVoice()
|
|
|
|
|
- this.$refs.wastageSelectNumRef.close()
|
|
|
|
|
- },
|
|
|
|
|
- finishFn(info){
|
|
|
|
|
- this.$util.hitVoice()
|
|
|
|
|
- if(info.status == 0){
|
|
|
|
|
- this.$refs.finishRef.open('center')
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- confirmFinish(){
|
|
|
|
|
- let params = {id:this.orderInfo.id}
|
|
|
|
|
- if(!this.$util.isEmpty(this.selectList)){
|
|
|
|
|
- const newItem = this.selectList.map(ele=>{
|
|
|
|
|
- return {productId:ele.id,num:ele.currentNum,unitType:ele.unitType,unitPrice:ele.unitPrice}
|
|
|
|
|
- })
|
|
|
|
|
- params = {...params,itemList:JSON.stringify(newItem)}
|
|
|
|
|
- }
|
|
|
|
|
- uni.showLoading({mask:true})
|
|
|
|
|
- finish(params).then(res=>{
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
- if(res.code == 1){
|
|
|
|
|
- this.$msg(res.msg)
|
|
|
|
|
- this.getOrderDetail(this.orderInfo.id)
|
|
|
|
|
- //完成之后刷新列表
|
|
|
|
|
- this.$emit('finishNotice')
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- cancelFinish(){
|
|
|
|
|
- this.$util.hitVoice()
|
|
|
|
|
- this.$refs.finishWorkRef.close()
|
|
|
|
|
- },
|
|
|
|
|
- modifyItem(info){
|
|
|
|
|
- if(info.stockLock == 0){
|
|
|
|
|
- this.$util.hitVoice()
|
|
|
|
|
- this.$util.pageTo({url:'/pages/home/modify',query: { id:info.id }})
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
getStatus(status) {
|
|
getStatus(status) {
|
|
|
status = Number(status)
|
|
status = Number(status)
|
|
|
switch (status) {
|
|
switch (status) {
|
|
@@ -329,53 +222,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
getOrderDetail(id){
|
|
getOrderDetail(id){
|
|
|
-
|
|
|
|
|
- getFullInfo({id}).then(res=>{
|
|
|
|
|
|
|
+ getDetail({id}).then(res=>{
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
this.orderInfo = res.data.info
|
|
this.orderInfo = res.data.info
|
|
|
-
|
|
|
|
|
- let that = this
|
|
|
|
|
- this.beginCount = Number(this.orderInfo.beginCount)
|
|
|
|
|
- if(this.beginCount > 0 && this.orderInfo.fromType ==4){
|
|
|
|
|
- if(this.INT){
|
|
|
|
|
- clearInterval(this.INT)
|
|
|
|
|
- }
|
|
|
|
|
- that.INT = setInterval(function(){
|
|
|
|
|
- that.beginCount--
|
|
|
|
|
- if(that.beginCount <= 0){
|
|
|
|
|
- clearInterval(that.INT)
|
|
|
|
|
- }
|
|
|
|
|
- },1000)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- let bigNum = 0
|
|
|
|
|
- let smallNum = 0
|
|
|
|
|
- this.orderItem = res.data.item
|
|
|
|
|
- if(!this.$util.isEmpty(this.orderItem)){
|
|
|
|
|
- for (const ele of this.orderItem) {
|
|
|
|
|
- if(ele.unitType ==0){
|
|
|
|
|
- bigNum = bigNum + Number(ele.num)
|
|
|
|
|
- }else{
|
|
|
|
|
- smallNum = smallNum + Number(ele.num)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- bigNum = bigNum.toFixed()
|
|
|
|
|
- smallNum = smallNum.toFixed()
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if(this.orderItem && !this.$util.isEmpty(this.orderItem)){
|
|
|
|
|
- const newItem = this.orderItem.map(ele=>{
|
|
|
|
|
- return {name:ele.name,cover:ele.cover,shortCover:ele.shortCover,itemId:ele.ptItemId,id:ele.itemId,unitName:ele.unitName,unitType:ele.unitType,
|
|
|
|
|
- unitPrice:ele.unitPrice,ratio:ele.ratio,mainId:ele.mainId,currentNum:ele.num,bigUnit:ele.bigName,smallUnit:ele.smallName,property:1}
|
|
|
|
|
- })
|
|
|
|
|
- this.pushToSave(newItem)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- this.unitUseItem = {bigNum,smallNum}
|
|
|
|
|
- let orderNum = this.orderInfo.num || 0
|
|
|
|
|
- let totalBig = (bigNum*Number(orderNum)).toFixed()
|
|
|
|
|
- let totalSmall = (smallNum*Number(orderNum)).toFixed()
|
|
|
|
|
- this.totalUseItem = {bigNum:totalBig,smallNum:totalSmall}
|
|
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|