Преглед изворни кода

Merge branch 'dev' of git.echepei.com:caojunjie/Smart_platform_ui into dev

caojunjie пре 3 година
родитељ
комит
f484a6a559

+ 31 - 17
src/components/report-dialog/main.vue

@@ -88,6 +88,9 @@ export default {
     },
     searchValue: {
       type: Object
+    },
+    corpType: {
+      type: String
     }
   },
   filters: {
@@ -121,7 +124,6 @@ export default {
       });
     },
     goReport(name) {
-      console.log(name)
       let tenantId = this.$store.getters.userInfo.tenant_id;
       if (this.reportName == "同海-统计列表") {
         this.$router.push({
@@ -158,16 +160,16 @@ export default {
         this.$router.push({
           path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
           query: {
-            code:this.searchValue.code,
-            cname:this.searchValue.cname,
-            brandItem:this.searchValue.brandItem,
-            placeProduction:this.searchValue.placeProduction,
-            typeno:this.searchValue.typeno,
-            typenoOne:this.searchValue.typenoOne,
-            typenoTwo:this.searchValue.typenoTwo,
-            stockName:this.searchValue.stockName,
-            brand:this.searchValue.brand,
-            tenantId:tenantId,
+            code: this.searchValue.code,
+            cname: this.searchValue.cname,
+            brandItem: this.searchValue.brandItem,
+            placeProduction: this.searchValue.placeProduction,
+            typeno: this.searchValue.typeno,
+            typenoOne: this.searchValue.typenoOne,
+            typenoTwo: this.searchValue.typenoTwo,
+            stockName: this.searchValue.stockName,
+            brand: this.searchValue.brand,
+            tenantId: tenantId
           }
         });
       } else if (name == "国内贸易-客户确认.ureport.xml") {
@@ -180,22 +182,34 @@ export default {
             businessStartDate: this.searchValue.businessStartDate,
             businessEndDate: this.searchValue.businessEndDate,
             storageId: this.searchValue.storageId,
-            arrivalAddress:this.searchValue.arrivalAddress,
+            arrivalAddress: this.searchValue.arrivalAddress,
             arrivalContact: this.searchValue.arrivalContact,
             arrivalTel: this.searchValue.arrivalTel,
             createUser: this.searchValue.createUser,
             createTimeStart: this.searchValue.createTimeStart,
             createTimeEnd: this.searchValue.createTimeEnd,
-            tenantId: tenantId,
+            tenantId: tenantId
           }
         });
       } else if (name == "经销商-可用库存表.ureport.xml") {
         this.$router.push({
           path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
           query: {
-            tradeType: 'JXS',
+            tradeType: "JXS",
+            tenantId: tenantId
+          }
+        });
+      } else if (name == "客户信息.ureport.xml") {
+        let userId = JSON.parse(localStorage.getItem("saber-userInfo")).content
+          .user_id;
+        this.$router.push({
+          path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
+          query: {
+            id: this.reportId,
+            userId: userId,
             tenantId: tenantId,
-          },
+            corpType:this.corpType
+          }
         });
       } else {
         let userId = JSON.parse(localStorage.getItem("saber-userInfo")).content
@@ -205,8 +219,8 @@ export default {
           query: {
             id: this.reportId,
             userId: userId,
-            tenantId: tenantId,
-          },
+            tenantId: tenantId
+          }
         });
       }
       this.$emit("onClose", false);

+ 1 - 1
src/util/calculate.js

