yangbifan 2 anni fa
parent
commit
1837d2717e

+ 57 - 0
src/components/ProcessDiagramDialog.vue

@@ -0,0 +1,57 @@
+<template>
+  <el-dialog :title="processDiagramTitle" v-if="processDiagramDialogVisible" :visible.sync="processDiagramDialogVisible">
+    <img class="img-responsive" :src="processDiagramSrc" />
+    <img />
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="processDiagramDialogVisible = false">关 闭</el-button>
+      <!-- <el-button type="primary" @click="processDiagramDialogVisible = false">确 定</el-button> -->
+    </div>
+  </el-dialog>
+</template>
+<style>
+.img-responsive {
+  display: inline-block;
+  height: auto;
+  max-width: 100%;
+}
+</style>
+<script>
+export default {
+    data() {
+        return {
+            processDiagramDialogVisible: false
+        }
+    },
+    watch: {
+    	   screenWidth (val) {
+             if(val < 990){
+             	this.testspan = 24;
+             }else{
+             	this.testspan = 12;
+             }
+          }
+    },
+    mounted () {
+        const that = this
+        window.onresize = () => {
+            return (() => {
+                window.screenWidth = document.body.clientWidth
+                that.screenWidth = window.screenWidth
+            })()
+        }
+    },
+    methods: {
+        showProcessDiagram(row) {
+            if (row.processInstanceId) {
+                this.processDiagramDialogVisible = true;
+                this.processDiagramSrc = this.$url.processinst.showDiagramByTask + "/" + row.taskid;
+                this.processDiagramTitle = "流程轨迹-" + row.title;
+            }else if(row.procinstid){
+                this.processDiagramDialogVisible = true;
+                this.processDiagramSrc = this.$url.processinst.showDiagramByTask + "/" + row.taskid;
+                this.processDiagramTitle = "流程轨迹-" + row.programmecode;
+            }
+        }
+    }
+};
+</script>

+ 92 - 0
src/pages/main/comWin/aproveStep.vue

@@ -0,0 +1,92 @@
+<template>
+    <div>
+        <el-dialog title="审核详情" v-if="visible" :visible.sync="visible" >
+            <el-row style="text-align: right; margin-bottom: 10px" v-if="showButton">
+                <el-button type="primary" @click="showProcessDiagram({procinstid: procinstid, taskid: taskid, programmecode: '审核详情'})" size="mini">流程轨迹</el-button>
+            </el-row>
+            <el-table
+                :data="tableData3"  :header-cell-style="{background:'#e0f3ff',color:'#5f95b7'}"
+                border
+                stripe
+                highlight-current-row="true"
+                style="width: 100%"
+            >
+                <el-table-column align="center"  prop="procinstid" label="实例ID" ></el-table-column>
+                <el-table-column align="center"  prop="taskName" label="处理节点" ></el-table-column>
+                <el-table-column align="center"  prop="userName" label="处理人" ></el-table-column>
+                <el-table-column align="center"  prop="approveDetail" label="处理结果" >
+                    <template slot-scope="scope">
+                        <el-tag type="success" v-if="scope.row.approve=='yes'">{{scope.row.approveDetail}}</el-tag>
+                        <el-tag type="danger" v-if="scope.row.approve=='no'">{{scope.row.approveDetail}}</el-tag>
+                    </template>
+                </el-table-column>
+                <el-table-column align="center"  prop="content" label="处理意见" ></el-table-column>
+                <el-table-column align="center"  prop="time" label="处理时间" ></el-table-column>
+
+
+
+            </el-table>
+
+        </el-dialog>
+        <process-diagram-dialog ref="processDiagramDialog"></process-diagram-dialog>
+    </div>
+
+</template>
+
+<script>
+
+// import moment from 'moment';
+// //import util from '@/util'
+import ProcessDiagramDialog from '../../../components/ProcessDiagramDialog'
+export default {
+  data() {
+    return {
+      items:[],
+      visible:false,
+      tableData3: [],
+      selectedRows: [],
+      procinstid: '',
+      taskid: '',
+      showButton: false,
+    };
+  },
+  components: {
+      ProcessDiagramDialog
+  },
+  created() {},
+  methods: {
+     init(idList, status, procinstid, taskid){
+         this.procinstid = procinstid;
+         this.taskid = taskid;
+         this.visible = true;
+         this.showButton = false;
+         this.doSearch(idList, status);
+     },
+    doSearch(idList,status) {
+        let self = this;
+        if(!idList||status==0){
+          this.tableData3 = [];
+          return false;
+        }
+        var obj ={
+          url:this.$url.activeti.getCommentsByProcinstid,
+          data:{
+            data: idList
+          }
+        };
+        this.common.httpPost(obj,success);
+        function success(data){
+            self.tableData3 = data;
+            if (self.tableData3.length > 0) {
+                if (self.tableData3[0].approve !== 'yes' && self.tableData3[0].approve !== 'no'){
+                    self.showButton = true;
+                }
+            }
+        }
+    },
+      showProcessDiagram(row) {
+          this.$refs.processDiagramDialog.showProcessDiagram(row)
+      }
+  }
+};
+</script>

