|
|
@@ -22,18 +22,19 @@
|
|
|
</form>
|
|
|
</view>
|
|
|
|
|
|
- <view style="text-align:center;border-top:1upx dashed #cccccc;padding-top:30upx;padding-bottom:30upx;">
|
|
|
- <button @click="clearXj" class="admin-button-com middle default">清空全部</button>
|
|
|
+ <view style="text-align:center;border-top:1upx dashed #cccccc;padding-top:30upx;padding-bottom:20upx;">
|
|
|
</view>
|
|
|
|
|
|
+ <view style="margin-bottom:18upx;font-size:28upx;text-align:center;font-weight:bold;color:red;">注意:-1 表示库存充足</view>
|
|
|
+
|
|
|
<view class="billing_box_bg">
|
|
|
<view class="scroll-middle_bx">
|
|
|
<block>
|
|
|
<view class="item_list_bx" style="width: 100%">
|
|
|
<view v-for="(xjItem,xjIndex) in xjList" :key="xjIndex">
|
|
|
- <view>
|
|
|
- <view class="item-cmd_bx" @click="previewImage(xjItem.bigCover)">
|
|
|
- <view class="img_bx" style="background:#eeeeee">
|
|
|
+ <view style="height:190upx;">
|
|
|
+ <view class="item-cmd_bx">
|
|
|
+ <view class="img_bx" style="background:#eeeeee" @click="previewImage(xjItem.bigCover)">
|
|
|
<image :src="xjItem.cover"></image>
|
|
|
</view>
|
|
|
<view class="cmd-info_bx">
|
|
|
@@ -41,9 +42,10 @@
|
|
|
<view class="kc"></view>
|
|
|
<view class="num-open_bx">
|
|
|
<view class="open-bx warn" @tap.stop.prevent>
|
|
|
- <text v-if="xjItem.status == 2" style="color:#777777;">已停用</text>
|
|
|
- <text v-else style="color:green;">已启用</text>
|
|
|
- <switch :checked="xjItem.status == 2 ? false : true" @change="changeXjStatusFn($event,xjItem.id)" style="transform: scale(0.8,0.8)" />
|
|
|
+ <input type="number" v-model="xjItem.stock"
|
|
|
+ style="width:230upx;border:1upx solid #cccccc;position:absolute;top:80upx;left:230upx;height:60upx;font-size:30upx;" placeholder="请填写数量" />
|
|
|
+ <text v-if="xjItem.stock!='' && Number(xjItem.stock) == 0"
|
|
|
+ style="position:absolute;top:90upx;left:510upx;font-size:30upx;color:red;font-weight:bold;">下架</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -55,12 +57,17 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
+ <view class="app-footer">
|
|
|
+ <button class="admin-button-com big default" @click="clearXj">清空全部</button>
|
|
|
+ <button class="admin-button-com big blue" style="margin-left:50upx;" @click="saveAllItemNum()">保存数量</button>
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty"
|
|
|
import { mapGetters } from "vuex"
|
|
|
-import { getFilterXj,ReplaceXj,clearAll,batchAdd } from "@/api/product/xj"
|
|
|
+import { getFilterXj,ReplaceXj,clearAll,batchAdd,saveAllNum } from "@/api/product/xj"
|
|
|
//图片上传插件来源:https://ext.dcloud.net.cn/plugin?id=2922 已改造,不能再升级 shish 20211228
|
|
|
import htzImageUpload from './components/htz-image-upload/htz-image-upload.vue'
|
|
|
export default {
|
|
|
@@ -97,6 +104,34 @@ export default {
|
|
|
this.headers.token = token
|
|
|
},
|
|
|
methods: {
|
|
|
+ saveAllItemNum(){
|
|
|
+ let that = this
|
|
|
+ if(this.$util.isEmpty(this.xjList)){
|
|
|
+ that.$msg('没有花材')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ for (const ele of this.xjList) {
|
|
|
+ if(ele.stock == ''){
|
|
|
+ that.$msg('请填写 '+ele.name+' 库存数')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(ele.stock%1 !== 0){
|
|
|
+ that.$msg(ele.name+' 库存填写错误')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(Number(ele.stock)<-1){
|
|
|
+ that.$msg(ele.name+' 库存填写错误')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const product = this.xjList.map(ele => {
|
|
|
+ return { id: ele.id, stock:ele.stock}
|
|
|
+ })
|
|
|
+ let data = JSON.stringify(product)
|
|
|
+ saveAllNum({itemId:this.option.itemId,data:data}).then(res => {
|
|
|
+ that.$msg(res.msg)
|
|
|
+ })
|
|
|
+ },
|
|
|
clearXj(){
|
|
|
let that = this
|
|
|
that.$util.confirmModal({content:'确认清空全部?'},() => {
|
|
|
@@ -177,6 +212,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.billing_box_bg {
|
|
|
+ margin-bottom:200upx;
|
|
|
height: 100%;
|
|
|
display: flex;
|
|
|
background: white;
|