Ver código fonte

Merge branch 'develop_yh13' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_yh13

chenrui 2 anos atrás
pai
commit
a97be1f1ed

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1675994722208
+  "version": 1676015657155
 }

+ 2 - 2
src/api/purchaseDetail.js

@@ -63,7 +63,7 @@ export const purchaseDetailCancelList = (params) => {
     method: 'post'
   })
 }
-//  采购 详情 上次缺货 列表 分页
+//  采购 详情 上次缺货 购物车 保存
 export const purchaseDetailCancelSave = (params) => {
   return axios({
     url: '/purchaseDetail/saveCancelProduct',
@@ -79,4 +79,4 @@ export const purchaseDetailDownloadFail = params => {
     data: params,
     responseType: 'blob'
   })
-}
+}

+ 2 - 2
src/components/tools/UserMenu.vue

@@ -6,7 +6,7 @@
         <span style="vertical-align: middle;">帮助</span>
       </p>
       <p class="help-cont" @click="showShopCar" v-if="$hasPermissions('M_shoppingCart')">
-        <a-badge :count="cartCount">
+        <a-badge :count="cartCount" :overflow-count="999">
           <a-icon type="shopping-cart" style="font-size:16px;margin: 0 5px;"/>
           <span>购物车</span>
         </a-badge>
