Browse Source

轮胎商城采购批次号和一键弹窗 2023-12-01

caojunjie 1 year ago
parent
commit
93876da451

+ 20 - 7
src/views/tirePartsMall/salesManagement/purchaseOrder/detailsPage.vue

@@ -45,7 +45,7 @@
                 </el-dropdown>
                 <el-button class="el-button&#45;&#45;small-yh" style="margin-left: 6px;" v-if="form.id"
                            type="success" size="small"
-                           :disabled="form.shortcutWarehousingStatus == '1'"
+                           :disabled="form.shortcutWarehousingStatus == '1' || editButton"
                            @click="oneClickStorage" >一键采购入库
                 </el-button>
             </div>
@@ -106,7 +106,7 @@
                                 <span v-else>{{ row.price }}</span>
                             </template>
                             <template slot="dot" slot-scope="{ row }">
-                                <el-select v-if="!mingxibaocun && row.whether=='1'" v-model="row.dot" allow-create filterable default-first-option @focus="picihaolistfun(row.goodsId)">
+                                <el-select v-if="!mingxibaocun && row.whether == '1'" v-model="row.dot" allow-create filterable default-first-option @focus="picihaolistfun(row.goodsId)">
                                     <el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
                                         :value="item.dot"></el-option>
                                 </el-select>
@@ -279,6 +279,7 @@
 
 <script>
 import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerInformation"
+import {getDetails as getDetailsLT} from "@/api/tirePartsMall/basicData/commodityInformation/index"
 import { dateFormat } from "@/util/date";
 import { getToken } from "@/util/auth";
 import {
@@ -1155,10 +1156,15 @@ export default {
     methods: {
         // 一键入库
         oneClickStorage(){
-            this.$confirm("是否要一件入库?", "提示", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
-                type: "warning"
+            // 计算合计用于展示
+            let goodsNumhe = 0
+            let pricehe = 0
+            for (let item of this.form.orderItemsList) {
+                goodsNumhe += Number(item.goodsNum)
+                pricehe += Number(item.price)
+            }
+            this.$alert(`<div style="text-align: center"><span style="color: #d85542">一件采购入库不可撤销,请确认无误在操作</span><br><span>本次入库金额:${pricehe}</span><br><span>本次入库数量:${goodsNumhe}</span><br><span>是否要一件采购入库?</span></div>`, '提示', {
+                dangerouslyUseHTMLString: true,
             }).then(()=>{
                 const loading = this.$loading({
                     lock: true,
@@ -1394,7 +1400,14 @@ export default {
         },
         // 采购明细行编辑
         hangeditBtn(row,index){
-            this.picihaolistfun(row.id)
+            for (let item of this.form.orderItemsList) {
+                this.picihaolistfun(item.goodsId)
+                getDetailsLT({id:item.goodsId}).then((res)=>{
+                    this.$set(item,'whether',res.data.data.whether)
+                })
+            }
+
+
             row.dotedittype = true
             // 价格数量
             row.goodsNumtype = true