+ 368 - 0
src/pages/main/comWin/aproveWin.vue

@@ -0,0 +1,368 @@
+<template>
+  <el-dialog title="审核业务" :close-on-click-modal="true" v-if="visible" :visible.sync="visible" :before-close="handleDialogClose">
+    <el-form :model="model" ref="form1" label-width="120px">
+      <el-row :gutter="26">
+        <el-col :span="16" v-if="isLast">
+          <el-form-item label="审核角色" prop="data1" class="is-required">
+            <el-select filterable v-model="model.data1" :multiple="ismultiple" @remove-tag="removeTag" placeholder="请选择..." @change="role">
+              <el-option v-for="item in options1" :key="item.id" :label="item.name" :value="item.id"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="16" v-if="isLast">
+          <el-form-item label="审核人" verify prop="nextDealMan" class="is-required">
+            <el-select filterable v-model="model.nextDealMan" :multiple="ismultiple" placeholder="请选择...">
+              <el-option v-for="item in options2" :key="item.id" :label="item.name" :value="item.id"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="16" v-if="type==2">
+          <el-form-item label="审核意见" prop="content" verify :maxLength="100" class="is-required">
+            <el-input type="textarea" v-model="model.content"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="16" v-if="type==2">
+          <el-form-item label="常用意见" prop="nextDealMan1">
+            <el-select filterable v-model="model.nextDealMan1" @change="changeContent" placeholder="请选择...">
+              <el-option v-for="item in options3" :key="item.adviceId" :label="item.adviceInfo" :value="item.adviceId"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="16" v-if="isLast || type === 2">
+          <el-form-item>
+            <el-checkbox v-model="checked" @change="changeIsQRCodeTrack">同时短信通知</el-checkbox>
+          </el-form-item>
+        </el-col>
+          <el-col :span="16" v-if="!isLast && checked">
+              <el-form-item label="短信接收人名单">
+                  <div class="textarea" :disabled="false">
+                      <el-tag :key="tag.id" style="margin-left:6px;" v-for="tag in messageReceiveList">
+                          {{tag.name}}
+                      </el-tag>
+                  </div>
+              </el-form-item>
+          </el-col>
+      </el-row>
+
+    </el-form>
+
+    <span slot="footer" class="dialog-footer">
+      <el-button type="primary" v-if="type==2" @click="addSer()">添加到常用意见</el-button>
+      <el-button v-if="type==1||type==3" @click="visible = false">关闭</el-button>
+
+      <el-button v-if="type==2" @click="dataFormSubmit('no')">不同意</el-button>
+      <el-button type="primary" @click="dataFormSubmit('yes')">{{btn}}</el-button>
+
+    </span>
+  </el-dialog>
+</template>
+
+
+<script>
+export default {
+  data() {
+    return {
+      checked: false,
+      messageReceiveList: [],
+      formAction: 0, //0 add,//1,edit
+      visible: false,
+      title: '添加',
+      disabled: false,
+      btn: '提交',
+      ismultiple: false,
+      type: 1,
+      aproveVisible: false,
+      isLast: true,
+      taskId: '',
+      model: {
+        content: '',
+        nextDealMan: -1,
+        isAccount: 1,
+        isQRCodeTrack:'',
+      },
+
+      options1: [],
+      options2: [],
+      options3: [],
+      value5: [],
+    }
+  },
+  mounted() {
+    // this.model.data2 = this.$store.getters.getLogin("username");
+    // this.model.data4 = this.$store.getters.getLogin("userId")
+  },
+  activated() {},
+  methods: {
+    init(type, procdefkey, procinstid, resolution, taskId) {
+      //type1  申请  2 中间环节  3.驳回
+      console.log(arguments)
+      this.type = type
+      console.log(99, this.type)
+      this.model = {
+        content: '',
+        nextDealMan: -1,
+        isAccount: 1,
+      }
+      this.taskId = taskId
+      this.options1 = []
+      this.options2 = []
+      this.options3 = []
+      this.value5 = []
+      if (type == 1 || resolution != undefined || type == 3) {
+        this.btn = '提交'
+      } else {
+        this.btn = '同意'
+      }
+      this.procdefkey = procdefkey
+
+      this.procinstid = procinstid
+      this.resolution = resolution
+      this.visible = true
+      if (this.$refs.form1) {
+        this.$refs.form1.resetFields()
+      }
+      this.doSelect()
+      this.doserSelect()
+      if (procinstid !== null && procinstid !== undefined) {
+        this.doSelectMessageReceiveList()
+      }
+    },
+
+    dataFormSubmit(type) {
+      console.log(120, type)
+      if ((this.isLast && !this.model.data1) || (this.model.data1 && this.model.nextDealMan==-1)) return this.$message.error('审核角色或审核人不能为空!')
+      let self = this
+      // console.log(122,this.ismultiple)
+      var model = JSON.parse(JSON.stringify(this.model))
+      if (this.ismultiple) {
+        model.nextDealManList = model.nextDealMan.join(',')
+        model.nextDealMan = -1
+      }
+      console.log(128, model)
+      if (type == 'no') {
+        if (!model.content) {
+          this.$message('请填写驳回原因')
+          return false
+        }
+        model.approve = type
+        self.$parent.dataFormSubmit(model)
+        self.visible = false
+      } else {
+        self.$refs['form1'].validate((valid) => {
+          if (valid) {
+            model.approve = type
+            if(!self.isLast) {
+              model.nextDealMan = -1
+            }
+            self.$parent.dataFormSubmit(model)
+
+            self.visible = false
+          } else {
+            return false
+          }
+        })
+      }
+    },
+    handleDialogClose() {
+      // console.log(self.$parent)
+
+      this.$parent.visible = false
+      this.visible = false
+    },
+    doserSelect() {
+      let self = this
+      this.common.selectInit(this.$url.findAdvice.getList, success, { pageNum: 1, pageSize: 20 }, 'options3')
+      function success(data, str) {
+        self[str] = data.rows
+      }
+    },
+    doSelect() {
+      let self = this
+      let obj = {}
+
+      if (this.type == 1) {
+        obj = { procdefkey: this.procdefkey }
+      } else {
+        obj = { procinstid: this.procinstid, approve: 'yes' }
+        if (this.resolution || this.resolution == 0) {
+          obj.resolution = this.resolution
+        }
+        if (this.taskId) {
+          obj.taskId = this.taskId
+        }
+      }
+      console.log(186, obj)
+      this.common.selectInit(this.$url.activeti.getRole, success, obj, 'options1', error)
+      function error(data) {
+        // self.$parent.aproveVisible = false
+        // self.$message.error('错误,请重新审批!')
+      }
+
+      function success(data, str) {
+        //  multiple
+        console.log(190, data)
+        if (data) {
+          if (data.tasktype != 4) {
+            self.isLast = false
+          } else {
+            // data.activitybehavior = 'SequentialMultiInstanceBehavior'
+
+            if (data.activitybehavior == 'SequentialMultiInstanceBehavior' || data.activitybehavior == 'ParallelMultiInstanceBehavior') {
+              self.ismultiple = true
+              // console.log(199);
+              // console.log(200,data.rows[0].id)
+              self.model.data1 = [data.rows[0].id]
+
+              self.role([data.rows[0].id])
+            } else {
+              // console.log(200,data.rows[0].id)
+              // 如果返回审核角色和审核人 没有  加这层判断 解决前端报id为undefined的问题
+              if (data.rows.length != 0) {
+                self.ismultiple = false
+                self.model.data1 = data.rows[0].id
+
+                self.role(data.rows[0].id)
+              }
+              // self.ismultiple = false;
+              // self.model.data1 = data.rows[0].id;
+
+              // self.role(data.rows[0].id)
+            }
+            self[str] = data.rows
+            self.isLast = true
+          }
+        } else {
+          self.isLast = false
+          self.ismultiple = false
+        }
+      }
+    },
+    role(row) {
+      var str = ''
+
+      if (typeof row == 'object') {
+        if (row.length == 0) {
+          return false
+        }
+        str = row.join(',')
+      } else {
+        if (!row) {
+          return false
+        }
+        str = String(row)
+      }
+      let self = this
+      let obj = {
+        roleId: str,
+        excludeMeWhenSelectNextHandler: self.common.excludeMeWhenSelectNextHandler,
+        excludeFormerHanlder: self.common.excludeMeWhenSelectNextHandler,
+        procinstid: self.procinstid,
+      }
+      this.common.selectInit(this.$url.activeti.getUsersByRoleIds, success, obj, 'options2')
+
+      function success(data, str) {
+        if (data.length != 0) {
+          if (self.ismultiple) {
+            self.nextDeal(data[0].id)
+          } else {
+            self.model.nextDealMan = data[0].id
+          }
+          self[str] = data
+        } else {
+          self.model.nextDealMan = []
+          self.$message('该角色下审核人为空')
+        }
+
+        // if( self.ismultiple){
+        //   self.nextDeal(data[0].id);
+        // }else{
+
+        //   self.model.nextDealMan  = data[0].id;
+        // }
+        // self[str] = data;
+      }
+    },
+    removeTag() {
+      this.model.nextDealMan = -1
+    },
+    nextDeal(id) {
+      if (typeof this.model.nextDealMan != 'object') {
+        this.model.nextDealMan = []
+      }
+      var tag = this.model.nextDealMan.find((i) => {
+        return i == id
+      })
+      if (!tag) {
+        this.model.nextDealMan.push(id)
+      }
+    },
+    addSer() {
+      let self = this
+      if (!this.model.content) {
+        this.$message('审核意见为空')
+        return false
+      }
+      let urls = null
+
+      urls = this.$url.findAdvice.add
+
+      var obj = {
+        url: urls,
+        data: {
+          adviceInfo: this.model.content,
+        },
+      }
+      this.common.httpPost(obj, success)
+      function success(data) {
+        self.$message.success('已添加')
+        self.doserSelect()
+      }
+    },
+    changeContent(value) {
+      let obj = this.options3.find((element) => {
+        return element.adviceId == value
+      })
+      this.model.content = obj.adviceInfo
+    },
+    changeIsQRCodeTrack(checked) {
+          if(checked){
+              this.model.isQRCodeTrack = 1;
+          } else {
+              this.model.isQRCodeTrack = 0;
+          }
+     },
+      doSelectMessageReceiveList(){
+          let self = this;
+          var obj = {
+              url: self.$url.activeti.getMessageReceiveList,
+              data: {
+                  procinstid: self.procinstid,
+              },
+          }
+          self.common.httpPost(obj, success)
+          function success(data) {
+              console.log("获取短信接收人",data);
+              self.messageReceiveList = data.list;
+          }
+      },
+  },
+}
+</script>
+<style>
+.el-textarea__inner {
+  height: 100px;
+}
+.textarea {
+    padding: 4px;
+    min-height: 100px;
+    width: 100%;
+    color: #606266;
+    background-color: #fff;
+    background-image: none;
+    border: 1px solid #dcdfe6;
+    border-radius: 4px;
+    transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
+    box-sizing: border-box;
+}
+</style>

