|
|
@@ -45,16 +45,22 @@
|
|
|
</template>
|
|
|
|
|
|
<template slot="menu" slot-scope="{row, index}">
|
|
|
- <el-button size="small" class="el-button--text" v-if="permission.sealhandover_edit && userInfo.user_id == row.createUser" @click="$refs.crud.rowEdit(row, index)"><i class="el-icon-edit"></i> 編 輯</el-button>
|
|
|
- <el-button size="small" class="el-button--text" v-if="permission.sealhandover_delete && userInfo.user_id == row.createUser" @click="$refs.crud.rowDel(row, index)"><i class="el-icon-delete"></i> 刪 除</el-button>
|
|
|
+ <el-button size="small" class="el-button--text" v-if="permission.sealhandover_edit && userInfo.user_id == row.createUser && row.process == 2" @click="$refs.crud.rowEdit(row, index)"><i class="el-icon-edit"></i> 編 輯</el-button>
|
|
|
+ <el-button size="small" class="el-button--text" v-if="permission.sealhandover_delete && userInfo.user_id == row.createUser && row.process == 2" @click="$refs.crud.rowDel(row, index)"><i class="el-icon-delete"></i> 刪 除</el-button>
|
|
|
+ <el-button size="small" class="el-button--text" v-if="permission.sealhandover_sure && row.process == 2 && row.receiverId == userInfo.user_id" @click="approveForm=row,approveVisible=true"><i class="el-icon-check"></i> 確 認</el-button>
|
|
|
</template>
|
|
|
|
|
|
<template slot="receiverNameForm">
|
|
|
- <select-dialog-user :name="form.receiverName" :ehr="form.receiverNo" :disabled="receiverDisabled" :callback="selectCallback"></select-dialog-user>
|
|
|
- </template>
|
|
|
- <template slot="handoverPersonNameForm">
|
|
|
- <select-dialog-user :name="form.handoverPersonName" :ehr="form.handoverPersonNo" :disabled="true" :callback="handoverSelectCallback"></select-dialog-user>
|
|
|
+ <div v-if="!hasOrgNo">
|
|
|
+ <select-dialog-user :id="form.receiverId" :name="form.receiverName" :ehr="form.receiverNo" :disabled="receiverDisabled" :callback="selectCallback"></select-dialog-user>
|
|
|
+ </div>
|
|
|
+ <div v-if="hasOrgNo">
|
|
|
+ <select-dialog-user v-if="hasOrgNo" :id="form.receiverId" :name="form.receiverName" :ehr="form.receiverNo" :disabled="receiverDisabled" :has-org-no="hasOrgNo" :callback="selectCallback"></select-dialog-user>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
+ <!--<template slot="handoverPersonNameForm">
|
|
|
+ <select-dialog-user :name="form.handoverPersonName" :ehr="form.handoverPersonNo" :callback="handoverSelectCallback"></select-dialog-user>
|
|
|
+ </template>-->
|
|
|
|
|
|
<template slot-scope="{disabled,size}" slot="sealNoSearch">
|
|
|
<!-- <avue-input placeholder="請選擇內容" v-model="search.sealNos"></avue-input>-->
|
|
|
@@ -75,42 +81,67 @@
|
|
|
</template>
|
|
|
|
|
|
<template slot="isTurnInForm" slot-scope="{row, index}">
|
|
|
- <el-checkbox v-model="row.isTurnIn" @change="turnInChange"></el-checkbox>
|
|
|
+ <el-checkbox v-model="row.isTurnIn" :disabled="turnInDisabled" @change="turnInChange"></el-checkbox>
|
|
|
<el-tag size="small " type="success" plain v-if="row.isTurnIn">上繳至上級單位</el-tag>
|
|
|
<el-tag size="small " type="danger" plain v-if="!row.isTurnIn">非上繳</el-tag>
|
|
|
</template>
|
|
|
|
|
|
+ <template slot="process" slot-scope="{row, index}">
|
|
|
+ <el-tag size="small " type="warning" plain v-if="row.process == 2">待確認</el-tag>
|
|
|
+ <el-tag size="small " type="success" plain v-if="row.process == 3">已確認</el-tag>
|
|
|
+ </template>
|
|
|
+
|
|
|
</avue-crud>
|
|
|
|
|
|
<el-dialog :append-to-body="true" :modal-append-to-body="false" :destroy-on-close="true" :fullscreen="true" :visible.sync="keepVisible" title="保管人查詢">
|
|
|
- <sealhandover-keep></sealhandover-keep>
|
|
|
+ <div v-if="keepVisible">
|
|
|
+ <sealhandover-keep></sealhandover-keep>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="信息確認"
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="approveVisible"
|
|
|
+ width="70%">
|
|
|
+ <sealhandover-sure :form="approveForm" @close="approveVisible = false, onLoad(page)"></sealhandover-sure>
|
|
|
</el-dialog>
|
|
|
|
|
|
</basic-container>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {getList, getDetail, add, update, remove, getByNoAndType, getDownloadList} from "@/api/bank/sealhandover";
|
|
|
+ import {getList, getDetail, add, update, remove, getByNoAndType, getDownloadList, getCurrentUserKeepList} from "@/api/bank/sealhandover";
|
|
|
import {mapGetters} from "vuex";
|
|
|
import { getCurrentDept } from "@/api/system/dept";
|
|
|
- import {dateFormat} from "../../util/date";
|
|
|
- import SelectDialogUser from "../../components/select-dialog/select-dialog-user";
|
|
|
- import {getDeptTree, getTree} from "@/api/system/dept";
|
|
|
+ import {dateFormat} from "@/util/date";
|
|
|
+ import SelectDialogUser from "@/components/select-dialog/select-dialog-user";
|
|
|
+ import {getDeptTree, getTree, getChildsDept} from "@/api/system/dept";
|
|
|
import {getStandardByCode} from "@/api/bank/handoverstandard";
|
|
|
- import SealhandoverKeep from "../../views/bank/sealhandover-keep";
|
|
|
+ import SealhandoverSure from "@/components/common/sealhandover-sure";
|
|
|
+ import SealhandoverKeep from "@/views/bank/sealhandover-keep";
|
|
|
|
|
|
export default {
|
|
|
name: "init-sealhandover",
|
|
|
- components: {SealhandoverKeep, SelectDialogUser},
|
|
|
+ components: {SealhandoverKeep, SealhandoverSure, SelectDialogUser},
|
|
|
data() {
|
|
|
return {
|
|
|
+ turnInDisabled: false,
|
|
|
+
|
|
|
+ isManageUser: false,
|
|
|
+ userKeepList: [],
|
|
|
+ currentDept: [],
|
|
|
+
|
|
|
title: "",
|
|
|
search: {},
|
|
|
receiverDisabled: false,
|
|
|
keepVisible: false,
|
|
|
delBatchBtn: true,
|
|
|
|
|
|
+ approveForm: {},
|
|
|
+ approveVisible: false,
|
|
|
+
|
|
|
type: '',
|
|
|
+ hasOrgNo: null,
|
|
|
form: {},
|
|
|
query: {},
|
|
|
loading: true,
|
|
|
@@ -151,6 +182,7 @@
|
|
|
span: 24,
|
|
|
hide: true,
|
|
|
disabled: true,
|
|
|
+ span: 24,
|
|
|
search: true,
|
|
|
searchSpan: 4,
|
|
|
rules: [{
|
|
|
@@ -164,6 +196,23 @@
|
|
|
prop: "orgNo",
|
|
|
hide: true,
|
|
|
disabled: true,
|
|
|
+ filterable: true,
|
|
|
+ type: "select",
|
|
|
+ // dicUrl: `/api/blade-system/expand/dept/getChildsDept`,
|
|
|
+ dicData: [],
|
|
|
+ props: {
|
|
|
+ label: "orgNo",
|
|
|
+ value: "orgNo"
|
|
|
+ },
|
|
|
+ change: ({value, column}) => {
|
|
|
+ if (!value) return;
|
|
|
+ let dicData = this.findObject(this.option.column, 'orgNo').dicData;
|
|
|
+ dicData.forEach(item => {
|
|
|
+ if (item.orgNo == value){
|
|
|
+ this.form.orgName = item.deptName;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "請輸入機構號",
|
|
|
@@ -188,27 +237,62 @@
|
|
|
props:{
|
|
|
label: "dictValue",
|
|
|
value: "dictKey",
|
|
|
- },dicFormatter: (res) => {
|
|
|
- res.data.forEach(item => {item.disabled = item.isSealed == 1;})
|
|
|
+ },
|
|
|
+ dicFormatter: (res) => {
|
|
|
+ let dicData = this.deepClone(res.data);
|
|
|
+ // 处理完封存的,再填充给印章类型下拉
|
|
|
+ dicData.forEach(item => {item.disabled = item.isSealed == 1;})
|
|
|
+ this.findObject(this.option.column, 'sealType').dicData = dicData;
|
|
|
return res.data;
|
|
|
},
|
|
|
search: true,
|
|
|
- hide: true,
|
|
|
- display: false,
|
|
|
+ // hide: true,
|
|
|
+ addDisplay: false,
|
|
|
+ editDisplay: false,
|
|
|
+ viewDisplay: true,
|
|
|
searchMultiple: true,
|
|
|
},
|
|
|
{
|
|
|
label: "印章類型",
|
|
|
prop: "sealType",
|
|
|
type: "select",
|
|
|
- dicUrl: "/api/blade-system/dict/dictionary?code=seal_type",
|
|
|
+ hide: true,
|
|
|
+ addDisplay: true,
|
|
|
+ editDisplay: true,
|
|
|
+ viewDisplay: false,
|
|
|
props:{
|
|
|
label: "dictValue",
|
|
|
value: "dictKey",
|
|
|
},
|
|
|
- dicFormatter: (res) => {
|
|
|
- res.data.forEach(item => {item.disabled = item.isSealed == 1;})
|
|
|
- return res.data;
|
|
|
+ change: ({value, column}) => {
|
|
|
+ if (!value || this.type == 'view') return;
|
|
|
+ if (!this.form.sealNo){
|
|
|
+ getByNoAndType(this.form.sealNo, value, this.form.orgNo).then(res => {
|
|
|
+ const data = res.data.data;
|
|
|
+ if (Object.keys(data).length == 0){
|
|
|
+ this.receiverDisabled = false;
|
|
|
+ } else {
|
|
|
+ // 編輯時,若記錄為自己,則跳過
|
|
|
+ if (this.form.id == data.id){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (data.isTurnIn == 1){
|
|
|
+ this.$message.warning("此印章已上繳,請重新選擇!");
|
|
|
+ this.receiverDisabled = true;
|
|
|
+ this.form.sealNo = null;
|
|
|
+ }else{
|
|
|
+ this.receiverDisabled = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //支行用户添加交接
|
|
|
+ if (!this.isManageUser && this.type == 'add'){
|
|
|
+ let sealObj = value.split('-');
|
|
|
+ this.form.sealType = sealObj[0];
|
|
|
+ this.form.sealNo = sealObj[1];
|
|
|
+ }
|
|
|
},
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
@@ -223,17 +307,13 @@
|
|
|
searchSpan: 4,
|
|
|
searchslot: true,
|
|
|
change: ({value, column}) => {
|
|
|
- if (!value) return;
|
|
|
+ if (!value ||!this.form.sealType || this.type == 'view') return;
|
|
|
getByNoAndType(value, this.form.sealType, this.form.orgNo).then(res => {
|
|
|
const data = res.data.data;
|
|
|
let $handoverNo = this.findObject(this.option.column, 'handoverPersonNo');
|
|
|
if (Object.keys(data).length == 0){
|
|
|
- // $handoverNo.disabled = false;
|
|
|
- this.form.handoverPersonNo = '';
|
|
|
- delete this.form.handoverPersonName;
|
|
|
this.receiverDisabled = false;
|
|
|
} else {
|
|
|
- // $handoverNo.disabled = true;
|
|
|
// 編輯時,若記錄為自己,則跳過
|
|
|
if (this.form.id == data.id){
|
|
|
return;
|
|
|
@@ -241,11 +321,10 @@
|
|
|
if (data.isTurnIn == 1){
|
|
|
this.$message.warning("此印章已上繳,請重新選擇!");
|
|
|
this.receiverDisabled = true;
|
|
|
+ this.form.sealNo = null;
|
|
|
}else{
|
|
|
this.receiverDisabled = false;
|
|
|
}
|
|
|
- this.form.handoverPersonNo = data.receiverNo;
|
|
|
- this.form.handoverPersonName = data.receiverName;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -279,7 +358,8 @@
|
|
|
{
|
|
|
label: "交出人",
|
|
|
prop: "handoverPersonName",
|
|
|
- formslot: true,
|
|
|
+ // formslot: true,
|
|
|
+ disabled: true,
|
|
|
rules: [{
|
|
|
required: false,
|
|
|
message: "請輸入交出人姓名",
|
|
|
@@ -321,11 +401,10 @@
|
|
|
{
|
|
|
label: "接收人",
|
|
|
prop: "receiverName",
|
|
|
+ disabled: true,
|
|
|
search: true,
|
|
|
- searchPlaceholder: "保管人",
|
|
|
- searchTip: "保管人",
|
|
|
searchSpan: 4,
|
|
|
- formslot: true,
|
|
|
+ // formslot: true,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "請輸入接收人姓名",
|
|
|
@@ -391,6 +470,21 @@
|
|
|
trigger: "blur"
|
|
|
}]
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "進度",
|
|
|
+ prop: "process",
|
|
|
+ display: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "確認時間",
|
|
|
+ prop: "sureTime",
|
|
|
+ hide: true,
|
|
|
+ addDisplay: false,
|
|
|
+ editDisplay: false,
|
|
|
+ type: "datetime",
|
|
|
+ format: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ },
|
|
|
]
|
|
|
},
|
|
|
data: []
|
|
|
@@ -420,6 +514,17 @@
|
|
|
const column = this.findObject(this.option.column, "orgNos");
|
|
|
let treeData = getTree(res.data.data, this.userInfo.dept_id);
|
|
|
column.dicData = treeData;
|
|
|
+ // this.findObject(this.option.column, "orgNo").dicData = treeData;
|
|
|
+ });
|
|
|
+ getChildsDept().then(res => {
|
|
|
+ let dicData = [];
|
|
|
+ let data = res.data.data;
|
|
|
+ data.forEach(item => {
|
|
|
+ if (item.orgNo.indexOf("999") == -1){
|
|
|
+ dicData.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.findObject(this.option.column, "orgNo").dicData = dicData;
|
|
|
});
|
|
|
getStandardByCode("sealhandover").then(res => {
|
|
|
const data = res.data.data;
|
|
|
@@ -429,12 +534,20 @@
|
|
|
this.option.column.splice(0,1)
|
|
|
}
|
|
|
});
|
|
|
+ getCurrentUserKeepList().then(res => {
|
|
|
+ this.userKeepList = res.data.data;
|
|
|
+ });
|
|
|
+ getCurrentDept().then(res => {
|
|
|
+ const data = res.data.data;
|
|
|
+ this.currentDept = data;
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
turnInChange(value){
|
|
|
// this.findObject(this.option.column, "receiverNo").rules[0].required = !value;
|
|
|
// this.findObject(this.option.column, "receiverName").rules[0].required = !value;
|
|
|
- this.receiverDisabled = !!value;
|
|
|
+ this.hasOrgNo = value == true ? "51007" : null;
|
|
|
+ this.form.receiverNo = null,this.form.receiverName = null;
|
|
|
},
|
|
|
handleDownload(){
|
|
|
if (this.selectionList.length === 0) {
|
|
|
@@ -446,7 +559,9 @@
|
|
|
})
|
|
|
.then(() => {
|
|
|
getDownloadList(this.query).then(res => {
|
|
|
- this.downLoadData(res.data.data, true)
|
|
|
+ let data = res.data.data;
|
|
|
+ data.forEach(item => {item.isTurnIn = item.isTurnIn == 1 ? true : false;item.sealTypeSearch = item.sealType;})
|
|
|
+ this.downLoadData(data, true)
|
|
|
});
|
|
|
})
|
|
|
}else{
|
|
|
@@ -472,15 +587,21 @@
|
|
|
});
|
|
|
},
|
|
|
handoverSelectCallback(value){
|
|
|
+ this.form.handoverPersonId = value.id;
|
|
|
this.form.handoverPersonNo = value.ehr;
|
|
|
this.form.handoverPersonName = value.name;
|
|
|
},
|
|
|
selectCallback(value){
|
|
|
+ this.form.receiverId = value.id;
|
|
|
this.form.receiverNo = value.ehr;
|
|
|
this.form.receiverName = value.name;
|
|
|
},
|
|
|
rowSave(row, done, loading) {
|
|
|
row.isTurnIn = !row.isTurnIn ? 0 : 1;
|
|
|
+ if (row.sealType.indexOf('-') != -1){
|
|
|
+ let sealObj = row.sealType.split('-');
|
|
|
+ row.sealType = sealObj[0];
|
|
|
+ }
|
|
|
add(row).then(() => {
|
|
|
this.onLoad(this.page);
|
|
|
this.$message({
|
|
|
@@ -495,6 +616,10 @@
|
|
|
},
|
|
|
rowUpdate(row, index, done, loading) {
|
|
|
row.isTurnIn = !row.isTurnIn ? 0 : 1;
|
|
|
+ if (row.sealType.indexOf('-') != -1){
|
|
|
+ let sealObj = row.sealType.split('-');
|
|
|
+ row.sealType = sealObj[0];
|
|
|
+ }
|
|
|
update(row).then(() => {
|
|
|
this.onLoad(this.page);
|
|
|
this.$message({
|
|
|
@@ -549,30 +674,60 @@
|
|
|
beforeOpen(done, type) {
|
|
|
this.type = type;
|
|
|
if (type === 'add'){
|
|
|
- let userInfo = localStorage.getItem("saber-userInfo");
|
|
|
+ //恢复必填
|
|
|
+ this.findObject(this.option.column, "receiverNo").rules[0].required = true;
|
|
|
+ this.findObject(this.option.column, "receiverName").rules[0].required = true;
|
|
|
+ this.receiverDisabled = false;
|
|
|
+
|
|
|
+ this.form.handoverPersonId = this.userInfo.user_id;
|
|
|
+ this.form.handoverPersonNo = this.userInfo.user_ehr;
|
|
|
+ this.form.handoverPersonName = this.userInfo.user_name;
|
|
|
this.form.number = 1;
|
|
|
this.form.handoverDate = dateFormat(new Date(), "yyyy-MM-dd hh:mm");
|
|
|
- getCurrentDept().then(res => {
|
|
|
- const data = res.data.data;
|
|
|
- this.form.bankNo = data.bankNo;
|
|
|
+
|
|
|
+ const data = this.currentDept;
|
|
|
+ this.form.bankNo = data.bankNo;
|
|
|
+ if (data.deptCategory == 1){
|
|
|
+ this.isManageUser = true;
|
|
|
+ this.findObject(this.option.column, 'orgNo').disabled = false;
|
|
|
+ this.findObject(this.option.column, 'sealType').disabled = false;
|
|
|
+ this.findObject(this.option.column, 'sealNo').disabled = false;
|
|
|
+ }else{
|
|
|
+ this.isManageUser = false;
|
|
|
+ this.findObject(this.option.column, 'orgNo').disabled = true;
|
|
|
+ this.findObject(this.option.column, 'sealType').disabled = false;
|
|
|
+ this.findObject(this.option.column, 'sealNo').disabled = true;
|
|
|
this.form.orgNo = data.orgNo;
|
|
|
this.form.orgName = data.deptName;
|
|
|
- });
|
|
|
+
|
|
|
+ getCurrentUserKeepList().then(res => {
|
|
|
+ this.userKeepList = res.data.data;
|
|
|
+ // 支行用户自行添加交接,需要获取当前用户持有的列表作为下拉内容
|
|
|
+ this.findObject(this.option.column, 'sealType').dicData = this.userKeepList;
|
|
|
+ done();
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- //恢复必填
|
|
|
- this.findObject(this.option.column, "receiverNo").rules[0].required = true;
|
|
|
- this.findObject(this.option.column, "receiverName").rules[0].required = true;
|
|
|
- this.receiverDisabled = false;
|
|
|
if (this.form.isTurnIn){
|
|
|
this.turnInChange(true)
|
|
|
}
|
|
|
-
|
|
|
- /*if (["edit", "view"].includes(type)) {
|
|
|
- getDetail(this.form.id).then(res => {
|
|
|
- this.form = res.data.data;
|
|
|
+ if (type == 'edit' && this.form.sealType.indexOf('-') == -1){
|
|
|
+ this.form.sealType = this.form.sealType + '-' + this.form.sealNo;
|
|
|
+ }
|
|
|
+ this.turnInDisabled = type == 'edit'
|
|
|
+ if (type == 'edit'){
|
|
|
+ this.findObject(this.option.column, 'sealType').disabled = true;
|
|
|
+ this.findObject(this.option.column, 'sealNo').disabled = true;
|
|
|
+ getCurrentUserKeepList().then(res => {
|
|
|
+ this.userKeepList = res.data.data;
|
|
|
+ // 支行用户自行添加交接,需要获取当前用户持有的列表作为下拉内容
|
|
|
+ this.findObject(this.option.column, 'sealType').dicData = this.userKeepList;
|
|
|
+ done();
|
|
|
});
|
|
|
- }*/
|
|
|
- done();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // done();
|
|
|
},
|
|
|
searchReset() {
|
|
|
this.query = {};
|
|
|
@@ -627,12 +782,14 @@
|
|
|
onLoad(page, params = {}) {
|
|
|
this.loading = true;
|
|
|
params.status = 1;
|
|
|
- params.createUser = this.userInfo.user_id;
|
|
|
+ params.process = 2;
|
|
|
+ params.receiverId = this.userInfo.user_id;
|
|
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
|
|
const data = res.data.data;
|
|
|
this.page.total = data.total;
|
|
|
data.records.forEach(item => {
|
|
|
item.isTurnIn = item.isTurnIn == 1;
|
|
|
+ item.sealTypeSearch = item.sealType;
|
|
|
})
|
|
|
this.data = data.records;
|
|
|
this.loading = false;
|