@@ -80,7 +80,7 @@ export function grossProfitCal(num, num2, num3, num4) {
   const price = Number(num3 ? num3 : 0)
   const exchangeRate = Number(Number(num4) ? num4 : 1)
   const sum = _.multiply(_.divide(_.subtract(_.multiply(price, exchangeRate), _.add(purchase, fitting)), _.multiply(price, exchangeRate)), 100)
-  return Number(sum).toFixed(2)
+  return sum?Number(sum).toFixed(2):'0.00'
 }
 //单票毛利: (金额*汇率+费用应收合计)-(成本*数量+费用应付合计)
 export function STGPCal(num, num2, num3, num4) {

+ 9 - 0
src/views/basicData/customerInformation/index.vue

@@ -88,7 +88,16 @@
             </avue-crud>
             <report-dialog
               :switchDialog="switchDialog"
+              reportName="客户资料-客户资料"
               @onClose="onClose()"
+              v-if="$store.getters.userInfo.tenant_id == '096359'"
+            ></report-dialog>
+            <report-dialog
+              :switchDialog="switchDialog"
+              reportName="客户信息"
+              corpType="KH"
+              @onClose="onClose()"
+              v-else
             ></report-dialog>
             <el-dialog
               title="导入客户"

+ 9 - 0
src/views/basicData/customerManagement/companyMaterial/index.vue

@@ -83,7 +83,16 @@
             </avue-crud>
             <report-dialog
               :switchDialog="switchDialog"
+              reportName="客户资料-客户资料"
               @onClose="onClose()"
+              v-if="$store.getters.userInfo.tenant_id == '096359'"
+            ></report-dialog>
+            <report-dialog
+              :switchDialog="switchDialog"
+              reportName="客户信息"
+              corpType="GS"
+              @onClose="onClose()"
+              v-else
             ></report-dialog>
             <el-dialog
               title="导入所属公司"

+ 9 - 0
src/views/basicData/customerManagement/supplierMaterial/index.vue

@@ -84,9 +84,18 @@
                 <span>{{ row.belongCompany }}</span>
               </template>
             </avue-crud>
+              <report-dialog
+              :switchDialog="switchDialog"
+              reportName="客户资料-客户资料"
+              @onClose="onClose()"
+              v-if="$store.getters.userInfo.tenant_id == '096359'"
+            ></report-dialog>
             <report-dialog
               :switchDialog="switchDialog"
+              reportName="客户信息"
+              corpType="GYS"
               @onClose="onClose()"
+             v-else
             ></report-dialog>
             <el-dialog
               title="导入供应商"

+ 212 - 141
src/views/basicData/productInformation/index.vue

@@ -3,44 +3,57 @@
     <el-row v-if="isShow">
       <el-col :span="5">
         <basic-container>
-          <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
+          <avue-tree
+            :option="treeOption"
+            :data="treeData"
+            @node-click="nodeClick"
+          />
         </basic-container>
       </el-col>
       <el-col :span="19">
         <basic-container>
-          <avue-crud :option="option"
-                     :search.sync="search"
-                     :table-loading="loading"
-                     :data="data"
-                     ref="crud"
-                     v-model="form"
-                     @row-del="rowDel"
-                     @row-update="rowUpdate"
-                     @row-save="rowSave"
-                     :before-open="beforeOpenE"
-                     :page.sync="page"
-                     @search-change="searchChange"
-                     @search-reset="searchReset"
-                     @selection-change="selectionChange"
-                     @current-change="currentChange"
-                     @size-change="sizeChange"
-                     @refresh-change="refreshChange"
-                     @on-load="onLoad">
+          <avue-crud
+            :option="option"
+            :search.sync="search"
+            :table-loading="loading"
+            :data="data"
+            ref="crud"
+            v-model="form"
+            @row-del="rowDel"
+            @row-update="rowUpdate"
+            @row-save="rowSave"
+            :before-open="beforeOpenE"
+            :page.sync="page"
+            @search-change="searchChange"
+            @search-reset="searchReset"
+            @selection-change="selectionChange"
+            @current-change="currentChange"
+            @size-change="sizeChange"
+            @refresh-change="refreshChange"
+            @on-load="onLoad"
+          >
             <template slot="menuLeft">
               <el-button
                 type="primary"
                 size="small"
                 icon="el-icon-bottom"
                 @click="excelBox = true"
-              >导入
+                >导入
+              </el-button>
+              <el-button
+                icon="el-icon-printer"
+                size="small"
+                type="primary"
+                @click.stop="openReport()"
+                >报表打印
               </el-button>
               <el-button
                 type="warning"
                 size="small"
-                :disabled="selectionList.length==0"
+                :disabled="selectionList.length == 0"
                 icon="el-icon-delete"
                 @click="batchDelete"
-              >批量删除
+                >批量删除
               </el-button>
             </template>
             <template slot-scope="scope" slot="corpId">
@@ -59,14 +72,14 @@
                 icon="el-icon-edit"
                 size="small"
                 @click.stop="editOpen(scope.row, scope.index)"
-              >编辑
+                >编辑
               </el-button>
               <el-button
                 type="text"
                 icon="el-icon-delete"
                 size="small"
                 @click.stop="rowDel(scope.row, scope.index)"
-              >删除
+                >删除
               </el-button>
               <!--            <el-button-->
               <!--                type="text"-->
@@ -83,22 +96,34 @@
               ></el-input>
             </template>
           </avue-crud>
-          <el-dialog title="导入产品"
-                     append-to-body
-                     :visible.sync="excelBox"
-                     :close-on-click-modal="false"
-                     width="555px">
-            <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
+          <el-dialog
+            title="导入产品"
+            append-to-body
+            :visible.sync="excelBox"
+            :close-on-click-modal="false"
+            width="555px"
+          >
+            <avue-form
+              :option="excelOption"
+              v-model="excelForm"
+              :upload-after="uploadAfter"
+            >
               <template slot="excelTemplate">
                 <el-button type="primary" @click="derivation">
                   点击下载<i class="el-icon-download el-icon--right"></i>
                 </el-button>
               </template>
             </avue-form>
-            <p style="text-align: center;color: #DC0505">温馨提示  第一次导入时请先下载模板</p>
+            <p style="text-align: center;color: #DC0505">
+              温馨提示 第一次导入时请先下载模板
+            </p>
           </el-dialog>
         </basic-container>
       </el-col>
+      <report-dialog
+        :switchDialog="switchDialog"
+        @onClose="onClose()"
+      ></report-dialog>
     </el-row>
 
     <detail-page
@@ -110,22 +135,34 @@
   </div>
 </template>
 <script>
-import {getList, getUser, getUserPlatform, remove, updatePlatform, add, grant, getDeptLazyTree, getDeptTree} from "@/api/basicData/commodityType";
-import {getRoleTree} from "@/api/system/role";
-import {mapGetters} from "vuex";
-import website from '@/config/website';
-import {getToken} from '@/util/auth';
+import {
+  getList,
+  getUser,
+  getUserPlatform,
+  remove,
+  updatePlatform,
+  add,
+  grant,
+  getDeptLazyTree,
+  getDeptTree
+} from "@/api/basicData/commodityType";
+import { getRoleTree } from "@/api/system/role";
+import { mapGetters } from "vuex";
+import website from "@/config/website";
+import { getToken } from "@/util/auth";
 import option from "./configuration/mainList.json";
 import detailPage from "./detailsPageEdit";
-
+import reportDialog from "@/components/report-dialog/main";
 export default {
   components: {
+    reportDialog,
     detailPage
   },
   data() {
     return {
       form: {},
-      search:{},
+      search: {},
+      switchDialog: false,
       roleBox: false,
       excelBox: false,
       platformBox: false,
@@ -146,7 +183,7 @@ export default {
       },
       init: {
         roleTree: [],
-        deptTree: [],
+        deptTree: []
       },
       props: {
         label: "title",
@@ -154,30 +191,32 @@ export default {
       },
       roleGrantList: [],
       roleTreeObj: [],
-      treeDeptId: '',
+      treeDeptId: "",
       treeData: [],
       treeOption: {
-        nodeKey: 'id',
+        nodeKey: "id",
         lazy: true,
-        treeLoad: function (node, resolve) {
-          const parentId = (node.level === 0) ? 0 : node.data.id;
+        treeLoad: function(node, resolve) {
+          const parentId = node.level === 0 ? 0 : node.data.id;
           getDeptLazyTree(parentId).then(res => {
-            resolve(res.data.data.map(item => {
-              return {
-                ...item,
-                leaf: !item.hasChildren
-              }
-            }))
+            resolve(
+              res.data.data.map(item => {
+                return {
+                  ...item,
+                  leaf: !item.hasChildren
+                };
+              })
+            );
           });
         },
         addBtn: false,
         menu: false,
-        size: 'small',
+        size: "small",
         props: {
-          labelText: '标题',
-          label: 'title',
-          value: 'value',
-          children: 'children'
+          labelText: "标题",
+          label: "title",
+          value: "value",
+          children: "children"
         }
       },
       option: option,
@@ -192,36 +231,40 @@ export default {
         emptyBtn: false,
         column: [
           {
-            label: '模板下载',
-            prop: 'excelTemplate',
+            label: "模板下载",
+            prop: "excelTemplate",
             formslot: true,
-            span: 24,
+            span: 24
           },
           {
-            label: '模板上传',
-            prop: 'excelFile',
-            type: 'upload',
+            label: "模板上传",
+            prop: "excelFile",
+            type: "upload",
             drag: true,
-            loadText: '模板上传中,请稍等',
+            loadText: "模板上传中,请稍等",
             span: 24,
             propsHttp: {
-              res: 'data',
+              res: "data"
             },
-            tip: '请上传 .xls,.xlsx 标准格式文件',
-            action: "/api/blade-client/goodsdesc/import-desc-info",
-          },
+            tip: "请上传 .xls,.xlsx 标准格式文件",
+            action: "/api/blade-client/goodsdesc/import-desc-info"
+          }
         ]
       },
       isShow: true,
-      detailData: {},
+      detailData: {}
     };
   },
   mounted() {
-    option.height = window.innerHeight - 255 ;
+    option.height = window.innerHeight - 255;
   },
   methods: {
     derivation() {
-      window.open(`/api/blade-client/goodsdesc/export-template-info?${this.website.tokenHeader}=${getToken()}`);
+      window.open(
+        `/api/blade-client/goodsdesc/export-template-info?${
+          this.website.tokenHeader
+        }=${getToken()}`
+      );
     },
     uploadAfter(res, done, loading, column) {
       window.console.log(column);
@@ -253,72 +296,77 @@ export default {
     },
     rowSave(row, done, loading) {
       row.goodsTypeId = row.goodsTypeId.join(",");
-      add(row).then(() => {
-        this.initFlag = false;
-        this.onLoad(this.page);
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-        done();
-      }, error => {
-        window.console.log(error);
-        loading();
-      });
+      add(row).then(
+        () => {
+          this.initFlag = false;
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
     },
     rowUpdate(row, index, done, loading) {
       row.goodsTypeId = row.goodsTypeId.join(",");
-      add(row).then(() => {
-        this.initFlag = false;
-        this.onLoad(this.page);
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-        done();
-      }, error => {
-        window.console.log(error);
-        loading();
-      });
+      add(row).then(
+        () => {
+          this.initFlag = false;
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
     },
     //批量删除
-    batchDelete(){
+    batchDelete() {
       this.$confirm("确定批量删除数据?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
-      }).then(()=>{
-        let batchDeleteList =  this.selectionList.map(item =>{
-          return  item.id
-        })
-        remove(batchDeleteList.join(",")).then(res =>{
-          if(res.data.success){
-            this.$message.success("删除成功!")
-            this.refreshChange()
+      }).then(() => {
+        let batchDeleteList = this.selectionList.map(item => {
+          return item.id;
+        });
+        remove(batchDeleteList.join(",")).then(res => {
+          if (res.data.success) {
+            this.$message.success("删除成功!");
+            this.refreshChange();
           }
-        })
-      })
-
+        });
+      });
     },
     //查看跳转页面
     beforeOpenPage(row, index) {
       this.detailData = {
         id: row.id,
-        seeDisabled: true,
+        seeDisabled: true
       };
       this.isShow = false;
     },
     //新增跳转页面
     beforeOpenE(row, index) {
       this.detailData = {
-        goodsTypeId: this.treeDeptId,
+        goodsTypeId: this.treeDeptId
       };
       this.isShow = false;
     },
     //编辑跳转页面
     editOpen(row, index) {
       this.detailData = {
-        id: row.id,
+        id: row.id
       };
       this.isShow = false;
     },
@@ -329,21 +377,21 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       })
-          .then(() => {
-            return remove(row.id);
-          })
-          .then(() => {
-            this.onLoad(this.page);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            done()
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
           });
+          done();
+        });
     },
     searchReset() {
       this.query = {};
-      this.treeDeptId = '';
+      this.treeDeptId = "";
       this.onLoad(this.page);
     },
     searchChange(params, done) {
@@ -380,23 +428,27 @@ export default {
       this.excelBox = true;
     },
     handleTemplate() {
-      window.open(`/api/blade-user/export-template?${this.website.tokenHeader}=${getToken()}`);
+      window.open(
+        `/api/blade-user/export-template?${
+          this.website.tokenHeader
+        }=${getToken()}`
+      );
     },
     //新增编辑查看触发
     async beforeOpen(done, type) {
       if (["add"].includes(type)) {
-        this.option.column.forEach(e=>{
-          if(e.prop=='goodsTypeId'){
-            this.$set(this.option.column,2,{...e,value:this.treeDeptId})
+        this.option.column.forEach(e => {
+          if (e.prop == "goodsTypeId") {
+            this.$set(this.option.column, 2, { ...e, value: this.treeDeptId });
           }
-        })
+        });
       }
       if (["edit", "view"].includes(type)) {
         await getUser(this.form.id).then(res => {
           this.form = res.data.data;
           // this.form.goodsTypeId = [this.form.goodsTypeId.replace(/\"/g,"")]
-          console.log(this.form.hasOwnProperty("goodsTypeId"))
-          if(this.form.hasOwnProperty("goodsTypeId")){
+          console.log(this.form.hasOwnProperty("goodsTypeId"));
+          if (this.form.hasOwnProperty("goodsTypeId")) {
             this.form.goodsTypeId = this.form.goodsTypeId.split(",");
           }
         });
@@ -418,26 +470,40 @@ export default {
     },
     onLoad(page, params = {}) {
       this.loading = true;
-      getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
+      getList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query),
+        this.treeDeptId
+      ).then(res => {
         const data = res.data.data;
         this.data = data.records;
-        this.page.total = res.data.data.total
+        this.page.total = res.data.data.total;
         this.loading = false;
         this.selectionClear();
       });
     },
     platformRowUpdate(row, index, done, loading) {
-      updatePlatform(row.id, row.userType, row.userExt).then(() => {
-        this.platformOnLoad(this.platformPage);
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-        done();
-      }, error => {
-        window.console.log(error);
-        loading();
-      });
+      updatePlatform(row.id, row.userType, row.userExt).then(
+        () => {
+          this.platformOnLoad(this.platformPage);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    openReport() {
+      this.switchDialog = !this.switchDialog;
+    },
+    onClose(val) {
+      this.switchDialog = val;
     },
     platformBeforeOpen(done, type) {
       if (["edit", "view"].includes(type)) {
@@ -475,7 +541,12 @@ export default {
     },
     platformOnLoad(page, params = {}) {
       this.platformLoading = true;
-      getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
+      getList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query),
+        this.treeDeptId
+      ).then(res => {
         const data = res.data.data;
         this.platformPage.total = data.total;
         this.platformData = data.records;
@@ -484,9 +555,9 @@ export default {
       });
     },
     goBack() {
-      this.detailData=this.$options.data().detailData
+      this.detailData = this.$options.data().detailData;
       this.isShow = true;
-    },
+    }
   }
 };
 </script>

+ 15 - 18
src/views/dealer/purchaseContract/detail.vue

@@ -576,12 +576,7 @@ import {
   itemPolicy,
   createOrder
 } from "@/api/dealer/purchaseContract";
-import {
-  isDiscount,
-  isPercentage,
-  micrometerFormat,
-  IntegerFormat
-} from "@/util/validate";
+import { IntegerFormat } from "@/util/validate";
 import reportDialog from "@/components/report-dialog/main";
 import financialAccount from "../../../components/finance/financialAccount";
 import check from "@/components/check/check";
@@ -674,18 +669,18 @@ export default {
               }
             ]
           },
-          {
-            label: "平台代码",
-            prop: "purchaseRemark",
-            span: 8,
-            rules: [
-              {
-                required: true,
-                message: " ",
-                trigger: "blur"
-              }
-            ]
-          },
+          // {
+          //   label: "平台代码",
+          //   prop: "purchaseRemark",
+          //   span: 8,
+          //   rules: [
+          //     {
+          //       required: true,
+          //       message: " ",
+          //       trigger: "blur"
+          //     }
+          //   ]
+          // },
           {
             label: "电话",
             prop: "corpTel",
@@ -1221,8 +1216,10 @@ export default {
     },
     importPolicy() {
       this.policyselectionList.forEach(item => {
+        item.$cellEdit = true;
         this.dataList.push(item);
       });
+      this.policyVisible = false;
     },
     closeGoods() {
       this.selectionList = [];