Browse Source

Merge branch 'feature/Feature-sales' of https://gogs.zfire.top/zfire-front/supply-front into feature/Feature-sales

howie 3 years ago
parent
commit
d93f14f5e3

+ 1 - 1
src/api/setting.js

@@ -448,4 +448,4 @@ export function getApiList(params) {
     method: 'get',
     params
   })
-}
+}

+ 3 - 0
src/layout/components/Navbar.vue

@@ -173,6 +173,7 @@ export default {
             enginPassword: this.engineForm.password
           }
           bindEngineAccount(params).then(res => {
+            console.log('-----------', res)
             if (res.code === 200) {
               this.$successMsg("绑定成功,正在打开工程机系统")
               this.$store.dispatch('user/getInfo').then(() => {
@@ -180,6 +181,8 @@ export default {
                 this.userInfo.enginPassword = this.engineForm.password
                 this.$refs.engineSubmit.click()
               })
+            } else {
+              this.$errorMsg(res.message)
             }
           })
         }

+ 1 - 1
src/views/finance/change_apply.vue

@@ -327,7 +327,7 @@ export default {
         initiatorRemark,
         amount: amount * 1,
       });
-      this.$message.success("申请成功");
+      this.$message.success("保存成功");
     },
     async getUserInfoFn() {
       const res = await getUserInfo({ adminUserId: this.userid });

+ 91 - 4
src/views/setting/role.vue

@@ -17,6 +17,15 @@
         <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
           <el-table-column align="center" label="角色" prop="name"></el-table-column>
+          <el-table-column align="center" label="允许访问系统" prop="visitSysStatus" width="120">
+            <template slot-scope="scope">
+              <el-switch
+                v-model="scope.row.visitSysStatus"
+                :disabled="scope.row.type === 1 || scope.row.type === 2"
+                @change="changeStatus(scope.row.adminRoleId, scope.row.visitSysStatus)">
+              </el-switch>
+            </template>
+          </el-table-column>
           <el-table-column align="center" label="操作" width="180">
             <template slot-scope="scope">
               <el-button type="text" @click="setMenuRole(scope.row.adminRoleId)" v-if="checkBtnRole('detail')">设置权限</el-button>
@@ -66,12 +75,20 @@
       <el-tree
         :data="menuRoleList"
         show-checkbox
-        :check-strictly="false"
+        :check-strictly="true"
         :default-expand-all="true"
+        :expand-on-click-node="false"
         node-key="moduleId"
         ref="tree"
         highlight-current
         :props="defaultProps">
+        <span class="custom-tree-node" slot-scope="{ node, data }">
+          <span>{{ node.label }}</span>
+          <span v-if="data.type < 3">
+            <el-button type="text" size="mini" @click="() => quickSelection(data)">一键全选</el-button>
+            <el-button type="text" size="mini" @click="() => quickCancel(data)" style="color: #f56c6c">一键取消</el-button>
+          </span>
+        </span>
       </el-tree>
       <div slot="footer" class="dialog-footer">
         <el-button @click="roleFormVisible = false">{{editId != 1 ? '取 消':'关 闭'}}</el-button>
@@ -231,9 +248,6 @@ export default {
 
     // 设置权限 - 提交数据
     submitRoleForm() {
-      // console.log('选中的:' + this.$refs.tree.getCheckedKeys());
-      // console.log('半选的:' + this.$refs.tree.getHalfCheckedKeys());
-      // return false
       let params = {
         adminModuleIds: this.$refs.tree.getCheckedKeys().join(','),
         adminRoleId: this.editId,
@@ -245,6 +259,71 @@ export default {
       })
     },
 
+    // 一键全选
+    quickSelection(data) {
+      let nowChecked = this.$refs.tree.getCheckedKeys();
+      let thisId = data.moduleId;
+      let childId = [];
+      if(data.children.length) {
+        childId = this.familyTree(data.children);
+      }
+      
+      let setChecked = nowChecked.concat([thisId]).concat(childId);
+
+      this.$refs.tree.setCheckedKeys(setChecked);
+    },
+
+    // 一键取消
+    quickCancel(data) {
+      let nowChecked = this.$refs.tree.getCheckedKeys();
+      let thisId = data.moduleId;
+      let childId = [];
+      if(data.children.length) {
+        childId = this.familyTree(data.children);
+      }
+      
+      let setChecked = nowChecked;
+      if(setChecked.indexOf(thisId) >= 0) {
+        setChecked.splice(setChecked.indexOf(thisId), 1);
+      }
+
+      if(childId.length) {
+        for (var i = 0; i < childId.length; i++) {
+          if(setChecked.indexOf(childId[i]) >= 0) {
+            setChecked.splice(setChecked.indexOf(childId[i]), 1);
+          }
+        }
+      }
+
+      this.$refs.tree.setCheckedKeys(setChecked);
+    },
+
+    // 递归子id
+    familyTree(arr) {
+      var temp = [];
+      var forFn = function (list) {
+        for (var i = 0; i < list.length; i++) {
+          var item = list[i];
+          if (item.children) {
+            temp.push(item.moduleId);
+            forFn(item.children);
+          }
+        }
+      };
+      forFn(arr);
+      return temp;
+    },
+
+    changeStatus(id, status) {
+      editRole({
+        adminRoleId: id,
+        visitSysStatus: status
+      }).then(res => {
+        this.getList();
+        this.$successMsg('编辑成功');
+      })
+    }
+
   }
 }
 </script>
