<template>
|
<div v-if="see && useWhere != 'close'" class="securityPermit">
|
<slot name="close"></slot>
|
<div class="heards">{{ name }}</div>
|
<basic-container>
|
<div v-show="forms == 1" class="first-box-outer">
|
<div class="f-b-o-in">
|
<div class="handling-guideline">
|
<h2 class="hand-title">{{ name }}办理指南</h2>
|
<div
|
class="hand-content"
|
ref="handcontent"
|
id="handcontent"
|
v-html="htmls"
|
>
|
<!-- ### -->
|
{{ htmls }}
|
</div>
|
</div>
|
</div>
|
<div class="hand-next">
|
<el-button type="primary" @click="tip0">下一步</el-button>
|
<el-button type="primary" @click="qx">取消</el-button>
|
</div>
|
</div>
|
<div v-show="forms == 2" class="first-box-outer">
|
<div class="f-b-o-in">
|
<el-collapse v-model="activeNames" @change="handleChange">
|
<el-collapse-item title="公司基本信息" name="1">
|
<avue-form
|
ref="form1"
|
v-model="obj0"
|
:option="option"
|
></avue-form>
|
</el-collapse-item>
|
<el-collapse-item title="附件上传/查询" name="2">
|
<attach :type="imgType" :opens="opens"></attach>
|
</el-collapse-item>
|
</el-collapse>
|
</div>
|
|
<div class="hand-next">
|
<el-button type="primary" @click="tip1up1">上一页</el-button>
|
<el-button type="primary" @click="tip1" :disabled="!opens"
|
>暂存</el-button
|
>
|
<el-button type="primary" @click="up()" :disabled="!opens">{{
|
//canDoIt ? "提交审批" : "已成功提交"
|
opens ? "提交审批" : "提交审批"
|
}}</el-button>
|
<el-button type="info" @click="qx">取消</el-button>
|
</div>
|
</div>
|
</basic-container>
|
</div>
|
</template>
|
|
<script>
|
import { mapGetters } from "vuex";
|
import { add, adds, selectIn } from "@/api/recordOur/outCardPopup";
|
import attach from "@/components/attach/attach";
|
export default {
|
components: {
|
attach: attach,
|
},
|
props: ["data"],
|
data() {
|
return {
|
htmls: "",
|
see: false,
|
name: "",
|
type: "",
|
imgType: "",
|
apiName: [],
|
forms: 1,
|
data0: {},
|
obj0: {},
|
option: {
|
emptyBtn: false,
|
submitBtn: false,
|
gutter: 50,
|
column: [],
|
},
|
activeNames: ["1", "2"],
|
opens: true,
|
};
|
},
|
computed: {
|
...mapGetters(["useWhere", "canDoIt", "yanzhen"]),
|
},
|
watch: {
|
useWhere() {
|
// console.log(this.canDoIt, "canDoIt");
|
for (var k in this.data) {
|
if (this.useWhere == this.data[k].type) {
|
this.see = true;
|
this.type = this.data[k].type;
|
this.imgType = this.data[k].imgType;
|
this.htmls = this.data[k].datas.htmls;
|
this.apiName = this.data[k].datas.apiName;
|
this.name = this.data[k].menuName;
|
var d = this.data[k].datas.column;
|
|
//判断是否禁用按钮
|
for (var k in this.canDoIt) {
|
if (this.canDoIt[k].type == this.type) {
|
console.log(this.type + "-------" + this.canDoIt[k].opens);
|
this.opens = this.canDoIt[k].opens;
|
}
|
}
|
//是否禁用按钮
|
for (var k in d) {
|
d[k]["disabled"] = !this.opens;
|
}
|
this.option.column = d;
|
|
console.log("已选择type:" + this.useWhere + "--" + this.name);
|
this.convert();
|
}
|
}
|
if (this.useWhere == "close") {
|
this.tipover();
|
}
|
},
|
},
|
methods: {
|
convert: function () {
|
var caridid = this.$store.getters.userInfo.Id;
|
selectIn(this.apiName[2], caridid, this.type).then((res) => {
|
var d = res.data.data;
|
for (var k in d) {
|
this.obj0[k.toLowerCase()] = d[k];
|
}
|
});
|
},
|
tip0() {
|
this.forms = 2;
|
},
|
qx() {
|
this.tipover();
|
this.$store.commit("changeuseWhere", "close");
|
},
|
tip1up1() {
|
this.forms = 1;
|
},
|
tip1() {
|
//暂存申请
|
var d = {};
|
for (var k in this.obj0) {
|
for (var i in this.option.column) {
|
if (k == this.option.column[i].prop && k != "title0") {
|
d[k] = this.obj0[k];
|
}
|
}
|
}
|
console.log(d);
|
this.data0 = d;
|
this.data0.cardid = this.$store.getters.userInfo.Id;
|
this.data0.ptype = this.type;
|
adds(this.apiName[1], this.data0).then(() => {
|
this.qx();
|
this.$message({
|
message: "暂存申请成功",
|
type: "success",
|
});
|
});
|
},
|
aa(b) {
|
console.log(b);
|
},
|
up() {
|
//提交申请
|
var d = {};
|
for (var k in this.obj0) {
|
for (var i in this.option.column) {
|
if (k == this.option.column[i].prop && k != "title0") {
|
d[k] = this.obj0[k];
|
}
|
}
|
}
|
this.data0 = d;
|
this.data0.ptype = this.type;
|
this.data0.cardid = this.$store.getters.userInfo.Id;
|
|
// if (!this.tipover(1, this.data0)) {
|
// console.log("不通过");
|
// return;
|
// }
|
// console.log(this.tipover(1, this.data0));
|
// return;
|
add(this.apiName[0], this.data0).then(() => {
|
this.qx();
|
this.$message({
|
message: "提交申请成功",
|
type: "success",
|
});
|
this.$store.commit("changecanDoIt", false);
|
});
|
},
|
|
tipover(a, b) {
|
if (a == 1) {
|
console.log(b);
|
var number = false,
|
reg = /^[0-9]+.?[0-9]*$/;
|
for (var k in b) {
|
if (k == "creditcode") {
|
if (reg.test(b[k])) {
|
number = true;
|
} else {
|
number = false;
|
}
|
} else {
|
continue;
|
}
|
}
|
return number;
|
}
|
this.forms = 1;
|
this.obj0 = {
|
// title0: "保安单位基本信息",
|
};
|
var d = {};
|
this.data0 = d;
|
},
|
},
|
};
|
</script>
|
|
<style lang="scss">
|
</style>
|