qinbai 3 年之前
父节点
当前提交
f04e327bd3

+ 15 - 20
src/components/examineApprove/config/startDialog.json

@@ -7,22 +7,17 @@
   "tip": false,
   "searchShow": true,
   "searchMenuPosition": "right",
-  "searchMenuSpan": 6,
+  "searchMenuSpan": 12,
+  "searchLabelWidth": 120,
   "tree": true,
-  "selection": true,
+  "selection": false,
   "addBtn": false,
   "viewBtn": false,
   "editBtn": false,
   "delBtn": false,
-  "menuWidth": 150,
+  "menuWidth": 220,
   "column":[
-    {
-      "label": "租户编号",
-      "prop": "tenantId",
-      "search": true,
-      "index": 1,
-      "width":150
-    },{
+   {
       "label": "流程分类",
       "prop": "category",
       "search": true,
@@ -34,29 +29,29 @@
       },
       "dataType":"number",
       "slot": true,
-      "index": 2,
-      "width":120
+      "index": 1,
+      "width":180
     },{
       "label": "流程标识",
       "prop": "key",
-      "index": 4,
-      "width":120
+      "index": 2,
+      "width":150
     },{
       "label": "流程名称",
       "prop": "name",
       "search": true,
-      "index": 5,
-      "width":140
+      "index": 3,
+      "width":150
     },{
       "label": "状态",
       "prop": "suspensionState",
-      "index": 6,
-      "width":120
+      "index": 4,
+      "width":150
     },{
       "label": "部署时间",
       "prop": "deploymentTime",
-      "index": 7,
-      "width":150
+      "index": 5,
+      "width":200
     }
   ]
 }

+ 41 - 14
src/components/examineApprove/index.vue

@@ -22,23 +22,46 @@
         </el-button>
       </template>
     </avue-crud>
-    <span slot="footer" class="dialog-footer">
-          <el-button @click="closeFun()">关 闭</el-button>
+    <div style="margin-left: 90%">
+       <span slot="footer" class="dialog-footer" >
+          <el-button type="primary"  @click="closeFun()">关 闭</el-button>
   </span>
+    </div>
     <el-dialog
-      title="配置"
-      :visible.sync="dialogConfiguration"
+      title="请核"
+      :visible.sync="dialogPleaseCheck"
       width="600px"
-      :modal-append-to-body="false"
+      append-to-body
       :close-on-click-modal="false"
       destroy-on-close
     >
       <examine-start
         :processDefinitionId="processDefinitionId"
         :itemId = "itemId"
-        @dialogClose="dialogConfigurationClose"
+        @dialogClose="dialogPleaseCheckClose"
       ></examine-start>
     </el-dialog>
+    <el-dialog title="流程图"
+               append-to-body
+               :visible.sync="flowBox"
+               :fullscreen="true">
+      <iframe
+        :src=flowUrl
+        width="80%"
+        height="700"
+        title="流程图"
+        frameBorder="no"
+        border="0"
+        marginWidth="0"
+        marginHeight="0"
+        scrolling="no"
+        allowTransparency="yes">
+      </iframe>
+      <span slot="footer"
+            class="dialog-footer">
+        <el-button @click="flowBox = false">关 闭</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -69,8 +92,12 @@
           pagerCount: 5,
           total: 0,
         },
-        dialogConfiguration:false,
+        dialogPleaseCheck:false,
         processDefinitionId:'',
+        //流程图
+        flowBox: false,
+        flowUrl: '',
+        itemId:'',
       }
     },
     created() {
@@ -93,16 +120,16 @@
         })
       },
       handleStart(row){
-        this.dialogConfiguration = true;
+        this.dialogPleaseCheck = true;
         this.processDefinitionId = row.id
       },
-      handleImage(){
-
+      handleImage(row) {
+        this.flowUrl = `/api/blade-flow/process/resource-view?processDefinitionId=${row.id}`;
+        this.flowBox = true;
       },
-      dialogConfigurationClose() {
-        this.dialogConfiguration = false;
-        this.onLoad(this.page); //关闭刷新
-        this.$refs.crud.toggleSelection();
+      dialogPleaseCheckClose() {
+        this.dialogPleaseCheck = false;
+        this.closeFun()
       }
     }
   }

+ 2 - 1
src/components/examineApprove/start.vue