@@ -266,4 +345,12 @@ export default {
       }
     }
   }
+  .custom-tree-node {
+    flex: 1;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    font-size: 14px;
+    padding-right: 8px;
+  }
 </style>

+ 1 - 0
src/views/supply/apply/components/apply_examine.vue

@@ -208,6 +208,7 @@ export default {
         this.detailData = res.data;
 
         res.data.orders.forEach((item, index) => {
+          item.approvalNumber = item.invoiceNum;
           if(item.stockIds && item.stockIds.length > 0) {
             item.stockIds = item.stockIds.map((it, idx) => {
               return it.id;

+ 1 - 1
src/views/supply/pickup/check.vue

@@ -90,7 +90,7 @@
             <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="数量" prop="invoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="使用返利金额" prop="payRebateAmount" min-width="120" show-overflow-tooltip></el-table-column>

+ 156 - 26
src/views/supply/pickup/components/pickup_print.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="detail-container">
     <div id="printMe">
-      <div class="print-table-1">
+      <div class="print-form-1">
         <el-row :gutter="0">
           <el-col :span="6" class="item">
             <div class="label">经销商编码:</div>
@@ -26,30 +26,76 @@
         </el-row>
       </div>
 
-      <div class="table" style="margin-top: 20px">
-        <el-table :data="detailData.retreatDocumentOrder" element-loading-text="Loading" border fit highlight-current-row stripe>
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="发货单号" prop="invoiceId" min-width="180" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库名称" prop="correspondName" min-width="120" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品编号" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="数量" prop="num" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="含税单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="含税金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="无税金额" prop="noTotalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="税率(%)" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="使用返利金额" prop="payRebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="折扣金额" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="退补标记" prop="status" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="厂产品代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
-        </el-table>
+      <div class="print-table-1">
+        <div class="head">
+          <el-row :gutter="20">
+            <el-col :span="3">发货单号/订单号</el-col>
+            <el-col :span="2">销售类型</el-col>
+            <el-col :span="3">文件编号</el-col>
+            <el-col :span="6">规格型号</el-col>
+            <el-col :span="2">数量</el-col>
+            <el-col :span="2">单位</el-col>
+            <el-col :span="2">单价</el-col>
+            <el-col :span="2">金额</el-col>
+            <el-col :span="2">折让</el-col>
+          </el-row>
+        </div>
+        <div class="body">
+          <div v-for="(item, index) in detailData.invoicePickBeans" :key="index">
+            <el-row :gutter="20">
+              <el-col :span="3">{{ item.invoiceId || '' }}</el-col>
+              <el-col :span="2">{{ item.saleTypeName || '' }}</el-col>
+              <el-col :span="3">{{ item.aaa || '' }}</el-col>
+              <el-col :span="6">{{ item.specification || '' }}</el-col>
+              <el-col :span="2">{{ item.qty || 0 }}</el-col>
+              <el-col :span="2">{{ item.unit || '' }}</el-col>
+              <el-col :span="2">{{ item.price || 0 }}</el-col>
+              <el-col :span="2">{{ item.payAmount || 0 }}</el-col>
+              <el-col :span="2">{{ item.totalDiscAmount || 0 }}</el-col>
+            </el-row>
+            <el-row :gutter="20">
+              <el-col :span="3">{{ item.invoiceId || '' }}</el-col>
+              <el-col :span="2">发货日期</el-col>
+              <el-col :span="4">{{ item.theTime || '' }}</el-col>
+              <el-col :span="2">工程编号</el-col>
+              <el-col :span="3">{{ item.aaa || '' }}</el-col>
+              <el-col :span="2">备注</el-col>
+              <el-col :span="8">{{ item.remark || '' }}</el-col>
+            </el-row>
+          </div>
+        </div>
+        <div class="foot">
+          <el-row :gutter="20">
+            <el-col :span="14">合计</el-col>
+            <el-col :span="2">{{ 0 }}</el-col>
+            <el-col :span="2"></el-col>
+            <el-col :span="2">{{ 0 }}</el-col>
+            <el-col :span="2"></el-col>
+          </el-row>
+        </div>
+      </div>
+
+      <div class="print-form-2">
+        <el-row :gutter="30">
+          <el-col :span="8" class="item">
+            <div class="label">销售公司</div>
+            <div class="value">
+              <el-input readonly></el-input>
+            </div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">仓库</div>
+            <div class="value">
+              <el-input readonly></el-input>
+            </div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">经销商</div>
+            <div class="value">
+              <el-input readonly></el-input>
+            </div>
+          </el-col>
+        </el-row>
       </div>
     </div>
     
@@ -119,7 +165,7 @@ export default {
     width: 100%;
     height: 100%;
   }
-  .print-table-1 {
+  .print-form-1 {
     .item {
       display: flex;
       padding-right: 10px;
@@ -147,4 +193,88 @@ export default {
       }
     }
   }
+
+  .print-table-1 {
+    font-size: 14px;
+    margin-top: 20px;
+    margin-bottom: 20px;
+    .el-row {
+      margin-left: 0 !important;
+      margin-right: 0 !important;
+      border: 1px solid #EBEEF5;
+      border-right: none;
+    }
+    .el-col {
+      padding-top: 14px;
+      padding-bottom: 14px;
+      border-right: 1px solid #EBEEF5;
+    }
+    .head {
+      color: #909399;
+      font-weight: bold;
+      .el-col {
+        padding: 0;
+        display: flex;
+        height: 40px;
+        align-items: center;
+      }
+    }
+    .body {
+      color: #333333;
+      .el-row {
+        border-top: none;
+      }
+      .el-col {
+        padding: 0;
+        display: flex;
+        height: 40px;
+        align-items: center;
+        word-break: break-all;
+      }
+    }
+    .foot {
+      color: #333333;
+      margin-top: 20px;
+      border-right: 1px solid #EBEEF5;
+      .el-col {
+        padding: 0;
+        display: flex;
+        height: 40px;
+        align-items: center;
+        word-break: break-all;
+      }
+    }
+  }
+
+  .print-form-2 {
+    .item {
+      display: flex;
+      padding-right: 10px;
+      .label {
+        height: 40px;
+        display: flex;
+        align-items: center;
+        box-sizing: border-box;
+        font-size: 14px;
+        color: #333333;
+        flex-shrink: 0;
+      }
+      .value {
+        flex: 1;
+        height: 40px;
+        display: flex;
+        align-items: center;
+        box-sizing: border-box;
+        font-size: 14px;
+        color: #333333;
+        ::v-deep .el-input input {
+          height: 30px;
+          border: none;
+          border-bottom: 1px solid #EBEEF5;
+          padding: 0 10px;
+        }
+      }
+    }
+  }
+
 </style>