Bläddra i källkod

修改 共享上架 销售 审批设置

Qukatie 6 månader sedan
förälder
incheckning
42cf4a0598

+ 1 - 1
src/api/approvalL/processConfig.js

@@ -61,7 +61,7 @@ export function getUserList(params) {
 //审批获得审批人
 export function getUserApprovalList(params) {
   return request({
-    url: '/api/blade-user/userList',
+    url: '/api/blade-user/userListAll',
     method: 'get',
   })
 }

+ 65 - 172
src/views/approval/processConfigL/index.vue

@@ -1,21 +1,9 @@
 <template>
   <div>
     <basic-container>
-      <avue-crud
-        ref="crud"
-        :option="option"
-        :data="dataList"
-        v-model="form"
-        :page.sync="page"
-        :search.sync="search"
-        :table-loading="loading"
-        @on-load="onLoad"
-        @search-change="searchChange"
-        @current-change="currentChange"
-        @size-change="sizeChange"
-        @refresh-change="refreshChange"
-        @saveColumn="saveColumn"
-      >
+      <avue-crud ref="crud" :option="option" :data="dataList" v-model="form" :page.sync="page" :search.sync="search"
+        :table-loading="loading" @on-load="onLoad" @search-change="searchChange" @current-change="currentChange"
+        @size-change="sizeChange" @refresh-change="refreshChange" @saveColumn="saveColumn">
         <template slot-scope="scope" slot="status">
           <span v-if="scope.row.status == 'N'">新建</span>
           <span v-if="scope.row.status == 'A'">有效</span>
@@ -23,52 +11,25 @@
           <span v-if="scope.row.status == 'Z'">暂存</span>
         </template>
         <template slot="menuLeft">
-          <el-button
-            type="primary"
-            icon="el-icon-plus"
-            size="small"
-            @click.stop="addHandle"
-          >创建单据</el-button>
+          <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addHandle">创建单据</el-button>
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button
-            type="text"
-            icon="el-icon-edit"
-            size="small"
-            @click.stop="editOpen(scope.row)"
-          >编辑
+          <el-button type="text" icon="el-icon-edit" size="small" @click.stop="editOpen(scope.row)">编辑
           </el-button>
-          <el-button
-            type="text"
-            icon="el-icon-delete"
-            size="small"
-            @click.stop="rowDel(scope.row, scope.index)"
-          >删除
+          <el-button type="text" icon="el-icon-delete" size="small" @click.stop="rowDel(scope.row, scope.index)">删除
           </el-button>
         </template>
       </avue-crud>
     </basic-container>
-    <el-dialog
-      append-to-body
-      :visible.sync="visible"
-      width="80%"
-      :close-on-click-modal="false"
-      :destroy-on-close="true"
-      :close-on-press-escape="false"
-      v-dialog-drag
-      :title="title"
-    >
+    <el-dialog append-to-body :visible.sync="visible" width="80%" :close-on-click-modal="false" :destroy-on-close="true"
+      :close-on-press-escape="false" v-dialog-drag :title="title">
       <el-form :inline="true" :model="dataForm" :rules="dataRule" ref="dataForm">
         <el-form-item label="审核路径名称" prop="pathName">
           <el-input v-model="dataForm.pathName" placeholder="审核路径名称"></el-input>
         </el-form-item>
         <el-form-item label="状态" prop="status">
           <el-select v-model="dataForm.status" placeholder="状态" style="width: 100%">
-            <el-option
-              v-for="item in optionsStatue"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id">
+            <el-option v-for="item in optionsStatue" :key="item.id" :label="item.name" :value="item.id">
             </el-option>
           </el-select>
         </el-form-item>
@@ -85,124 +46,54 @@
           <el-input v-model="dataForm.remarks" placeholder="备注"></el-input>
         </el-form-item>
       </el-form>
-      <avue-crud
-        ref="dialogCrud"
-        :option="detailOption"
-        :data="detailData"
-      >
+      <avue-crud ref="dialogCrud" :option="detailOption" :data="detailData">
         <template slot="levelName" slot-scope="{row,index}">
-          <el-input
-            v-model="row.levelName"
-            clearable
-            placeholder="请输入"
-          ></el-input>
+          <el-input v-model="row.levelName" clearable placeholder="请输入"></el-input>
         </template>
         <template slot="remarks" slot-scope="{row,index}">
-          <el-input
-            v-model="row.remarks"
-            clearable
-            placeholder="请输入"
-          ></el-input>
+          <el-input v-model="row.remarks" clearable placeholder="请输入"></el-input>
         </template>
         <template slot="iffixAuditUser" slot-scope="{row,index}">
-          <el-select
-            v-model="row.iffixAuditUser"
-          >
-            <el-option
-              label="是"
-              value="T"
-            ></el-option>
-            <el-option
-              label="否"
-              value="F"
-            ></el-option>
+          <el-select v-model="row.iffixAuditUser">
+            <el-option label="是" value="T"></el-option>
+            <el-option label="否" value="F"></el-option>
           </el-select>
         </template>
         <template slot="iffinalItem" slot-scope="{row,index}">
-          <el-select
-            v-model="row.iffinalItem"
-          >
-            <el-option
-              label="是"
-              value="T"
-            ></el-option>
-            <el-option
-              label="否"
-              value="F"
-            ></el-option>
+          <el-select v-model="row.iffinalItem">
+            <el-option label="是" value="T"></el-option>
+            <el-option label="否" value="F"></el-option>
           </el-select>
         </template>
         <template slot="userMold" slot-scope="{ row, index }">
-          <el-select
-            v-model="row.userMold"
-            filterable
-            placeholder="请选择规则"
-            @change="userMoldChange(row)"
-          >
-            <el-option
-              v-for="(item, index) in ruleData"
-              :key="index"
-              :value="item.value"
-              :label="item.label"
-            ></el-option>
+          <el-select v-model="row.userMold" filterable placeholder="请选择规则" @change="userMoldChange(row)">
+            <el-option v-for="(item, index) in ruleData" :key="index" :value="item.value"
+              :label="item.label"></el-option>
           </el-select>
         </template>
         <template slot="auditMoldId" slot-scope="{ row, index }">
-          <el-cascader
-            v-model="row.auditMoldId"
-            :disabled="!row.userMold || row.userMold == 3"
-            :options="row.userMold == 1? roleData: row.userMold == 2? deptData: []"
-            :props="props"
-            collapse-tags
-            clearable
-            filterable
-            @change="auditChange(row)"
-          ></el-cascader>
+          <el-cascader v-model="row.auditMoldId" :disabled="!row.userMold || row.userMold == 3"
+            :options="row.userMold == 1 ? roleData : row.userMold == 2 ? deptData : []" :props="props" collapse-tags
+            clearable filterable @change="auditChange(row)"></el-cascader>
         </template>
         <template slot="auditUserId" slot-scope="{row,index}">
-          <el-select
-            v-model="row.auditUserId"
-            filterable
-            collapse-tags
-            multiple
-            placeholder="审核人"
-          >
-            <el-option v-for="(item,index) in row.userList"
-                       :key="index"
-                       :label="item.realName"
-                       :value="item.id"
-            ></el-option>
+          <el-select v-model="row.auditUserId" filterable collapse-tags multiple placeholder="审核人">
+            <el-option v-for="(item, index) in row.userList" :key="index" :label="item.realName"
+              :value="item.id"></el-option>
           </el-select>
         </template>
         <template slot="salesCompanyId" slot-scope="{row,index}">
-          <el-select
-            v-model="row.salesCompanyId"
-            filterable
-            collapse-tags
-            placeholder="机构"
-          >
-            <el-option v-for="(item,index) in institutionList"
-                       :key="index"
-                       :label="item.deptName"
-                       :value="item.id"
-            ></el-option>
+          <el-select v-model="row.salesCompanyId" filterable collapse-tags placeholder="机构">
+            <el-option v-for="(item, index) in institutionList" :key="index" :label="item.deptName"
+              :value="item.id"></el-option>
           </el-select>
         </template>
         <template slot="menuLeft">
-          <el-button
-            type="primary"
-            icon="el-icon-plus"
-            size="small"
-            @click.stop="addDetail"
-          >新增</el-button>
+          <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addDetail">新增</el-button>
         </template>
         <template slot-scope="{row,index}" slot="menu">
-          <el-button
-            type="text"
-            icon="el-icon-delete"
-            size="small"
-            @click="rowDetailDelete(detailData, index)"
-          >移除</el-button>
+          <el-button type="text" icon="el-icon-delete" size="small"
+            @click="rowDetailDelete(detailData, index)">移除</el-button>
         </template>
       </avue-crud>
       <span slot="footer" class="dialog-footer">
@@ -216,16 +107,18 @@
 <script>
 import option from "./config/mainList.json";
 import detailOption from "./config/detail.json";
-import { getList,
+import {
+  getList,
   modify,
   removeList,
-  detailData ,userList,
-  getUserApprovalList} from "@/api/approvalL/processConfig";
+  detailData, userList,
+  getUserApprovalList
+} from "@/api/approvalL/processConfig";
 import _ from "lodash";
-import {getDeptTree} from "@/api/system/dept";
-import {getRoleTree} from "@/api/system/role";
+import { getDeptTree } from "@/api/system/dept";
+import { getRoleTree } from "@/api/system/role";
 
-import {topList} from "@/api/tirePartsMall/salesManagement/saleOrder";
+import { topList } from "@/api/tirePartsMall/salesManagement/saleOrder";
 
 export default {
   name: "index",
@@ -242,7 +135,7 @@ export default {
         pageSizes: [10, 50, 100, 200, 300, 400, 500]
       },
       detailData: [],
-      auditUserIdDic:[],
+      auditUserIdDic: [],
       loading: false,
       search: {},
       visible: false,
@@ -273,17 +166,17 @@ export default {
       roleData: [],
       deptData: [],
       ruleData: [
-        {value: 1, label: '角色'},
-        {value: 2, label: '部门'},
-        {value: 3, label: '用户'},
+        { value: 1, label: '角色' },
+        { value: 2, label: '部门' },
+        { value: 3, label: '用户' },
       ], //指定规则
     }
   },
   created() {
     this.option = option
     this.detailOption = detailOption
-
-    getUserApprovalList().then(res =>{
+    getUserApprovalList().then(res => {
+      console.log(res,111111111111)
       this.auditUserIdDic = res.data.data
     })
 
@@ -299,7 +192,7 @@ export default {
     this.option.column.forEach(item => {
       if (item.search) i++
     })
-    if (i % 3 !== 0){
+    if (i % 3 !== 0) {
       const num = 3 - Number(i % 3)
       this.option.searchMenuSpan = num * 8;
       this.option.searchMenuPosition = "right";
@@ -330,12 +223,10 @@ export default {
       topList().then(res => {
         this.institutionList = res.data.data
       })
-      detailData({id: row.id}).then(res => {
-        this.dataForm = res.data.data
-        this.detailData = res.data.data.pjAuditPathsLevels
-        this.detailData.map(e => {
+      detailData({ id: row.id }).then(res => {
+        res.data.data.pjAuditPathsLevels.map(e => {
           let params = {};
-          if (e.auditMoldId && e.auditMoldId.length > 0) {
+          if (e.auditMoldId) {
             if (e.userMold === 1) {
               this.$set(params, 'roleId', e.auditMoldId)
             } else if (e.userMold === 2) {
@@ -344,7 +235,9 @@ export default {
             userList(params).then(response => {
               this.$set(e, 'userList', response.data.data);
             })
+            console.log(11111)
           } else {
+            console.log(22222)
             this.$set(e, 'userList', this.auditUserIdDic);
           }
 
@@ -355,6 +248,8 @@ export default {
             e.auditUserId = e.auditUserId.split(',')
           }
         })
+        this.dataForm = res.data.data
+        this.detailData = res.data.data.pjAuditPathsLevels
       })
       this.title = '修改';
       this.visible = !this.visible
@@ -365,8 +260,8 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
-        removeList(row.id).then(res =>{
-          if(res.data.success){
+        removeList(row.id).then(res => {
+          if (res.data.success) {
             this.$message({
               type: "success",
               message: "操作成功!"
@@ -405,7 +300,7 @@ export default {
       }
     },
     addDetail() {
-      if(this.detailData === undefined) {
+      if (this.detailData === undefined) {
         this.detailData = []
       }
       this.detailData.push({
@@ -437,12 +332,12 @@ export default {
           }
         }
       }
-      let params ={
+      let params = {
         ...this.dataForm,
         pjAuditPathsLevels: JSON.parse(JSON.stringify(this.detailData))
       }
-      for (let item of params.pjAuditPathsLevels){
-        item.levelId = _.add(item.$index,1)
+      for (let item of params.pjAuditPathsLevels) {
+        item.levelId = _.add(item.$index, 1)
         delete item.id
         if (item.auditMoldId) {
           item.auditMoldId = item.auditMoldId.join(',');
@@ -451,8 +346,8 @@ export default {
           item.auditUserId = item.auditUserId.join(',');
         }
       }
-      modify(params).then(res =>{
-        if(res.data.success){
+      modify(params).then(res => {
+        if (res.data.success) {
           this.$message.success("操作成功!")
           this.visible = false
           this.refreshChange()
@@ -481,12 +376,10 @@ export default {
     userMoldChange(row) {
       row.auditUserId = null;
       row.auditMoldId = null;
-      this.$set(row, 'userList', row.userMold == 3? this.auditUserIdDic: []);
+      this.$set(row, 'userList', row.userMold == 3 ? this.auditUserIdDic : []);
     },
   },
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 0 - 3
src/views/tirePartsMall/basicData/shareListing/index.vue

@@ -466,9 +466,6 @@ export default {
           }, {
             label: '已共享',
             value: "已共享"
-          }, {
-            label: '已确认',
-            value: "已确认"
           }],
         }]
       }

+ 27 - 5
src/views/tirePartsMall/basicData/shareListingNext/index.vue

@@ -34,6 +34,11 @@
               <el-button :size="size" :type="type" :disabled="row.shareStatus != '暂存'"
                 @click="annexOpen(row, index)">商城图片
               </el-button>
+              <el-tooltip :content="`${row.shareStatus == '已确认' ? '上架' : '下架'}`" placement="top">
+                <el-switch style="margin-left: 10px" v-model="row.shareStatus" @change="check(row)" active-value="已确认"
+                  inactive-value="暂存">
+                </el-switch>
+              </el-tooltip>
             </template>
 
             <template slot-scope="{type,size,row,$index}" slot="menuLeft">
@@ -366,7 +371,7 @@ export default {
           overHidden: true,
         },
         {
-          label: "共享公司",
+          label: "来源公司",
           prop: "srcSalesCompanyName",
           search: true,
           overHidden: true,
@@ -456,10 +461,8 @@ export default {
           dicData: [{
             label: '暂存',
             value: "暂存"
-          }, {
-            label: '已共享',
-            value: "已共享"
-          }, {
+          },
+          {
             label: '已确认',
             value: "已确认"
           }],
@@ -811,6 +814,25 @@ export default {
         this.goodsListSave.push(row);
       }
     },
+    check(row) {
+      console.log(row)
+      if (row.shareStatus == '已确认') {
+        batchSharingConfirm({
+          ids: row.id
+        }).then(res => {
+          this.$message.success("操作成功");
+          this.onLoad(this.page, this.search)
+        })
+      }
+      if (row.shareStatus == '暂存') {
+        batchSharingRevoke({
+          ids: row.id
+        }).then(res => {
+          this.$message.success("操作成功");
+          this.onLoad(this.page, this.search)
+        })
+      }
+    },
     change(row, type) {
       let data = []
       for (let item of this.selectionList) {

+ 6 - 6
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -89,20 +89,20 @@
                             @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.6)">
                             <template slot-scope="{scope,row}" slot="menuLeft">
                                 <el-button type="primary" icon="el-icon-plus" size="small"
-                                    :disabled="isAddBtn || form.businessSource == '共享销售'"
+                                    :disabled="isAddBtn || form.billType== 1"
                                     @click="rowAdd(row, 1)">添加商品</el-button>
                                 <el-button type="success" size="small"
-                                    :disabled="isAddBtn || form.businessSource == '共享销售'" icon="el-icon-bottom"
+                                    :disabled="isAddBtn || form.billType== 1" icon="el-icon-bottom"
                                     @click="excelDialogfun('名称')">按名称导入
                                 </el-button>
                                 <el-button type="success" size="small"
-                                    :disabled="isAddBtn || form.businessSource == '共享销售'" icon="el-icon-bottom"
+                                    :disabled="isAddBtn || form.billType== 1" icon="el-icon-bottom"
                                     @click="excelDialogfun('code')">按Code导入
                                 </el-button>
                                 <el-button type="primary" icon="el-icon-printer" size="small"
                                     @click="handlePrint">打印</el-button>
                                 <el-button type="danger" plain size="small" @click="batchDelete"
-                                    :disabled="form.generateTask == '已生成' || form.businessSource == '外部销售' || form.businessSource == '共享销售'">一键删除</el-button>
+                                    :disabled="form.generateTask == '已生成' || form.businessSource == '外部销售' || form.billType== 1">一键删除</el-button>
                                 <el-button type="primary" plain size="small" @click="quickCopy">快捷复制</el-button>
                                 <el-popover width="600" trigger="click">
                                     <avue-crud :data="inventoryData" :option="inventoryOption"></avue-crud>
@@ -110,7 +110,7 @@
                                         :disabled="selectionMultilist.length != 1">查看库存</el-button>
                                 </el-popover>
                                 <el-button type="primary" icon="el-icon-plus" size="small"
-                                    :disabled="isAddBtn || form.businessSource == '共享销售'"
+                                    :disabled="isAddBtn || form.billType== 1 "
                                     @click="rowAdd(row, 2)">无库存商品</el-button>
                                 <el-popover width="600" trigger="click">
                                     <avue-crud :data="inventoryData2" :option="inventoryOption2">
@@ -1950,7 +1950,7 @@ export default {
             }
             this.isDisabled = false
             this.isAdd = false
-            if (this.form.businessSource == "共享销售") {
+            if (this.form.billType== 1) {
                 this.optionForm.column.forEach(its => {
                     if (its.prop == 'customerName' || its.prop == 'businesDate' || its.prop == 'businessSource' || its.prop == 'returnsNumber' || its.prop == 'returnsAmount' || its.prop == 'srcOrdNo') {
                         this.$set(its, 'disabled', true)