|  | @@ -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()
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |    };
 |