@@ -108,7 +108,7 @@ export default {
     NoticeIcon
   },
   computed: {
-    ...mapGetters(['nickname', 'avatar', 'authOrgs', 'userInfo', 'nowRoute', 'theme', 'fontSize', 'printDefNeedle','cartCount']),
+    ...mapGetters(['nickname', 'avatar', 'authOrgs', 'userInfo', 'nowRoute', 'theme', 'fontSize', 'printDefNeedle', 'cartCount']),
     authOrgsList () { //  过滤掉当前登录账户(不可由自己切换为自己)
       const _this = this
       const arr = []

+ 3 - 4
src/views/common/shopingCatModal.vue

@@ -12,7 +12,7 @@
        <strong>{{title}}</strong>
        <span style="color:red;margin-left:10px;">注意:仅可添加本供应商有经销权且总部已上线的产品</span>
      </div>
-     <shopingCat ref="shopingCat" modes="modals" @add="handleAdd"></shopingCat>
+     <shopingCat ref="shopingCat" modes="modals" @ok="handleok"></shopingCat>
   </a-drawer>
 </template>
 
@@ -62,9 +62,8 @@ export default {
     onClose () {
       this.$emit('close')
     },
-    handleAdd (record) {
-      this.spinning = true
-      this.$emit('add', record, 0)
+    handleok () {
+      this.$emit('ok')
     },
   }
 }

+ 7 - 7
src/views/inventoryManagement/inventoryQuery/setPurchaseQty.vue

@@ -18,10 +18,10 @@
         :wrapper-col="formItemLayout.wrapperCol"
       >
         <a-form-model-item label="产品名称:">
-          {{dateilData&&dateilData.productName}}
+          {{ dateilData&&dateilData.productName }}
         </a-form-model-item>
         <a-form-model-item label="产品编码">
-          {{dateilData&&dateilData.productCode}}
+          {{ dateilData&&dateilData.productCode }}
         </a-form-model-item>
         <a-form-model-item label="采购数量" prop="qty">
           <a-input-number
@@ -29,7 +29,7 @@
             style="width:60%"
             v-model="form.qty"
             :precision="0"
-            :min="0"
+            :min="1"
             :max="999999"
             placeholder="采购数量"/>
         </a-form-model-item>
@@ -66,19 +66,19 @@ export default {
       },
       form: {
         qty: 1,
-        productSn:'',
+        productSn: '',
         productCode: '',
         sysFlag: ''
       },
       rules: {
-        qty: [{ required: true, message: '请输入采购数量', trigger: 'change' }],
+        qty: [{ required: true, message: '请输入采购数量', trigger: 'change' }]
       },
       dateilData: null
     }
   },
   methods: {
     ...mapActions(['getCartList']),
-    setData(row){
+    setData (row) {
       this.dateilData = row
       this.form.productSn = row.productSn
       this.form.productCode = row.productCode
@@ -109,7 +109,7 @@ export default {
           return false
         }
       })
-    },
+    }
   },
   watch: {
     //  父页面传过来的弹框状态

+ 4 - 1
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -125,7 +125,10 @@
                 </template>
                 <!-- 包装数 -->
                 <template slot="baozh" slot-scope="text, record">
-                  {{ record.packQty||'--' }}/{{ record.packQtyUnit||'--' }}
+                  <span v-if="record.packQty&&record.packQtyUnit">
+                    {{ record.packQty||'--' }}{{ record.unit }}/{{ record.packQtyUnit||'--' }}
+                  </span>
+                  <span v-else>--</span>
                 </template>
                 <!-- 产品编码 -->
                 <template slot="code" slot-scope="text, record">

+ 5 - 2
src/views/purchasingManagement/purchaseOrderNew/chooseProductModal.vue

@@ -25,7 +25,7 @@
                   <a-input id="purchaseOrderEdit-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
                 </a-form-model-item>
               </a-col>
-             <!-- <a-col :flex="2">
+              <!-- <a-col :flex="2">
                 <a-form-model-item label="原厂编码">
                   <a-input id="purchaseOrderEdit-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
                 </a-form-model-item>
@@ -71,7 +71,10 @@
           </template>
           <!-- 包装数 -->
           <template slot="baozh" slot-scope="text, record">
-            {{ record.packQty||'--' }}/{{ record.packQtyUnit||'--' }}
+            <span v-if="record.packQty&&record.packQtyUnit">
+              {{ record.packQty||'--' }}{{ record.unit }}/{{ record.packQtyUnit||'--' }}
+            </span>
+            <span v-else>--</span>
           </template>
           <!-- 产品编码 -->
           <template slot="code" slot-scope="text, record">

+ 25 - 15
src/views/purchasingManagement/purchaseOrderNew/edit.vue

@@ -20,16 +20,16 @@
       <!-- 基础信息 -->
       <div style="padding:10px;" v-if="isShowBisiceInfo">
         <a-descriptions title="基础信息" size="small">
-          <a-descriptions-item label="供应商">
+          <a-descriptions-item label="供应商">
             {{ detail&&detail.purchaseTargetName || '--' }}
           </a-descriptions-item>
-          <a-descriptions-item label="支付方式">
+          <a-descriptions-item label="支付方式">
             {{ detail&&detail.settleStyleSnDictValue || '--' }}
           </a-descriptions-item>
-          <a-descriptions-item label="收货人">
+          <a-descriptions-item label="收货人">
             {{ detail&&detail.consigneeName || '--' }}({{ detail&&detail.consigneeTel || '--' }})
           </a-descriptions-item>
-          <a-descriptions-item label="收货地址" span="3">
+          <a-descriptions-item label="收货地址" span="3">
             <div v-if="detail&&(detail.shippingAddressProvinceName || detail.shippingAddressCityName || detail.shippingAddressCountyName || detail.shippingAddress)">
               {{ detail&&detail.shippingAddressProvinceName || '' }}
               {{ detail&&detail.shippingAddressCityName || '' }}
@@ -53,7 +53,7 @@
       <!-- 上次缺货 -->
       <outStockModal :openModal="openOutStockModal" :paramsData="paramsData" @close="openOutStockModal=false" @ok="hanldeOkOutStock" />
       <!-- 购物车 -->
-      <shopingCatModal :showModal="openShopCatModal" :paramsData="paramsData" @close="openShopCatModal=false"></shopingCatModal>
+      <shopingCatModal :showModal="openShopCatModal" :paramsData="paramsData" @close="openShopCatModal=false" @ok="getOrderDetail(false, true)"></shopingCatModal>
       <!-- 已选产品 -->
       <div>
         <div class="chooseBox-title">
@@ -65,7 +65,7 @@
             <a-button v-if="detail&&detail.totalCategory" id="purchaseNewOrderEdit-add-btn" type="danger" @click="openChooseProduct=true"><a-icon type="plus-circle" />添加产品</a-button>
             <a-button id="purchaseNewOrderEdit-import-btn" type="danger" ghost @click="openGuideModal=true"><a-icon type="import" />产品导入</a-button>
             <a-button id="purchaseNewOrderEdit-outStock-btn" type="danger" ghost @click="handleOutStock"><a-icon type="funnel-plot" />上次缺货</a-button>
-            <a-button id="purchaseNewOrderEdit-cart-btn" type="danger" ghost @click="hanldCart"><a-icon type="shopping" />购物车</a-button>
+            <a-button id="purchaseNewOrderEdit-cart-btn" v-if="$hasPermissions('M_shoppingCart')" type="danger" ghost @click="hanldCart"><a-icon type="shopping" />购物车</a-button>
           </div>
         </div>
         <div class="choosed-table" v-if="detail&&detail.totalCategory">
@@ -187,7 +187,6 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import ImportGuideModal from './importGuideModal.vue'
 import outStockModal from './outStockModal.vue'
-const shopingCatModal = () => import(/* webpackChunkName: "shopingCatModal" */ '@/views/common/shopingCatModal.vue');
 import chooseAddressModal from '@/views/common/receivingAddress/chooseAddressModal.vue'
 import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint, purchaseDetailExport, purchaseDetailAddress } from '@/api/purchase'
 import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel, purchaseDetailCount, purchaseDetailCancelList } from '@/api/purchaseDetail'
