|
|
@@ -7,6 +7,7 @@
|
|
|
<image :src="orderInfo.cover"></image>
|
|
|
</view>
|
|
|
<view class="order-item">
|
|
|
+ <view><text class="left">支数</text><text class="right">{{orderInfo.flowerNum}}</text></view>
|
|
|
<view><text class="left">分类</text><text class="right">{{orderInfo.catName}}</text></view>
|
|
|
<view><text class="left">名称</text><text class="right">{{orderInfo.name}}</text></view>
|
|
|
<view><text class="left">数量</text><text class="right">{{orderInfo.num}}</text></view>
|
|
|
@@ -30,18 +31,21 @@
|
|
|
<view class="info-line">
|
|
|
<text class="item-name">{{ s.name }}</text>
|
|
|
<text class="item-price">
|
|
|
- <text class="unit">5扎</text>
|
|
|
+ <text class="unit">{{s.num}}{{s.unitName}}</text>
|
|
|
</text>
|
|
|
</view>
|
|
|
<view class="info-line">
|
|
|
- <text class="item-type">20支/扎</text>
|
|
|
+ <text class="item-type">{{s.ratio}}{{s.smallName}}/{{s.bigName}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="summary-bar">
|
|
|
<view class="operate-view" ></view>
|
|
|
- <view class="describe-view"><text>2扎</text> <text>3支</text></view>
|
|
|
+ <view class="describe-view">
|
|
|
+ <text v-if="Number(unitUseItem.bigNum)>0">{{unitUseItem.bigNum}}扎</text>
|
|
|
+ <text v-if="Number(unitUseItem.smallNum)>0">{{unitUseItem.smallNum}}支</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -57,49 +61,59 @@
|
|
|
<view class="info-line">
|
|
|
<text class="item-name">{{ s.name }}</text>
|
|
|
<text class="item-price">
|
|
|
- <text class="unit">5扎</text>
|
|
|
+ <text class="unit">{{(s.num*orderInfo.num).toFixed()}}{{s.unitName}}</text>
|
|
|
</text>
|
|
|
</view>
|
|
|
<view class="info-line">
|
|
|
- <text class="item-type">20支/扎</text>
|
|
|
- <button class="wastage">报损</button>
|
|
|
+ <text class="item-type">{{s.ratio}}{{s.smallName}}/{{s.bigName}}</text>
|
|
|
+ <text style="font-size:9upx;position:relative;right:80upx;top:10upx;" v-if="Number(s.wastNum)>0">{{s.wastNum}}{{s.wastUnitName}}</text>
|
|
|
+ <button class="wastage" @click="wastageFn(s)">报损</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="summary-bar">
|
|
|
<view class="operate-view" ></view>
|
|
|
- <view class="describe-view"><text>2扎</text> <text>3支</text></view>
|
|
|
+ <view class="describe-view">
|
|
|
+ <text v-if="Number(totalUseItem.bigNum)>0">{{totalUseItem.bigNum}}扎</text>
|
|
|
+ <text v-if="Number(totalUseItem.smallNum)>0">{{totalUseItem.smallNum}}支</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="button-area">
|
|
|
- <view class="active" @tap="finish">完成</view>
|
|
|
- <view @click="modifyItem(orderInfo)">修改</view>
|
|
|
- <view>打印</view>
|
|
|
- <view>锁定</view>
|
|
|
- <view>取消</view>
|
|
|
+ <view :class="[orderInfo.status==0 ? 'active' : '']" @tap="finishFn()">完成</view>
|
|
|
+ <view :class="[orderInfo.stockLock==0 ? 'active' : '']" @click="modifyItem(orderInfo)">修改</view>
|
|
|
+ <view :class="[orderInfo.stockLock==0 ? 'active' : '']" @click="lockFn()">锁定</view>
|
|
|
+ <view :class="[orderInfo.status==1 ? 'active' : '']" @click="printFn()">打印</view>
|
|
|
+ <view :class="[orderInfo.status==0 ? 'active' : '']" @click="cancelFn()">取消</view>
|
|
|
</view>
|
|
|
|
|
|
- <!-- 完成工单弹框 -->
|
|
|
- <uni-popup ref="finishWorkRef" background-color="#fff" type="right">
|
|
|
- <finishWork></finishWork>
|
|
|
+ <!-- 选数量金额 -->
|
|
|
+ <uni-popup ref="wastageSelectNumRef" background-color="#fff" type="center" :animation="false">
|
|
|
+ <wastageSelectNum @confirmWastageSelectNum="confirmWastageSelectNum" :customData.sync="customData"
|
|
|
+ @cancelWastageSelectNum="cancelWastageSelectNum"></wastageSelectNum>
|
|
|
</uni-popup>
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { getFullInfo } from '@/api/work'
|
|
|
-import finishWork from './finishWork.vue'
|
|
|
+import { getFullInfo,finish } from '@/api/work'
|
|
|
+import {modifyWastage} from '@/api/work-item'
|
|
|
+import wastageSelectNum from './wastageSelectNum.vue'
|
|
|
export default {
|
|
|
name: "orderInfo",
|
|
|
- components: {finishWork},
|
|
|
+ components: {wastageSelectNum},
|
|
|
data() {
|
|
|
return {
|
|
|
orderInfo:[],
|
|
|
- orderItem:[]
|
|
|
+ orderItem:[],
|
|
|
+ unitUseItem:{bigNum:0,smallNum:0},
|
|
|
+ totalUseItem:{bigNum:0,smallNum:0},
|
|
|
+ customData:{},
|
|
|
+ workItemId:0
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
|
@@ -108,6 +122,8 @@ export default {
|
|
|
default: 0
|
|
|
}
|
|
|
},
|
|
|
+ computed:{
|
|
|
+ },
|
|
|
watch:{
|
|
|
selectOrderId:{
|
|
|
handler(newId){
|
|
|
@@ -119,9 +135,45 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
- finish(){
|
|
|
+ printFn(){
|
|
|
+
|
|
|
+ },
|
|
|
+ lockFn(){
|
|
|
+
|
|
|
+ },
|
|
|
+ cancelFn(){
|
|
|
+
|
|
|
+ },
|
|
|
+ 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('报损失败,请重试')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ finishFn(){
|
|
|
+
|
|
|
+ },
|
|
|
+ confirmFinish(form){
|
|
|
+ this.$refs.finishWorkRef.close()
|
|
|
+ finish({...form,id:this.orderInfo.id}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.$msg(res.msg)
|
|
|
+ this.getOrderDetail(this.orderInfo.id)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cancelFinish(){
|
|
|
this.$util.hitRemind()
|
|
|
- this.$refs.finishWorkRef.open()
|
|
|
+ this.$refs.finishWorkRef.close()
|
|
|
},
|
|
|
modifyItem(info){
|
|
|
this.$util.hitRemind()
|
|
|
@@ -147,6 +199,24 @@ export default {
|
|
|
if(res.code == 1){
|
|
|
this.orderInfo = res.data.info
|
|
|
this.orderItem = res.data.item
|
|
|
+ let bigNum = 0
|
|
|
+ let smallNum = 0
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ 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}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
@@ -212,8 +282,8 @@ export default {
|
|
|
text-align: center;
|
|
|
}
|
|
|
& .active {
|
|
|
- color: #1627be;
|
|
|
- border-color: #1627be;
|
|
|
+ color: #3385FF;
|
|
|
+ border-color: #3385FF;
|
|
|
font-size: 10upx;
|
|
|
font-weight:bold;
|
|
|
}
|