+ 192 - 0
src/pages/main/comWin/prosess.vue

@@ -0,0 +1,192 @@
+<template>
+  <el-dialog :title="title" v-if="visible" :visible.sync="visible">
+    <el-card>
+      <div class="table-title">{{tableData.no}}</div>
+      <el-row :span="18" :offset="3">
+        <el-table
+          :data="items2"
+          :header-cell-style="{background:'#e0f3ff',color:'#5f95b7'}"
+          border
+          stripe
+          highlight-current-row="true"
+          style="width: 100%"
+        >
+          <el-table-column align="center" prop="createAt" label="询价时间"></el-table-column>
+          <el-table-column align="center" prop="quoteEndAt" label="截止时间"></el-table-column>
+          <el-table-column align="center" prop="address" label="发送方式">
+            <template slot-scope="scope">
+              <el-tag v-if="scope.row.byEmail==1" >邮件</el-tag>
+              <el-tag v-if="scope.row.bySms==1">短信</el-tag>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-row>
+    </el-card>
+    <el-card>
+      <div style>报价/询价人数:{{count}}人</div>
+      <el-table
+        :data="items"
+        :header-cell-style="{background:'#e0f3ff',color:'#5f95b7'}"
+        border
+        stripe
+        highlight-current-row="true"
+        style="width: 100%"
+      >
+        <el-table-column align="center" prop="counterpartyName" label="报价银行"></el-table-column>
+        <el-table-column align="center" prop="realName" label="报价联络人"></el-table-column>
+        <el-table-column align="center" prop="address" label="是否已报价">
+          <template  slot-scope="scope">
+            <el-tag v-if="scope.row.status==1" type="success">已报价</el-tag>
+            <el-tag v-if="scope.row.status==2">暂不参与</el-tag>
+            <el-tag v-if="scope.row.status==0" type="danger">未报价</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="email" label="邮件">
+          <template slot-scope="scope">
+            <span v-html="scope.row.email"></span>
+
+            <br>
+            <el-button type="text" v-if="model.status!=1" @click="doSend(scope.row,1)">发送邮件</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="mobile" label="手机号">
+
+          <template slot-scope="scope">
+            <span v-html="scope.row.mobile"></span>
+            <br>
+            <!-- <el-button type="text" @click="doSend(scope.row,12)">发送短信</el-button> -->
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-card>
+    <span slot="footer" class="dialog-footer">
+      <!-- <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
+      <el-button @click="visible = false">关闭</el-button> -->
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+// import moment from 'moment';
+// //import util from '@/util'
+export default {
+  data() {
+    return {
+      items: [],
+      title:"查看",
+      visible: false,
+      model: {},
+      tableData: {},
+      items2: [],
+    };
+  },
+  computed: {
+    count() {
+      let a = 0;
+      this.items.forEach(element => {
+        if (element.status != 0) {
+          a++;
+        }
+      });
+      return a + "/" + this.items.length;
+    }
+  },
+  created() {},
+  methods: {
+    init(priceInquiryRow, type) {
+      priceInquiryRow = priceInquiryRow||{};
+      let priceinquiryId = priceInquiryRow.priceinquiryId;
+      let status = priceInquiryRow.status;
+      if(!priceinquiryId){
+        console.error("invalid priceinquiryId");
+        return;
+      }
+      this.visible = true;
+      this.tabActive = "userInfo";
+      let self = this;
+      if (this.$refs["form"]) {
+        this.$refs["form"].resetFields();
+      }
+
+      if (type == 1 || type == 2 || type == 3) {
+        this.model.priceInquiryId = priceinquiryId;
+        this.model.status = status;
+        if (type == 2) {
+          //如果是审核进来   type就==2
+          this.disabled = true;
+          this.formAction = 2;
+          this.btn = "审核";
+          this.title = "审核";
+        } else if (type == 1) {
+          self.formAction = 1;
+          this.title = "编辑";
+        } else {
+          this.disabled = true;
+          this.formAction = 3;
+          this.btn = "确定";
+          this.title = "查看";
+        }
+        let model = self.model;
+        var obj = {
+          url: this.$url.priceInquiry.getById,
+          data: {
+            priceinquiryId: priceinquiryId
+          }
+        };
+        this.common.httpPost(obj, success);
+        function success(data) {
+
+          self.tableData = JSON.parse(JSON.stringify(data));
+          self.items2 = [];
+          self.items2.push(JSON.parse(JSON.stringify(data)));
+          self.items = data.priceInquiryTos;
+        }
+      } else {
+        self.formAction = 0;
+      }
+    },
+    doSend(row,type){
+      let self = this;
+      let urls = '';
+      if(type==1){
+        if(self.tableData.messageEmailConfigId){
+          urls = this.$url.priceInquiry.sendPriceEmail
+        }else{
+          urls = this.$url.priceInquiry.sendEmail
+        }
+
+      }else{
+        urls = this.$url.priceInquiry.sendSms
+      }
+      var obj = {
+        url: urls,
+        data: {
+          priceinquiryId:this.model.priceInquiryId,
+          counterpartyContactId:row.counterpartycontactId,
+        }};
+      this.common.httpPost(obj, success);
+      function success(data) {
+         self.$message({
+           message:"已发送",
+           type:"success"
+         })
+      }
+
+    },
+    doSearch(value) {
+      this.form.page = value;
+
+      let self = this;
+      var obj = {
+        url: "/activiti/getMadelByPage",
+        data: this.form
+      };
+      this.common.httpPost(obj, success);
+      function success(data) {
+        self.list = data.data.rows;
+        self.total = data.data.total;
+      }
+    }
+  }
+};
+</script>