@@ -90,7 +90,8 @@
               this.form.itemId = this.itemId
               examineApproveSubmit(this.form).then(res =>{
                 if(res.data.success){
-                  this.$message.success("操作成功!")
+                  this.$message.success("请核成功!")
+                  this.$emit('dialogClose');
                 }
               })
             }

+ 66 - 6
src/views/basicData/productInformation/index.vue

@@ -25,6 +25,15 @@
                    @size-change="sizeChange"
                    @refresh-change="refreshChange"
                    @on-load="onLoad">
+          <template slot="menuLeft">
+            <el-button
+              type="primary"
+              size="small"
+              icon="el-icon-bottom"
+              @click="commodityImport()"
+            >导入
+            </el-button>
+          </template>
           <template slot-scope="scope" slot="menu">
             <el-button
                 type="text"
@@ -49,6 +58,18 @@
             </el-button>
           </template>
         </avue-crud>
+        <el-dialog title="导入产品"
+                   append-to-body
+                   :visible.sync="excelBox"
+                   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>
+        </el-dialog>
       </basic-container>
     </el-col>
   </el-row>
@@ -126,9 +147,53 @@ export default {
       platformData: [],
       platformForm: {},
       excelForm: {},
+      excelOption: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: '模板上传',
+            prop: 'excelFile',
+            type: 'upload',
+            drag: true,
+            loadText: '模板上传中,请稍等',
+            span: 24,
+            propsHttp: {
+              res: 'data',
+            },
+            tip: '请上传 .xls,.xlsx 标准格式文件',
+            action: "",
+          },
+          {
+            label: '模板下载',
+            prop: 'excelTemplate',
+            formslot: true,
+            span: 24,
+          }
+        ]
+      }
     };
   },
   methods: {
+    //导入
+    commodityImport(){
+      if(this.treeDeptId === ''){
+        this.$message.warning("请选择产品类型")
+      }else{
+        this.excelBox = !this.excelBox
+        const column = this.findObject(this.excelOption.column, "excelFile");
+        column.action = "/api/blade-client/goodsdesc/import-desc?typeId="+this.treeDeptId+"";
+      }
+    },
+    derivation() {
+      window.open(`/api/blade-client/goodsdesc/export-template?${this.website.tokenHeader}=${getToken()}`);
+    },
+    uploadAfter(res, done, loading, column) {
+      window.console.log(column);
+      this.excelBox = false;
+      this.refreshChange();
+      done();
+    },
     nodeClick(data) {
       this.treeDeptId = data.id;
       this.page.currentPage = 1;
@@ -259,12 +324,6 @@ export default {
     handleImport() {
       this.excelBox = true;
     },
-    uploadAfter(res, done, loading, column) {
-      window.console.log(column);
-      this.excelBox = false;
-      this.refreshChange();
-      done();
-    },
     handleTemplate() {
       window.open(`/api/blade-user/export-template?${this.website.tokenHeader}=${getToken()}`);
     },
@@ -307,6 +366,7 @@ export default {
       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.loading = false;
         this.selectionClear();
       });

+ 2 - 2
src/views/work/process/leave/handle.vue

@@ -128,7 +128,7 @@
           processInstanceId: this.processInstanceId,
           flag: 'ok',
           comment: this.form.comment,
-          itemId : '1458265136067522561'
+          businessId:this.form.id
         };
         completeTask(params).then(res => {
           const data = res.data;
@@ -150,7 +150,7 @@
           taskId: this.taskId,
           processInstanceId: this.processInstanceId,
           comment: this.form.comment,
-          itemId : '1458265136067522561'
+          businessId:this.form.id
         };
         completeTask(params).then(res => {
           const data = res.data;

+ 1 - 1
src/views/workManagement/main-items/configuration/detailsPage.json

@@ -39,7 +39,7 @@
       "label": "任务部门",
       "prop": "deptid",
       "type":"tree",
-      "dicUrl": "/api/blade-system/dept/tree?tenantId=000000",
+      "dicUrl": "/api/blade-system/dept/tree?tenantId=096359",
       "props": {
         "label": "title",
         "value": "value"

+ 84 - 63
src/views/workManagement/main-items/detailsPage.vue

@@ -67,7 +67,7 @@
             <el-button type="info"
                        size="small"
                        :disabled="crudSelection == 0"
-                       @click.stop="openPleaseCheckDialog()">请 核
+                       @click.stop="beforePleaseCheck()">请 核
             </el-button>
           </template>
           <template slot="menuRight">
@@ -83,6 +83,7 @@
               type="text"
               size="small"
               @click="rowCellTwo(row,index)"
+              :disabled="row.strStatus !== '录入'"
             >{{row.$cellEdit?'修改完成':'修改'}}</el-button>
           </template>
           <template slot="userid" slot-scope="{row,index}">
@@ -184,43 +185,23 @@
     </span>
     </el-dialog>
     <el-dialog
-      title="请核"
+      title="流程"
       append-to-body
       class="el-dialogDeep"
-      :visible.sync="pleaseCheckDialog"
+      :visible.sync="processDialog"
       width="60%"
       :close-on-click-modal="false"
       :destroy-on-close="true"
+      :modal-append-to-body='false'
       :close-on-press-escape="false"
       v-dialog-drag
     >
       <examine-approve
         :itemId ="itemId"
-        :closeFun="dialogExamineApproveClose"
+        :closeFun="dialogProcessClose"
       >
       </examine-approve>
     </el-dialog>
-    <el-dialog title="流程图"
-               append-to-body
-               :visible.sync="flowBox"
-               :fullscreen="true">
-      <iframe
-        :src=flowUrl
-        width="80%"
-        height="700"
-        title="流程图"
-        frameBorder="no"
-        border="0"
-        marginWidth="0"
-        marginHeight="0"
-        scrolling="no"
-        allowTransparency="yes">
-      </iframe>
-      <span slot="footer"
-            class="dialog-footer">
-        <el-button @click="flowBox = false">关 闭</el-button>
-      </span>
-    </el-dialog>
   </div>
 </template>
 
@@ -246,8 +227,8 @@
   import { corpsbank } from "@/api/basicData/configuration"
   //事务
   import examineApprove from "@/components/examineApprove/index";
-  import {flowCategory, flowRoute} from "@/util/flow";
-  import {startList} from "@/api/work/work";
+  //对象数组比较
+  import { contrastObj,contrastList } from "@/util/contrastData";
 
 
   export default {
@@ -503,8 +484,9 @@
           total: 0,
           pageSize: 10
         },
+        itemId:'',
         //请核窗口定义
-        pleaseCheckDialog:false,
+        processDialog:false,
         pleaseCheckContact:startOption,
         pleaseCheckLoading:false,
         pleaseCheckData:[],
@@ -513,10 +495,10 @@
           currentPage: 1,
           total: 0
         },
-        //流程图
-        flowBox: false,
-        flowUrl: '',
-        itemId:'',
+        //新旧数据比较
+        oldData:[],
+        oldUpLoadData:[],
+        oldForm:{}
       };
     },
     created() {
@@ -555,19 +537,16 @@
         if(this.id){
           projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
             this.form = res.data.data;
+            this.oldForm = Object.assign({},res.data.data);
             if(res.data.data.corpName){
               this.configuration.dicData = res.data.data.corpName; //给客户名称赋值
             }
             if(res.data.data.filesList){
               this.upLoadData = res.data.data.filesList
+              this.oldUpLoadData = this.deepClone(res.data.data.filesList)
             }
             if(res.data.data.itemList){
-              this.loading = true;
               this.operationDetailList(res.data.data.itemList);
-              this.loading = false;
-              if(pleaseCheck === 10086){
-                this.pleaseCheck();
-              }
             }else{
               this.data = [];
             }
@@ -586,6 +565,7 @@
       },
       operationDetailList(itemList){
         this.data = itemList;
+        this.oldData = this.deepClone(itemList)
         let status = [];
         this.data.forEach(item =>{
           item.status == 0 ? status.push(true) : status.push(false)
@@ -631,24 +611,35 @@
         })
       },
       openPleaseCheckDialog(){
-        this.pleaseCheckDialog = true;
-        this.itemId = this.crudSelection[0].id
+        this.processDialog = true;
+        this.itemId = this.crudSelection[0].id   //记得不能写死
       },
       //请核之前
       beforePleaseCheck(){
         if(this.crudSelection){
-          let resultUserName = [];
+          let id = [];
           let result = [];
           this.crudSelection.forEach(item=>{
             // 新录入状态下  才可提交审核
-            item.createUserName ? resultUserName.push(true) : resultUserName.push(false) //如果没有创建人并且为新录入  提示保存
+            item.id ? id.push(true) : id.push(false) //如果没有id并且为新录入  提示保存
             item.strStatus === "录入" ? result.push(true) : result.push(false) //判断所有的是否为录入状态
           })
-          if(resultUserName.findIndex(item => item != true) == -1){
-            // 如果数组内有一个 为false  则为false
+          if(id.findIndex(item => item != true) == -1){
             if(result.findIndex(item => item != true) == -1){
-              // this.openPleaseCheckDialog()
-              // this.editMainProject(10086);
+              if(contrastObj(this.form,this.oldForm) || contrastList(this.data,this.oldData)){  //判断是否改动过此页面
+                this.$confirm("您已改动此页面,请先保存之后在请核?", "提示", {
+                  confirmButtonText: "保存",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }).then(() => {
+                  this.editMainProject();
+                }).catch(()=>{
+                  return
+                })
+              }else{
+                this.pleaseCheck()
+                // this.openPleaseCheckDialog();
+              }
             }else{
               this.$message({
                 type: "error",
@@ -662,7 +653,7 @@
               cancelButtonText: "取消",
               type: "warning"
             }).then(() => {
-              this.editMainProject(10086);
+              this.editMainProject();
             })
           }
         }
@@ -690,10 +681,7 @@
               filesList:this.upLoadData
             }
             editMianProject(params).then(res =>{
-              if(pleaseCheck === 10086){  //请核
-                this.id =  res.data.data;
-                this.getProjectDetail(pleaseCheck)
-              }else if(pleaseCheck === 10010){  //复制新单新单
+             if(pleaseCheck === 10010){  //复制新单新单
                 this.$router.push({
                   path: "/mainItems_detailsPage",
                   query: {id: ''},
@@ -703,6 +691,16 @@
                 this.data = []
                 this.upLoadData = []
                 this.id = ''
+              }else if(pleaseCheck === 10001){  //返回列表保存数据
+                this.$message({
+                  type: "success",
+                  message: "操作成功!"
+                });
+                this.$router.$avueRouter.closeTag();
+                this.$router.push({
+                  path: '/workManagement/main-items/list',
+                  query: {}
+                });
               }else{
                 this.$message({
                   type: "success",
@@ -717,25 +715,47 @@
       //请核
       pleaseCheck(){
         this.crudSelection.forEach(item =>{
+          let success = false;
           updateItemStatus(this.data[item.$index].id,1).then(res =>{
             if(res.data.success){
-              this.$message({
-                type: "success",
-                message: "请核成功!"
-              });
-              //刷新列表
-              this.getProjectDetail();
+              success = true
             }
           })
+          if(success){
+            this.$message({
+              type: "success",
+              message: "请核成功!"
+            });
+            //刷新列表
+            this.getProjectDetail();
+          }
         })
       },
       //返回主营项目列表
       backToList(){
-        this.$router.$avueRouter.closeTag();
-        this.$router.push({
-          path: '/workManagement/main-items/list',
-          query: {}
-        });
+        if(contrastObj(this.form,this.oldForm) || contrastList(this.data,this.oldData)
+          || contrastList(this.upLoadData,this.oldUpLoadData)
+        ){
+          this.$confirm("是否保存当前页面?", "提示", {
+            confirmButtonText: "保存",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then(() => {
+            this.editMainProject(10001)
+          }).catch(()=>{
+            this.$router.$avueRouter.closeTag();
+            this.$router.push({
+              path: '/workManagement/main-items/list',
+              query: {}
+            });
+          })
+        }else{
+          this.$router.$avueRouter.closeTag();
+          this.$router.push({
+            path: '/workManagement/main-items/list',
+            query: {}
+          });
+        }
       },
       //点击修改或保存时触发
       rowCellTwo(row,index){
@@ -885,8 +905,9 @@
            this.userDialog = !this.userDialog
          }
       },
-      dialogExamineApproveClose(){
-        this.pleaseCheckDialog = false
+      dialogProcessClose(){
+        this.processDialog = false
+        this.getProjectDetail()
       },
     },
   };