lilei 2 years ago
parent
commit
124fb768d8

+ 1 - 1
public/version.json

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

+ 2 - 2
src/utils/request.js

@@ -89,7 +89,7 @@ service.interceptors.request.use(config => {
   }
   config.retry = 3
   config.retryDelay = 1000
-  store.commit('SET_loadingStatus', true)
+  // store.commit('SET_loadingStatus', true)
   return config
 }, err)
 
@@ -120,7 +120,7 @@ service.interceptors.response.use((response) => {
       description: response.data.message
     })
   }
-  store.commit('SET_loadingStatus', false)
+  // store.commit('SET_loadingStatus', false)
   return response.data
 }, err)
 

+ 2 - 1
src/views/common/print.vue

@@ -4,7 +4,7 @@
       <a-radio value="NEEDLE">针式</a-radio>
       <a-radio value="INK">喷墨</a-radio>
     </a-radio-group>
-    <a-button key="3" id="print-preview-btn" :disabled="disabled" @click="handlePrint('preview')">打印预览</a-button>
+    <a-button key="3" id="print-preview-btn" :loading="$store.state.app.printLoading" :disabled="disabled" @click="handlePrint('preview')">打印预览</a-button>
     <a-button
       key="2"
       type="primary"
@@ -17,6 +17,7 @@
     <a-button
       key="1"
       type="primary"
+      :loading="$store.state.app.printLoading"
       class="button-warning"
       id="print-export-btn"
       v-if="showExport"

+ 1 - 1
src/views/purchasingManagement/purchaseOrder/outStockModal.vue

@@ -127,7 +127,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return purchaseDetailCancelList(parameter).then(res => {
+        return purchaseDetailCancelList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data

+ 19 - 16
src/views/purchasingManagement/purchaseOrderNew/chooseProductModal.vue

@@ -12,35 +12,35 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="chooseProduct-drawer-box">
         <!-- 搜索条件 -->
-        <div class="table-page-search-wrapper">
+        <div ref="searchBox" class="table-page-search-wrapper">
           <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-            <a-row :gutter="15">
-              <a-col :md="5" :sm="24">
+            <a-row type="flex" :gutter="12" justify="start">
+              <a-col flex="auto">
                 <a-form-model-item label="产品编码">
                   <a-input id="purchaseOrderEdit-code" ref="searchProductCode" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="5" :sm="24">
+              <a-col flex="auto">
                 <a-form-model-item label="产品名称">
                   <a-input id="purchaseOrderEdit-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
                 </a-form-model-item>
               </a-col>
-              <!-- <a-col :md="4" :sm="24">
-              <a-form-model-item label="原厂编码">
-                <a-input id="purchaseOrderEdit-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
-              </a-form-model-item>
-            </a-col> -->
-              <a-col :md="5" :sm="24">
+             <!-- <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>
+              </a-col> -->
+              <a-col flex="250px">
                 <a-form-item label="产品分类">
                   <ProductType id="purchaseOrderEdit-productType" :isDealer="true" :tenantId="$route.params.dealerSn" @change="changeProductType" v-model="productType"></ProductType>
                 </a-form-item>
               </a-col>
-              <a-col :md="5" :sm="24">
+              <a-col flex="250px">
                 <a-form-item label="产品品牌">
                   <ProductBrand id="purchaseOrderEdit-productBrand" :tenantId="$route.params.dealerSn" v-model="queryParam.productBrandSn"></ProductBrand>
                 </a-form-item>
               </a-col>
-              <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
+              <a-col flex="150px">
                 <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseOrderEdit-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="purchaseOrderEdit-reset">重置</a-button>
               </a-col>
@@ -58,7 +58,7 @@
           :defaultLoadData="false"
           :scroll="{ x: tableWidth , y:tableHeight }"
           @dblclick="handleAdd"
-          :pageSize="20"
+          :pageSize="30"
           bordered>
           <!-- 产品图片 -->
           <template slot="imageUrl" slot-scope="text, record">
@@ -152,7 +152,9 @@ export default {
       if (newValue) {
         this.resetSearchForm()
         this.$refs.searchProductCode.focus()
-        this.setTableH()
+        this.$nextTick(() => {
+          this.setTableH()
+        })
       }
     }
   },
@@ -262,7 +264,8 @@ export default {
       this.$emit('add', record, 0)
     },
     setTableH () {
-      this.tableHeight = window.innerHeight - 330
+      const searchBoxH = this.$refs.searchBox.offsetHeight
+      this.tableHeight = window.innerHeight - searchBoxH - 285
     }
   }
 }
