| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- <template>
- <div>
- <!-- <avue-form class="trading-form" :option="option" ref="form" v-model="form"> </avue-form>-->
- <div class="dialogButton" :style="{padding: batch ? '16px' : '4px'}">
- <el-button v-if="!batch" size="small" :loading="buttonLoading" @click="$emit('gotoRecord', false)">上一笔</el-button>
- <el-button v-if="!batch" size="small" :loading="buttonLoading" @click="$emit('gotoRecord', true)">下一笔</el-button>
- <el-button v-if="!batch" size="small" :loading="buttonLoading" @click="$emit('choceCheckFun', false)">关闭</el-button>
- <el-button type="primary" :loading="buttonLoading" size="small" @click="approved(1)">审批通过</el-button>
- <el-button type="warning" :loading="buttonLoading" size="small" @click="submit(2)">审批驳回</el-button>
- <el-input
- style="width: 16em;margin-left: 1em;margin-right: 1em;"
- v-model="form.auditMsg"
- size="small"
- autocomplete="off"
- clearable
- placeholder="审批意见"
- >
- </el-input>
- <el-button v-if="batch" size="small" :loading="buttonLoading" @click="$emit('choceCheckFun', false)">关闭</el-button>
- </div>
- <mail-component ref="mail" @choceCheckFun="$emit('choceCheckFun', true)"></mail-component>
- </div>
- </template>
- <script>
- import { approvePass, batchOperation } from "@/api/approveDataH/main";
- import { offset } from "@/api/basicData/salesOrder";
- import mailComponent from "./component/mail-component.vue";
- export default {
- components: {
- mailComponent
- },
- name: "check",
- props: {
- batch:{
- type: Boolean,
- deburred: true,
- },
- checkData: {
- type: Object
- },
- choceCheckFun: {
- type: Function
- },
- gotoRecord: {
- type: Function
- },
- checkDetail: {
- type: Boolean
- },
- idList: {
- type: Array
- },
- objMail: {
- type: Object
- },
- },
- data() {
- return {
- form: {},
- list: [],
- currencyDic: [],
- buttonLoading: false,
- corpId: "",
- option: {
- emptyBtn: false,
- submitBtn: false,
- labelWidth: 120,
- menuSpan: 8,
- column: [
- {
- label: "审批人",
- prop: "auditName",
- span: 24,
- disabled: true,
- rules: [
- {
- required: false,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "审批日期",
- prop: "auditOpTime",
- type: "datetime",
- span: 24,
- disabled: true,
- rules: [
- {
- required: false,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "审批意见",
- prop: "auditMsg",
- type: "textarea",
- rows: 5,
- span: 24,
- rules: [
- {
- required: false,
- message: " ",
- trigger: "blur"
- }
- ]
- }
- ]
- }
- };
- },
- created() {
- let date = new Date();
- let strDate =
- date.getFullYear() +
- "-" +
- (date.getMonth() + 1) +
- "-" +
- date.getDate() +
- " " +
- date.getHours() +
- ":" +
- date.getMinutes() +
- ":" +
- date.getSeconds();
- this.$set(this.form, "auditOpTime", strDate);
- this.$set(this.form, "auditName", this.$store.getters.userInfo.user_name);
- },
- methods: {
- approved(operate) {
- if (this.checkData.checkType == "FFSQ") {
- this.$refs.mail.openDialog(this.checkData,this.form,this.objMail)
- } else {
- this.submit(operate);
- }
- },
- submit(operate) {
- // this.$confirm("是否确认此操作!", "提示", {
- // confirmButtonText: "确认",
- // cancelButtonText: "取消",
- // type: "warning",
- // }).then(() => {
- let cacheRow = this.checkData
- // console.log('cacheRow', cacheRow);
- // this.$emit("choceCheckFun", false, cacheRow);
- //
- // return
- if(operate===1 && !this.form.auditMsg){
- this.form.auditMsg = '同意!'
- }
- this.checkData.operate = operate;
- if (this.idList.length !== 0) {
- //批量
- this.buttonLoading = true;
- batchOperation(this.idList.join(","), operate, this.form.auditMsg)
- .then(res => {
- if (res.data.success) {
- this.$message.success("操作成功!");
- this.$emit("operationType");
- }
- })
- .finally(() => {
- this.buttonLoading = false;
- });
- } else {
- //单个
- this.buttonLoading = true;
- this.checkData.auditName = this.form.auditName;
- this.checkData.auditMsg = this.form.auditMsg;
- this.checkData.auditOpTime = this.form.auditOpTime;
- if (this.checkData.checkType === "YPJ-XSJH" && operate === 1) {
- offset({ id: this.checkData.billId })
- .then(res => {
- if (res.data.data == "操作成功") {
- this.checkData = this.detailData.check;
- this.checkDialog = true;
- } else {
- this.$confirm(res.data.data, {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- approvePass(this.checkData)
- .then(res => {
- if (res.data.success) {
- this.$message.success("操作成功!");
- this.$emit("choceCheckFun", false, cacheRow);
- }
- if (!this.checkDetail) {
- //关闭付费申请页面
- let tag = this.$store.getters.tagList.filter(ele => ele.label === "付费申请")[0];
- this.$store.commit("DEL_TAG", tag);
- this.$store.commit("PQ_OUT_DETAIL");
- let tag1 = this.$store.getters.tagList.filter(ele => ele.label === "审批数据")[0];
- this.$store.commit("DEL_TAG", tag1);
- this.$router.push({
- path: "/approveDataH/index",
- });
- }
- })
- .finally(() => {
- this.buttonLoading = false;
- });
- })
- .catch(() => {
- this.buttonLoading = false;
- });
- }
- })
- .catch(() => {
- this.buttonLoading = false;
- });
- } else {
- approvePass(this.checkData)
- .then(res => {
- if (res.data.success) {
- this.$message.success("操作成功!");
- this.$emit("choceCheckFun", false, cacheRow);
- }
- if (!this.checkDetail) {
- //关闭付费申请页面
- let tag = this.$store.getters.tagList.filter(ele => ele.label === "付费申请")[0];
- this.$store.commit("DEL_TAG", tag);
- this.$store.commit("PQ_OUT_DETAIL");
- let tag1 = this.$store.getters.tagList.filter(ele => ele.label === "审批数据")[0];
- this.$store.commit("DEL_TAG", tag1);
- this.$router.push({
- path: "/approveDataH/index"
- });
- }
- })
- .finally(() => {
- this.buttonLoading = false;
- });
- }
- }
- // })
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .trading-form ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- </style>
|