123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <template>
- <el-dialog
- :title="'审批'"
- :close-on-click-modal="false"
- :before-close="closeDialog"
- :visible.sync="visible"
- :append-to-body="true"
- :modal="false"
- width="55%"
- >
- <el-form v-model="dataForm" :inline="true">
- <div class="form-group dialog">
- <el-form-item class="full" label="审批意见" prop="auditMsg">
- <el-input
- type="textarea"
- placeholder="审批意见"
- v-model="dataForm.auditMsg"
- ></el-input>
- </el-form-item>
- <el-form-item label="审批人" class="full" prop="auditUserId">
- <el-select
- v-model="dataForm.auditUserId"
- disabled
- placeholder="审批人"
- style="width: 100%"
- >
- <el-option
- v-for="item in optionsBranch"
- :key="item.userId"
- :label="item.userName"
- :value="item.userId"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item disabled label="审批日期">
- <el-date-picker
- v-model="dataForm.auditItem"
- size="large"
- type="date"
- value-format="timestamp"
- placeholder="审批日期"
- >
- </el-date-picker>
- </el-form-item>
- </div>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="closeDia">关闭</el-button>
- <el-button @click="approvalRejected" :loading="subLoading">审批驳回</el-button>
- <el-button @click="approved" :loading="subLoading">审批通过</el-button>
- </span>
- </el-dialog>
- </template>
- <script>
- import { listCharge, addMblno } from "@/api/system/startApproval";
- import { queryUserVal } from "@/api/warehouseBusiness/agreement";
- import Global from "@/layout/components/global";
- export default {
- name: "startApproval",
- data() {
- return {
- numData: {
- fId: null,
- fMblno: null,
- },
- dataForm: {
- id: null,
- actId: null,
- auditMsg: null,
- auditUserId: null,
- auditItem: null,
- refno3: null,
- },
- visible: false,
- optionsBranch: [],
- subLoading: false,
- };
- },
- components: {},
- methods: {
- // changefMblno(fId,fMblno){
- // console.log(fId,fMblno)
- // this.numData.fId = fId
- // this.numData.fMblno = fMblno
- // },
- init(id, status, actId, fMblno) {
- this.optionsBranch = [];
- // 默认录入人
- queryUserVal().then((response) => {
- this.dataForm.auditUserId = response.user.userId;
- this.optionsBranch.push(response.user);
- });
- this.visible = true;
- if (typeof id === "undefined" || typeof actId === "undefined") {
- this.$message.error("未检测到对应信息,请选择");
- return false;
- }
- this.dataForm.id = id;
- this.dataForm.billId = id;
- this.dataForm.actId = actId;
- this.dataForm.fidStatus = status;
- if (fMblno) {
- this.dataForm.refno3 = fMblno;
- }
- this.$set(this.dataForm, "auditItem", Date.parse(new Date()));
- },
- getTime() {
- var date = new Date(this.dataForm.auditItem);
- var y = date.getFullYear();
- var m =
- date.getMonth() + 1 < 10
- ? "0" + (date.getMonth() + 1)
- : date.getMonth() + 1;
- var d = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
- this.$set(this.dataForm, "auditItem", y + "-" + m + "-" + d);
- },
- approved() {
- this.$confirm(`是否通过审批?`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- this.getTime();
- this.subLoading = true;
- listCharge(this.dataForm, "/warehouse/paths/approved")
- .then((res) => {
- if (res.code) {
- this.$message({
- message: "审核通过",
- type: "success",
- duration: 600,
- });
- this.closeDia();
- this.visible = true;
- }
- })
- .finally(() => {
- this.subLoading = false;
- // this.closeDia();
- });
- return;
- })
- // .then((data) => {
- // console.log(data);
- // if (data && data.code == 200) {
- // this.$message({
- // message: "审核通过",
- // type: "success",
- // duration: 600,
- // });
- // this.closeDia();
- // this.visible = true;
- // // this.homePage()
- // } else {
- // this.$message.error(data.msg);
- // }
- // });
- },
- // homePage(){
- // let view = {
- // fullPath: "/finance/charge",
- // hash: "",
- // matched: Array(2),
- // meta: Object,
- // name: "Charge",
- // params: Object,
- // path: "/finance/charge",
- // query: Object,
- // title: "收费"
- // }
- // this.$router.push({ path: '/index'})
- // this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
- // if (this.isActive(view)) {
- // this.toLastView(visitedViews, view)
- // }
- // })
- // Global.$emit("removeCache", "closeSelectedTag", view);
- // },
- approvalRejected() {
- this.$confirm(`是否驳回审批?`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- this.dataForm.createTime = "";
- return listCharge(this.dataForm, "/warehouse/paths/approvalRejected");
- })
- .then((data) => {
- if (data && data.code == 200) {
- this.$message({
- message: "驳回审批",
- type: "success",
- duration: 600,
- // onClose: () => {
- // this.closeDia()
- // }
- });
- this.visible = true;
- this.closeDia();
- // this.homePage()
- } else {
- this.$message.error(data.msg);
- }
- });
- },
- closeDialog(done) {
- this.visible = false;
- this.$emit("returnApproval", this.dataForm.id, false);
- Object.assign(this.$data, this.$options.data.call(this));
- },
- closeDia() {
- this.visible = false;
- this.$emit("refreshDataList", this.dataForm.id, false);
- Object.assign(this.$data, this.$options.data.call(this));
- this.$router.push({path: "/morePage/stock"});
- },
- },
- };
- </script>
- <style scoped></style>
|