@@ -196,6 +195,7 @@ import chooseProductModal from './chooseProductModal.vue'
 // 打印
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
+const shopingCatModal = () => import(/* webpackChunkName: "shopingCatModal" */ '@/views/common/shopingCatModal.vue')
 export default {
   name: 'PurchaseEdit',
   components: { STable, VSelect, ImportGuideModal, outStockModal, Print, chooseAddressModal, chooseProductModal, shopingCatModal },
@@ -275,13 +275,13 @@ export default {
         if (res.status == 200) {
           this.detail = res.data
           if (!noRefashTable) {
-            if(this.detail.totalCategory){
+            if (this.detail.totalCategory) {
               if (isReset) {
                 this.resetPurchaseForm()
               } else {
                 this.$refs.purchaseTable.refresh(!!flag)
               }
-            }else{
+            } else {
               this.localDataSource = []
               this.spinning = false
             }
@@ -356,8 +356,12 @@ export default {
       this.addLoading = true
       purchaseDetailSave(params).then(res => {
         if (res.status == 200) {
-          this.getOrderDetail(false, true, true)
+          if (type == 0) {
+            this.getOrderDetail(false, true, true)
+          }
           this.$message.success(res.message)
+        } else {
+          row.qty = row.qtyBackups
         }
         this.addLoading = false
         this.$refs.chooseProduct.spinning = false
@@ -386,11 +390,12 @@ export default {
       this.getOrderDetail(false, true, true)
     },
     // 打开购物车
-    hanldCart(){
+    hanldCart () {
       this.paramsData = {
-        purchaseBillSn: this.$route.params.sn
+        purchaseBillSn: this.$route.params.sn,
+        purchaseBillNo: this.detail && this.detail.purchaseBillNo ? this.detail.purchaseBillNo : undefined
       }
-      this.openShopCatModal=true
+      this.openShopCatModal = true
     },
     // 上次缺货
     handleOutStock () {
@@ -432,7 +437,7 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type, printerType) {
       const _this = this
-      if(type == 'preview'){
+      if (type == 'preview') {
         _this.openChooseProduct = false
         _this.openOutStockModal = false
       }
@@ -453,7 +458,7 @@ export default {
       this.$router.push({ name: 'purchaseOrderNewList' })
     },
     setTableH () {
-      this.tableHeight = window.innerHeight - 310
+      this.tableHeight = window.innerHeight - (this.isShowBisiceInfo ? 440 : 310)
     },
     pageInit () {
       this.$nextTick(() => {
@@ -462,6 +467,11 @@ export default {
       })
     }
   },
+  watch: {
+    isShowBisiceInfo (newValue, oldValue) {
+      this.setTableH()
+    }
+  },
   mounted () {
     this.showPage = true
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用

+ 16 - 10
src/views/purchasingManagement/purchaseOrderNew/outStockModal.vue

@@ -180,18 +180,29 @@ export default {
         this.$message.warning('请在列表勾选后再进行操作!')
         return
       }
+      const rows = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+      const list = []
+      rows.map(item => {
+        list.push({
+          cancelQty: item.cancelQty,
+          qty: item.qty,
+          productSn: item.productSn,
+          price: item.price
+        })
+      })
+      
       const params = {
         confirm: false,
         purchaseBillSn: this.paramsData.purchaseBillSn,
         purchaseBillNo: this.paramsData.purchaseBillNo,
-        purchaseBillDetailEntityList: this.rowSelectionInfo && this.rowSelectionInfo.selectedRows
+        purchaseBillDetailEntityList: list
       }
       purchaseDetailCancelSave(params).then(res => {
         if (res.status == 200 && res.data) {
           let content = ''
           if ((res.data.productSizeRepeat != res.data.productSize) && (res.data.productSizeRepeat != 0)) {
             content = `您已经选择 ${res.data.productSize} 个产品,其中 ${res.data.productSizeRepeat} 个产品已经存在于采购单中。本次只会加入不重复的产品,上次缺货数量将作为本次采购数量。确认加入本次采购吗?`
-            this.confirmFun(content)
+            this.confirmFun(content,params)
           } else if (res.data.productSizeRepeat == res.data.productSize) {
             content = `抱歉,您选择的 ${res.data.productSize} 个产品,采购单中已经全部存在,无需加入!`
             this.$info({
@@ -206,12 +217,12 @@ export default {
             })
           } else {
             content = `您已经选择 ${res.data.productSize} 个产品,上次缺货数量将作为本次采购数量。确认加入本次采购吗?`
-            this.confirmFun(content)
+            this.confirmFun(content,params)
           }
         }
       })
     },
-    confirmFun (content) {
+    confirmFun (content,params) {
       const _this = this
       this.$confirm({
         title: '提示',
@@ -223,12 +234,7 @@ export default {
         zIndex: 1100,
         onOk () {
           _this.spinning = true
-          const params = {
-            confirm: true,
-            purchaseBillSn: _this.paramsData.purchaseBillSn,
-            purchaseBillNo: _this.paramsData.purchaseBillNo,
-            purchaseBillDetailEntityList: _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows
-          }
+          params.confirm = true
           purchaseDetailCancelSave(params).then(res => {
             if (res.status == 200) {
               _this.$emit('ok')

+ 93 - 14
src/views/shoppingCarManagement/shoppingCar/list.vue

@@ -74,11 +74,22 @@
       bordered>
       <!-- 采购数量 -->
       <template slot="purchaseQty" slot-scope="text, record">
-        <a-input placeholder="请输入采购数量" v-model="record.qty" @change="updateQty(record)"/>
+        <a-input-number
+          size="small"
+          v-model="record.qty"
+          :precision="0"
+          :min="1"
+          :max="999999"
+          @blur="updateQty(record)"
+          style="width: 100%;"
+          placeholder="请输入采购数量" />
       </template>
       <!-- 包装数 -->
       <template slot="baozh" slot-scope="text, record">
-        {{ record.productEntity.packQty||'--' }}/{{ record.productEntity.packQtyUnit||'--' }}
+        <span v-if="record.productEntity.packQty&&record.productEntity.packQtyUnit">
+          {{ record.productEntity.packQty||'--' }}{{ record.productEntity.unit }}/{{ record.productEntity.packQtyUnit||'--' }}
+        </span>
+        <span v-else>--</span>
       </template>
       <!-- 产品编码 -->
       <template slot="productCode" slot-scope="text, record">
@@ -100,6 +111,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { mapActions } from 'vuex'
 import { purchaseCartList, purchaseDeleteBatch, purchaseUpdateQty } from '@/api/purchaseCart'
+import { purchaseDetailCancelSave } from '@/api/purchaseDetail'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import { STable, VSelect } from '@/components'
@@ -199,14 +211,18 @@ export default {
     },
     // 修改数量
     updateQty (row) {
-      purchaseUpdateQty({ qty: row.qty, purchaseCartSn: row.purchaseCartSn }).then(res => {
-        if (res.status == 200) {
-          this.$message.info(res.message)
-          row.qtyBack = row.qty
-        } else {
-          row.qty = row.qtyBack
-        }
-      })
+      if (row.qty != row.qtyBack && row.qty) {
+        purchaseUpdateQty({ qty: row.qty, purchaseCartSn: row.purchaseCartSn }).then(res => {
+          if (res.status == 200) {
+            this.$message.info(res.message)
+            row.qtyBack = row.qty
+          } else {
+            row.qty = row.qtyBack
+          }
+        })
+      } else {
+        row.qty = row.qtyBack
+      }
     },
     // 批量删除
     deleteMore () {
@@ -234,23 +250,86 @@ export default {
         }
       })
     },
-    // 批量添加
+    // 保存
     addMore () {
+      const _this = this
       const rows = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys || []
       if (!this.rowSelectionInfo || (rows.length <= 0)) {
         this.$message.warning('请在列表勾选后再进行批量操作!')
         return
       }
+      const rowsList = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+      const list = []
+      rowsList.map(item => {
+        list.push({
+          cancelQty: item.qty,
+          qty: item.qty,
+          productSn: item.productSn,
+          price: item.productEntity.purchasePrice
+        })
+      })
+      const params = {
+        confirm: false,
+        purchaseBillSn: this.paramsData.purchaseBillSn,
+        purchaseBillNo: this.paramsData.purchaseBillNo,
+        purchaseBillDetailEntityList: list,
+        purchaseCartFlag: true
+      }
+      purchaseDetailCancelSave(params).then(res => {
+        if (res.status == 200 && res.data) {
+          let content = ''
+          if ((res.data.productSizeRepeat != res.data.productSize) && (res.data.productSizeRepeat != 0)) {
+            content = `您已经选择 ${res.data.productSize} 个产品,其中 ${res.data.productSizeRepeat} 个产品已经存在于采购单中,本次只会加入不重复的产品。确认加入本次采购吗?`
+            this.confirmFun(content, params)
+          } else if (res.data.productSizeRepeat == res.data.productSize) {
+            content = `抱歉,您选择的 ${res.data.productSize} 个产品,采购单中已经全部存在,无需加入!`
+            this.$info({
+              title: '提示',
+              content: content,
+              okText: '好的',
+              centered: true,
+              zIndex: 1100,
+              onOk () {
+                _this.$refs.table.clearSelected() // 清空表格选中项
+              }
+            })
+          } else {
+            content = `您已经选择 ${res.data.productSize} 个产品,确认要将已选产品加入本次采购吗?`
+            this.confirmFun(content, params)
+          }
+        }
+      })
+    },
+    confirmFun (content, params) {
+      const _this = this
       this.$confirm({
         title: '提示',
-        content: '确定批量添加吗?',
+        content: content,
+        okText: '确认加入',
+        cancelText: '重新选择',
         centered: true,
-        onOk: () => {
+        closable: true,
+        zIndex: 1100,
+        onOk () {
+          _this.loading = true
+          params.confirm = true
+          purchaseDetailCancelSave(params).then(res => {
+            if (res.status == 200) {
+              _this.$emit('ok')
+              _this.getCartList()
+              _this.searchForm()
+              _this.loading = false
+            } else {
+              _this.loading = false
+            }
+          })
+        },
+        onCancel () {
+          _this.$refs.table.clearSelected() // 清空表格选中项
         }
       })
     },
     pageInit (paramsData) {
-      const _this = this
       this.paramsData = paramsData || {}
       this.setTableH()
       this.getColumns()

+ 1 - 1
vue.config.js

@@ -211,7 +211,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.0.216:8503/qpls-md',
+        // target: 'http://192.168.0.183:8503/qpls-md',
         target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,