瀏覽代碼

国内贸易修改

lichao 3 年之前
父節點
當前提交
7c28f4474a

+ 6 - 1
src/views/businessManagement/inventoryAccount/index.vue

@@ -121,10 +121,15 @@ export default {
       });
     },
     uploadAfter(res, done, loading, column) {
+      console.log(res)
       window.console.log(column);
       this.excelBox = false;
       this.page.currentPage = 1;
-      this.$message.warning(res)
+      if (res) {
+        this.$message.warning(res)
+      } else {
+        this.$message.success('导入成功')
+      }
       this.onLoad(this.page);
       loading()
       done();

+ 38 - 25
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -13,32 +13,45 @@
           size="small"
           @click="detailData.seeDisabled = false"
           type="primary"
+          style="margin-right: 8px"
         >编辑</el-button>
-        <el-button type="primary"
-                   size="small"
-                   :disabled="true"
-                   @click.stop="">请核
-        </el-button>
-        <el-button
-          size="small"
-          class="el-button--small-yh"
-          :disabled="detailData.seeDisabled || !form.id"
-          type="warning"
-          @click="applyPayment('申请')"
-        >
-          申请货款
-        </el-button>
-        <el-button type="info"
-                   size="small"
-                   @click="openApplicationDialog"
-                   :disabled="!form.id"
-        >查看申请记录
-        </el-button>
-        <el-button type="warning"
-                   size="small"
-                   class="el-button--small-yh "
-                   @click.stop="applyPayment('收费')">退款
-        </el-button>
+        <el-dropdown style="margin-right: 8px;">
+          <el-button
+            type="primary"
+            size="small"
+          >
+            审核处理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item :disabled="true">请核</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+        <el-dropdown style="margin-right: 8px;">
+          <el-button
+            type="warning"
+            size="small"
+          >
+            账单处理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item
+              :disabled="detailData.seeDisabled || !form.id"
+              @click="applyPayment('申请')"
+            >
+              申请货款
+            </el-dropdown-item>
+            <el-dropdown-item
+               @click="openApplicationDialog"
+               :disabled="!form.id"
+            >查看申请记录
+            </el-dropdown-item>
+            <el-dropdown-item
+               @click.stop="applyPayment('收费')"
+               :disabled="!this.form.id"
+            >退款
+            </el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
         <el-button
           size="small"
           class="el-button--small-yh"

+ 5 - 2
src/views/businessManagement/salesOrder/configuration/commodity.json

@@ -6,14 +6,17 @@
   "addBtn": false,
   "searchShow": true,
   "searchShowBtn": false,
-  "menu": false,
+  "menu": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "menuWidth": 80,
   "searchSpan": 8,
   "searchMenuSpan": 8,
   "searchMenuPosition": "right",
   "border": true,
   "index": true,
   "selection": true,
-  "viewBtn": true,
   "dialogClickModal": false,
   "column": [
     {

+ 188 - 72
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -13,40 +13,55 @@
           size="small"
           @click="detailData.seeDisabled = false"
           type="primary"
+          style="margin-right: 8px"
         >编辑</el-button>
-        <el-button type="primary"
-                   size="small"
-                   :disabled="true"
-                   @click.stop="">请核
-        </el-button>
-        <el-button
-          class="el-button--small-yh"
-          type="warning"
-          :disabled="detailData.seeDisabled"
-          size="small"
-          @click="applySettlement('收费')"
-        >生成账单</el-button>
-        <el-button
-          class="el-button--small-yh"
-          type="warning"
-          :disabled="detailData.seeDisabled"
-          size="small"
-          @click="applySettlement('申请')"
-        >退款</el-button>
-        <el-button
-          class="el-button--small-yh"
-          type="primary"
-          :disabled="detailData.seeDisabled"
-          size="small"
-          @click="saveSell"
-        >生成采购单</el-button>
-        <el-button
-          class="el-button--small-yh"
-          type="success" @click="copyOrder"
-          size="small"
-          :disabled="detailData.seeDisabled || !this.form.id">
-          复制新单
-        </el-button>
+        <el-dropdown style="margin-right: 8px;">
+          <el-button
+            type="primary"
+            size="small"
+          >
+            审核处理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item :disabled="true">请核</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+        <el-dropdown style="margin-right: 8px;">
+          <el-button
+            type="warning"
+            size="small"
+          >
+            账单处理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item
+              :disabled="detailData.seeDisabled"
+              @click="applySettlement('收费')">生成账单
+            </el-dropdown-item>
+            <el-dropdown-item
+              :disabled="detailData.seeDisabled"
+              @click="applySettlement('申请')"
+            >退款</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+        <el-dropdown style="margin-right: 8px;">
+          <el-button
+            type="success"
+            size="small"
+          >
+            业务处理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item
+              :disabled="detailData.seeDisabled"
+              @click="saveSell">生成采购单
+            </el-dropdown-item>
+            <el-dropdown-item
+              :disabled="detailData.seeDisabled || !this.form.id"
+              @click="copyOrder"
+            >复制新单</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
         <el-button
           class="el-button--small-yh"
           type="primary"
@@ -468,13 +483,39 @@
           <basic-container>
             <avue-crud :option="optionTwo"
                        :table-loading="loading"
-                       :data="data"
+                       :data="goodsListShow"
                        ref="crud"
                        @refresh-change="refreshChange"
                        @selection-change="selectionChange"
                        @search-change="goodsSearch"
                        :page.sync="page"
-                       @on-load="onLoad"></avue-crud>
+                       @on-load="onLoad">
+              <template slot="menuLeft" slot-scope="{size}">
+                <el-tabs v-model="activeName" @tab-click="tabHandle">
+                  <el-tab-pane label="查询结果" name="searchList"></el-tab-pane>
+                  <el-tab-pane label="已选定数据" name="importStaging"></el-tab-pane>
+                </el-tabs>
+              </template>
+              <template slot-scope="scope" slot="menu">
+                <el-button
+                  type="text"
+                  icon="el-icon-edit"
+                  size="small"
+                  @click.stop="importStagList(scope.row,scope.index)"
+                  v-if="activeName=='searchList'"
+                  :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1"
+                >选择
+                </el-button>
+                <el-button
+                  type="text"
+                  icon="el-icon-delete"
+                  size="small"
+                  @click.stop="removeStagList(scope.row,scope.index)"
+                  v-else
+                >移除
+                </el-button>
+              </template>
+            </avue-crud>
           </basic-container>
         </el-col>
       </el-row>
@@ -722,6 +763,11 @@ export default {
         currentPage: 1,
         total: 0
       },
+      pageList: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
       pagePolicy: {
         pageSize: 10,
         currentPage: 1,
@@ -1267,6 +1313,13 @@ export default {
       goodsLoading: false,
       baseURL: '/api/blade-purchase-sales/orderitems/importPrice',
       headers: { "Blade-Auth": 'Bearer ' + getToken()},
+      activeName: 'searchList',
+      // 商品列表数据合计
+      goodsListShow: [],
+      // 商品列表暂存
+      goodsListSave: [],
+      goodsListTotal: 0,
+      goodsListSaveTotal: 0,
     }
   },
   mounted() {
@@ -1793,61 +1846,110 @@ export default {
     },
     //确认导入触发
     importGoods() {
-      // this.contactsData = this.contactsData.concat(this.tableData)
-      if (this.tableData.length > 0) {
-        for (let item in this.tableData) {
-          // this.$set(this.tableData[item], 'storageQuantity', 0)
+      if (this.goodsListSave.length > 0) {
+        for (let item in this.goodsListSave) {
           selectGoodsNum({
-            goodsId: this.tableData[item].id,
-            itemType: this.tableData[item].typeno
+            goodsId: this.goodsListSave[item].id,
+            itemType: this.goodsListSave[item].typeno
           }).then(res => {
-            this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
-            this.tableData[item].storageQuantity =  res.data.data
-            delete this.tableData[item].goodsTypeName
-            this.tableData[item].itemId = this.tableData[item].id
-            this.$set(this.tableData[item], 'itemType', this.tableData[item].typeno)
-            this.$set(this.tableData[item], 'orderQuantity', 0)
-            this.$set(this.tableData[item], 'actualQuantity', 0)
-            this.$set(this.tableData[item], 'purchaseAmount', '0')
-            this.$set(this.tableData[item], 'invoiceWeight', this.tableData[item].cartonWeight)
-            getMarketPrice({code: this.tableData[item].code}).then(res => {
+            this.goodsListSave[item].priceCategory = this.goodsListSave[item].goodsTypeName
+            this.goodsListSave[item].storageQuantity =  res.data.data
+            delete this.goodsListSave[item].goodsTypeName
+            this.goodsListSave[item].itemId = this.goodsListSave[item].id
+            this.$set(this.goodsListSave[item], 'itemType', this.goodsListSave[item].typeno)
+            this.$set(this.goodsListSave[item], 'orderQuantity', 0)
+            this.$set(this.goodsListSave[item], 'actualQuantity', 0)
+            this.$set(this.goodsListSave[item], 'purchaseAmount', '0')
+            this.$set(this.goodsListSave[item], 'invoiceWeight', this.goodsListSave[item].cartonWeight)
+            getMarketPrice({code: this.goodsListSave[item].code}).then(res => {
               if (res.data.data.length > 0) {
-                this.$set(this.tableData[item], 'price', res.data.data[0].salesPrice)
+                this.$set(this.goodsListSave[item], 'price', res.data.data[0].salesPrice)
               } else {
-                this.$set(this.tableData[item], 'price', '0')
+                this.$set(this.goodsListSave[item], 'price', '0')
               }
             })
-            getPurchasePrice({code: this.tableData[item].code}).then(res => {
+            getPurchasePrice({code: this.goodsListSave[item].code}).then(res => {
               if (res.data.data.length > 0) {
-                this.$set(this.tableData[item], 'purchaseAmount', res.data.data[0].purchasePrice)
+                this.$set(this.goodsListSave[item], 'purchaseAmount', res.data.data[0].purchasePrice)
               } else {
-                this.$set(this.tableData[item], 'purchaseAmount', '0')
+                this.$set(this.goodsListSave[item], 'purchaseAmount', '0')
               }
             })
-            this.tableData[item].amount = 0
-            this.tableData[item].sort = this.maxGoodsNum + 1
+            this.goodsListSave[item].amount = 0
+            this.goodsListSave[item].sort = this.maxGoodsNum + 1
             if (this.form.packageRemarks) {
-              this.tableData[item].packageRemarks = this.form.packageRemarks
+              this.goodsListSave[item].packageRemarks = this.form.packageRemarks
             }
-            delete this.tableData[item].id
-            delete this.tableData[item].pid
-            delete this.tableData[item].isDeleted
-            delete this.tableData[item].status
-            delete this.tableData[item].tenantId
-            delete this.tableData[item].updateTime
-            delete this.tableData[item].updateUser
-            delete this.tableData[item].updateUserName
+            delete this.goodsListSave[item].id
+            delete this.goodsListSave[item].pid
+            delete this.goodsListSave[item].isDeleted
+            delete this.goodsListSave[item].status
+            delete this.goodsListSave[item].tenantId
+            delete this.goodsListSave[item].updateTime
+            delete this.goodsListSave[item].updateUser
+            delete this.goodsListSave[item].updateUserName
             this.maxGoodsNum++
-            this.$refs.crudContact.rowCellAdd(this.tableData[item]);
-            this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+            this.$refs.crudContact.rowCellAdd(this.goodsListSave[item]);
+            this.$refs.crudContact.rowCell(this.goodsListSave[item], this.contactsData.length - 1)
           })
         }
         this.dialogVisible = false
+      } else {
+        if (this.tableData.length > 0) {
+          for (let item in this.tableData) {
+            selectGoodsNum({
+              goodsId: this.tableData[item].id,
+              itemType: this.tableData[item].typeno
+            }).then(res => {
+              this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
+              this.tableData[item].storageQuantity =  res.data.data
+              delete this.tableData[item].goodsTypeName
+              this.tableData[item].itemId = this.tableData[item].id
+              this.$set(this.tableData[item], 'itemType', this.tableData[item].typeno)
+              this.$set(this.tableData[item], 'orderQuantity', 0)
+              this.$set(this.tableData[item], 'actualQuantity', 0)
+              this.$set(this.tableData[item], 'purchaseAmount', '0')
+              this.$set(this.tableData[item], 'invoiceWeight', this.tableData[item].cartonWeight)
+              getMarketPrice({code: this.tableData[item].code}).then(res => {
+                if (res.data.data.length > 0) {
+                  this.$set(this.tableData[item], 'price', res.data.data[0].salesPrice)
+                } else {
+                  this.$set(this.tableData[item], 'price', '0')
+                }
+              })
+              getPurchasePrice({code: this.tableData[item].code}).then(res => {
+                if (res.data.data.length > 0) {
+                  this.$set(this.tableData[item], 'purchaseAmount', res.data.data[0].purchasePrice)
+                } else {
+                  this.$set(this.tableData[item], 'purchaseAmount', '0')
+                }
+              })
+              this.tableData[item].amount = 0
+              this.tableData[item].sort = this.maxGoodsNum + 1
+              if (this.form.packageRemarks) {
+                this.tableData[item].packageRemarks = this.form.packageRemarks
+              }
+              delete this.tableData[item].id
+              delete this.tableData[item].pid
+              delete this.tableData[item].isDeleted
+              delete this.tableData[item].status
+              delete this.tableData[item].tenantId
+              delete this.tableData[item].updateTime
+              delete this.tableData[item].updateUser
+              delete this.tableData[item].updateUserName
+              this.maxGoodsNum++
+              this.$refs.crudContact.rowCellAdd(this.tableData[item]);
+              this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
+            })
+          }
+          this.dialogVisible = false
+        }
       }
     },
     closeGoods() {
       this.treeDataGoods = [];
       this.treeDeptId = "";
+      this.activeName = "searchList";
     },
     closeFees() {
       this.treeDeptIdCost = "";
@@ -2087,10 +2189,11 @@ export default {
       console.log(params)
       this.loading = true;
       getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
-        console.log(res)
         const data = res.data.data;
         this.page.total = data.total;
+        this.pageList.total = data.total
         this.data = data.records;
+        this.goodsListShow = data.records;
         this.loading = false;
       });
     },
@@ -2423,8 +2526,21 @@ export default {
       }
       return sums;
     },
-    getCorpData(row) {
-      console.log(row)
+    // 标签页切换
+    tabHandle(data) {
+      if (data.name == 'searchList') {
+        this.goodsListShow = this.data;
+        this.page.total = this.pageList.total
+      } else if (data.name == 'importStaging') {
+        this.goodsListShow = this.goodsListSave;
+        this.page.total = 0
+      }
+    },
+    removeStagList(row, index) {
+      this.goodsListSave.splice(index, 1)
+    },
+    importStagList(row, index) {
+      this.goodsListSave.push(row);
     },
   }
 }