|
|
@@ -3,9 +3,21 @@
|
|
|
<view v-if="!$util.isEmpty(detailInfo)" class="info-content_box">
|
|
|
<view class="module-com content-box">
|
|
|
<view class="commodity-view">
|
|
|
+ <view style="text-align:right;margin-right:20upx;padding-top:10upx;" v-if="detailInfo.book == 1 && detailInfo.status == 2 && parseFloat(detailInfo.actPrice) == 0">
|
|
|
+ <button class="admin-button-com default mini-btn" @click="addItem(detailInfo)">添加花材</button>
|
|
|
+ </view>
|
|
|
<view class="commodity-list">
|
|
|
- <view v-for="(s, idx) in detailInfo.product" :key="idx" class="commodity-item" >
|
|
|
+ <view v-for="(s, idx) in detailInfo.product" :key="idx" class="commodity-item" style="position:relative;">
|
|
|
<image class="item-icon" :src="s.cover" alt="" @click="pageTo({url:'/admin/item/detail?id='+s.productId})" />
|
|
|
+
|
|
|
+ <button v-if="detailInfo.book == 1 && detailInfo.status == 2 && parseFloat(detailInfo.actPrice) == 0" style="position:absolute;left:26upx;font-size:22upx;" class="admin-button-com default mini-btn" @click="changeOption(s)">更换</button>
|
|
|
+ <button v-if="detailInfo.book == 1 && detailInfo.status == 2 && parseFloat(detailInfo.actPrice) == 0" style="position:absolute;top:95upx;left:26upx;font-size:22upx;" class="admin-button-com default mini-btn" @click="delOption(s)">删除</button>
|
|
|
+
|
|
|
+ <text style="position:absolute;left:155upx;top:103upx;color:#3385FF;cursor: pointer" @click="giveItemFn(s)">挪库存</text>
|
|
|
+
|
|
|
+ <text style="position:absolute;left:608upx;top:120upx;color:#CCCCCC;font-size:21upx;">剩 {{ s.stock }}</text>
|
|
|
+ <text style="position:absolute;left:442upx;top:120upx;color:#CCCCCC;font-size:21upx;">成本{{ s.cost?parseFloat(s.cost):0 }}</text>
|
|
|
+
|
|
|
<view class="item-info">
|
|
|
<view class="info-line">
|
|
|
<text class="item-name" @click="pageTo({url:'/admin/item/detail?id='+s.productId})">{{ s.name }}</text>
|
|
|
@@ -16,9 +28,10 @@
|
|
|
</view>
|
|
|
<view class="info-line">
|
|
|
<text class="item-type"></text>
|
|
|
- <view class="item-count">
|
|
|
- <input type="number" class="num" v-model="s.xhNum" placeholder="发货数量" />
|
|
|
- <input type="digit" class="price" v-model="s.currentHdPrice" placeholder="售价" />
|
|
|
+ <view class="item-count" style="width:310upx;">
|
|
|
+ <input type="number" class="num" :class="[Number(s.xhNum)>Number(s.stock) ? 'stock-red' : '']" v-model="s.xhNum" placeholder="数量" style="width:100upx;" />
|
|
|
+ <input type="digit" class="price" v-model="s.currentHdPrice" placeholder="价格" style="width:120upx;" />
|
|
|
+ <text style="display:inline-block;height:50upx;line-height:50upx;">价格</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -73,8 +86,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="app-footer">
|
|
|
- <button class="admin-button-com big default" @click="goBack()">取消</button>
|
|
|
- <button class="admin-button-com big blue" @click="commitItem()">确认</button>
|
|
|
+ <button class="admin-button-com big default" @click="goBack()" style="margin-left:10upx;">取消</button>
|
|
|
+ <button class="admin-button-com big default" @click="savePrice()" style="margin:0 10upx 0 10upx;">保存</button>
|
|
|
+ <button class="admin-button-com big blue" @click="commitItem()" style="margin-right:10upx;">确认</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -82,6 +96,7 @@
|
|
|
import { mapGetters } from "vuex";
|
|
|
import TuiListCell from "@/components/plugin/list-cell";
|
|
|
import { getArrivalDetail,arrival } from "@/api/order/index";
|
|
|
+import { modifyBookItem,delItem } from "@/api/order-item";
|
|
|
export default {
|
|
|
name: "arrival",
|
|
|
components: {
|
|
|
@@ -134,6 +149,21 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ addItem(info){
|
|
|
+ let id = info.id ? info.id : 0
|
|
|
+ this.$util.pageTo({url: '/admin/item/select?id='+id})
|
|
|
+ },
|
|
|
+ delOption(item){
|
|
|
+ let that = this
|
|
|
+ that.$util.confirmModal({content:'确认删除?'},() => {
|
|
|
+ delItem({id:that.detailInfo.id,smallId:item.id}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.$msg(res.msg)
|
|
|
+ that.init()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
goBack(){
|
|
|
uni.navigateBack({ delta: 1 })
|
|
|
},
|
|
|
@@ -143,6 +173,20 @@ export default {
|
|
|
this.sendCost = res.data.sendCost ? res.data.sendCost : 0
|
|
|
this.packCost = res.data.packCost ? res.data.packCost : 0
|
|
|
},
|
|
|
+ savePrice(){
|
|
|
+ if(this.$util.isEmpty(this.detailInfo.product)){
|
|
|
+ this.$msg('没有花材信息')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ const data = this.detailInfo.product.map(ele => {
|
|
|
+ return { orderSn: ele.orderSn, xhNum:ele.xhNum,xhUnitPrice:ele.currentHdPrice,id:ele.id}
|
|
|
+ })
|
|
|
+ modifyBookItem({data:data,id:this.detailInfo.id}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.$msg(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
commitItem(){
|
|
|
let product = []
|
|
|
let hasError = false
|
|
|
@@ -314,6 +358,12 @@ export default {
|
|
|
border:1upx solid #cccccc;
|
|
|
float:right;
|
|
|
}
|
|
|
+ .stock-red{
|
|
|
+ border:2upx solid red;
|
|
|
+ color:red;
|
|
|
+ font-weight:bold;
|
|
|
+ font-size: 26upx;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|