@@ -275,7 +278,7 @@ export default {
   }
   .ant-drawer-body {
     padding: 15px 20px;
-    height: calc(100% - 55px);
+    height: calc(100% - 50px);
     display: flex;
     flex-direction: column;
     overflow: auto;

+ 30 - 17
src/views/purchasingManagement/purchaseOrderNew/edit.vue

@@ -5,7 +5,7 @@
       <template slot="subTitle">
         <a id="purchaseNewOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         <p class="billno">单号:{{ detail&&detail.purchaseBillNo }}</p>
-        <a-button type="primary" ghost @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:30px;vertical-align:middle;">
+        <a-button type="danger" ghost @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:30px;vertical-align:middle;">
           基础信息
           <a-icon :type="isShowBisiceInfo ? 'up' : 'down'"/>
         </a-button>
@@ -61,10 +61,10 @@
             <p class="tag-txt">注意:仅限采购【箭冠】产品。自建产品的采购入库请使用“散件入库”功能</p>
           </div>
           <div class="actions-button">
-            <a-button v-if="detail&&detail.totalCategory" id="purchaseNewOrderEdit-add-btn" type="primary" ghost @click="openChooseProduct=true">添加产品</a-button>
-            <a-button id="purchaseNewOrderEdit-import-btn" type="primary" ghost @click="openGuideModal=true">产品导入</a-button>
-            <a-button id="purchaseNewOrderEdit-outStock-btn" type="primary" ghost @click="handleOutStock">上次缺货</a-button>
-            <a-button id="purchaseNewOrderEdit-cart-btn" type="primary" ghost>购物车</a-button>
+            <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><a-icon type="shopping" />购物车</a-button>
           </div>
         </div>
         <div class="choosed-table" v-if="detail&&detail.totalCategory">
@@ -133,7 +133,7 @@
           </s-table>
         </div>
         <div v-else>
-          <div v-if="!spinning">
+          <div v-if="!spinning&&localDataSource.length==0">
             <a-empty
               :image="simpleImage"
               :image-style="{
@@ -144,7 +144,7 @@
               <a-button type="primary" class="button-error" @click="openChooseProduct=true"><a-icon type="plus-circle" />立即添加产品</a-button>
             </a-empty>
           </div>
-          <div style="text-align: center;padding: 30px 50px;" v-else>
+          <div style="text-align: center;padding: 30px 50px;" v-if="spinning">
             <a-spin :spinning="spinning" tip="Loading..."></a-spin>
           </div>
         </div>
@@ -220,6 +220,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         this.disabled = true
+        this.spinning = true
         // 查询总计
         const params = Object.assign({ pageNo: 1, pageSize: 5000 }, this.productForm, { purchaseBillSn: this.$route.params.sn })
         return purchaseDetailList(params).then(res => {
@@ -251,14 +252,14 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '20%', align: 'center' },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: '10%', align: 'center' },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '35%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: '8%', align: 'center' },
         { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(3, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '20%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
-        arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(3, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
       return arr
     }
@@ -271,10 +272,15 @@ export default {
         if (res.status == 200) {
           this.detail = res.data
           if (!noRefashTable) {
-            if (isReset) {
-              this.resetPurchaseForm()
-            } else {
-              this.$refs.purchaseTable.refresh(!!flag)
+            if(this.detail.totalCategory){
+              if (isReset) {
+                this.resetPurchaseForm()
+              } else {
+                this.$refs.purchaseTable.refresh(!!flag)
+              }
+            }else{
+              this.localDataSource = []
+              this.spinning = false
             }
           } else {
             this.spinning = false
@@ -416,7 +422,11 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type, printerType) {
       const _this = this
-      _this.spinning = true
+      if(type == 'preview'){
+        _this.openChooseProduct = false
+        _this.openOutStockModal = false
+      }
+      _this.$store.state.app.printLoading = true
       let url = purchaseDetailPrint
       let params = { sn: this.$route.params.sn, type: printerType }
       if (type == 'export') { //  导出
@@ -425,7 +435,7 @@ export default {
       }
       // 打印或导出
       hdPrint(printerType, type, url, params, '采购单', function () {
-        _this.spinning = false
+        _this.$store.state.app.printLoading = false
       })
     },
     //  返回列表
@@ -528,6 +538,9 @@ export default {
           }
         }
       }
+      .ant-input-number-sm input{
+        text-align: center;
+      }
     }
     .purchaseNewOrderEdit-cont{
       margin-bottom: 8px;

+ 22 - 11
src/views/purchasingManagement/purchaseOrderNew/outStockModal.vue

@@ -13,31 +13,31 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="outStock-con">
         <div>
-          <div ref="tableSearch" class="table-page-search-wrapper">
+          <div ref="searchBox" class="table-page-search-wrapper">
             <a-form layout="inline" @keyup.enter.native="searchForm">
-              <a-row :gutter="15">
-                <a-col :md="5" :sm="24">
+              <a-row type="flex" :gutter="12" justify="start">
+                <a-col flex="auto">
                   <a-form-item label="产品编码">
                     <a-input id="productInfoList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
                   </a-form-item>
                 </a-col>
-                <a-col :md="5" :sm="24">
+                <a-col flex="auto">
                   <a-form-item label="产品名称">
                     <a-input id="productInfoList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
                   </a-form-item>
                 </a-col>
-                <a-col :md="5" :sm="24">
+                <a-col flex="250px">
                   <a-form-item label="产品分类">
                     <ProductType id="productInfoList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
                   </a-form-item>
                 </a-col>
-                <a-col :md="5" :sm="24">
+                <a-col flex="250px">
                   <a-form-item label="产品品牌">
                     <ProductBrand id="productInfoList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
                     </a-select>
                   </a-form-item>
                 </a-col>
-                <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
+                <a-col flex="150px">
                   <a-button type="primary" @click="searchForm" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
                   <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
                 </a-col>
@@ -65,6 +65,7 @@
             @rowSelection="rowSelectionFun"
             :data="loadData"
             :columns="columns"
+            :pageSize="30"
             bordered>
           </s-table>
         </div>
@@ -131,7 +132,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return purchaseDetailCancelList(parameter).then(res => {
+        return purchaseDetailCancelList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -156,7 +157,8 @@ export default {
   },
   methods: {
     setTableH () {
-      this.tableHeight = window.innerHeight - 330
+      const searchBoxH = this.$refs.searchBox.offsetHeight
+      this.tableHeight = window.innerHeight - searchBoxH - 340
     },
     //  产品分类  change
     changeProductType (val, opt) {
@@ -269,7 +271,9 @@ export default {
       if (!newValue) {
         this.onCancel()
       } else {
-        this.setTableH()
+        this.$nextTick(() => {
+          this.setTableH()
+        })
         this.title = '上次采购缺货产品明细(采购单号:' + this.paramsData.purchaseBillNo + ')'
       }
     }
@@ -277,8 +281,15 @@ export default {
 }
 </script>
 
-<style lang="less" scoped>
+<style lang="less">
   .outStock-modal{
+    .ant-drawer-header{
+      padding: 13px 20px;
+    }
+    .ant-drawer-body{
+      padding: 15px 20px;
+      height: calc(100% - 50px);
+    }
     .outStock-con{
       .actions-buttons{
         padding: 10px 0;