123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439 |
- <template>
- <div class="simple-container approvalExamination-container">
- <simple-form
- :form="table_form"
- :handle="table_handle"
- @search="handleSearch"
- @track="handleQueryTrack"
- @batch="handleBatch"
- @turn="handleReturn"
- >
- </simple-form>
- <simple-table
- :list="table_list"
- :config="table_config"
- :loading="table_loading"
- :handle-row="table_handle_row"
- @download="handleDownload"
- @selection="handleSelect"
- @back="handleBack"
- ></simple-table>
- <simple-pagination
- :page="page"
- :total="total"
- @change="handleChange"
- ></simple-pagination>
- <simple-dialog
- title="审批"
- width="40%"
- @cancel="handleVisible('opinion')"
- :visible="opinion_visible"
- >
- <el-form label-width="80px" :model="opinion_form" ref="opinion_ref">
- <el-form-item label="审批意见" prop="opinion">
- <el-input
- :rows="8"
- type="textarea"
- v-model="opinion_form.opinion"
- ></el-input>
- </el-form-item>
- </el-form>
- <template v-slot:footer>
- <div>
- <el-button v-if="!isAgree" @click="handleOpinion('1')" type="default"
- >退回修改</el-button
- >
- <el-button v-else @click="handleOpinion('0')" type="primary"
- >同意</el-button
- >
- </div>
- </template>
- </simple-dialog>
- <simple-dialog
- title="审批轨迹"
- :fullscreen="true"
- @cancel="handleVisible('track')"
- :visible="track_visible"
- >
- <simple-table
- :list="table_list_track"
- :config="table_config_track"
- :loading="table_loading_track"
- ></simple-table>
- <template v-slot:footer>
- <!-- <div>
- <el-button @click="handleVisible('track')" type="default"
- >退回修改</el-button
- >
- <el-button @click="handleConsent" type="primary">同意</el-button>
- </div> -->
- <el-button @click="handleConsent" type="primary">确定</el-button>
- </template>
- </simple-dialog>
- </div>
- </template>
- <script>
- import simpleForm from "../performance/components/form.vue";
- import simpleTable from "../performance/components/table.vue";
- import simpleDialog from "../performance/components/dialog.vue";
- import simplePagination from "../performance/components/pagination.vue";
- export default {
- components: {
- simpleForm,
- simpleDialog,
- simpleTable,
- simplePagination,
- },
- data() {
- return {
- // 审批意见
- opinion_visible: false,
- track_visible: false,
- opinion_form: {},
- status: "",
- isAgree: false,
- // 单条审批id
- ids: "",
- parentId: "",
- adoptIds: [],
- page: 1,
- rows: 10,
- total: 0,
- table_form: [
- {
- label: "公司名称",
- props: "companyName",
- type: "input",
- },
- {
- label: "状态",
- props: "sts",
- type: "select",
- // 0.待办 1.已办
- dictionary: [
- {
- label: "待办",
- value: "0",
- },
- {
- label: "已办",
- value: "1",
- },
- ],
- },
- ],
- table_loading: false,
- table_handle: [
- {
- label: "返回",
- props: "turn",
- },
- {
- label: "审批轨迹",
- props: "track",
- },
- {
- label: "批量审批",
- props: "batch",
- },
- ],
- // 列表数据
- table_list: [],
- // 表头配置
- table_config: [
- {
- label: "序号",
- props: "No",
- },
- {
- label: "公司名称",
- props: "companyName",
- },
- {
- label: "提出人",
- props: "proposer",
- },
- {
- label: "联系电话",
- props: "telephone",
- },
- {
- label: "网格划分需求",
- props: "wanggeText",
- },
- {
- label: "附件",
- props: "fileNames",
- type: "file",
- },
- {
- label: "状态",
- props: "sts",
- type: "dictionary",
- dictionary: { 0: "待办", 1: "已办" },
- },
- ],
- // 表格里的操作按钮
- table_handle_row: [
- {
- label: "不通过",
- props: "back",
- visible: { sts: [0] },
- },
- {},
- {},
- ],
- table_loading_track: false,
- // 审批轨迹内表数据
- table_list_track: [],
- // 审批轨迹内表头配置
- table_config_track: [
- {
- label: "编号",
- props: "No",
- },
- {
- label: "流程环节",
- props: "taskName",
- },
- {
- label: "处理人",
- props: "opName",
- },
- {
- label: "处理工号",
- props: "opNo",
- },
- {
- label: "处理时间",
- props: "opTime",
- },
- {
- label: "审批意见",
- props: "remark",
- // type: "dictionary",
- // dictionary: { 0: "同意", 1: "不同意" },
- },
- ],
- };
- },
- watch: {
- parentId() {
- this.status = this.$route.query.status;
- this.handleInit();
- },
- },
- created() {
- this.parentId = this.$route.query.parentId;
- },
- methods: {
- // 表格数据初始化
- handleInit() {
- this.table_loading = true;
- let reqdata = {
- ...this.table_search,
- type: "2",
- page: this.page,
- parentId: this.parentId,
- pageSize: this.rows,
- };
- this.$http({
- url: "/market/mkWangge/queryPage",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: reqdata,
- }).then(({ data: { count, data } }) => {
- this.table_loading = false;
- this.total = count;
- this.table_list = data
- ? data.map((element, index) => ({
- ...element,
- No: index + 1,
- sts: Number(this.status),
- }))
- : [];
- this.table_list && this.table_list[0].sts === 0
- ? (this.table_handle = [
- {
- label: "返回",
- props: "turn",
- },
- {
- label: "审批轨迹",
- props: "track",
- },
- {
- label: "批量审批",
- props: "batch",
- },
- ])
- : (this.table_handle = [
- {
- label: "返回",
- props: "turn",
- },
- {
- label: "审批轨迹",
- props: "track",
- },
- ]);
- data.forEach((item) => {
- this.adoptIds.push(item.id.toString());
- });
- // console.log(this.table_list,'table_list');
- // console.log(this.adoptIds);
- });
- },
- // 搜索事件
- handleSearch(data) {
- this.table_search = data;
- this.page = 1;
- this.handleInit();
- },
- // 翻页
- handleChange(page) {
- this.page = page;
- this.handleInit();
- },
- handleDownload(data) {
- console.log(data, "data");
- },
- handleVisible(props) {
- switch (props) {
- case "opinion":
- this.opinion_visible = !this.opinion_visible;
- this.isAgree = false;
- this.opinion_form = {};
- break;
- case "track":
- this.track_visible = !this.track_visible;
- break;
- case "batch":
- this.opinion_visible = !this.opinion_visible;
- this.isAgree = true;
- break;
- }
- },
- // 查询审批轨迹
- handleQueryTrack() {
- // let type = this.parentId === null ? "1" : "0";
- this.$http({
- url: "/market/mkWangge/getMkWanggeById",
- method: "get",
- headers: {
- "Content-Type": "application/json",
- },
- params: {
- id: this.parentId,
- type: 0,
- },
- }).then(({ data }) => {
- let body = data.body;
- console.log(body, "body");
- // this.ids = [body.id.toString()];
- this.table_list_track = body.bpmTaskList.map((item, index) => ({
- ...item,
- No: index + 1,
- }));
- });
- this.handleVisible("track");
- },
- // 批量审批
- handleBatch() {
- this.handleVisible("batch");
- },
- handleSelect(val) {
- console.log(val);
- },
- // 审批不通过
- handleBack(row) {
- // console.log(row);
- this.ids = row.id.toString();
- this.handleVisible("opinion");
- this.isAgree = false;
- },
- // 审批意见提交
- handleOpinion(type) {
- let reqdata = {};
- if (type === "1") {
- // 批量退回
- reqdata = {
- parentId: this.parentId,
- mkWanggeList: [
- {
- id: this.ids,
- remark: this.opinion_form.opinion,
- },
- ],
- };
- console.log(reqdata);
- this.$http({
- url: "/market/mkWangge/backList",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- ...reqdata,
- },
- }).then((res) => {
- console.log(res);
- this.handleInit();
- });
- } else {
- // 批量审批(多条)
- reqdata = {
- adoptIds: this.adoptIds,
- remark: this.opinion_form.opinion,
- parentId: this.parentId,
- type: type,
- };
- console.log(reqdata);
- this.$http({
- url: "/market/mkWangge/reviewMore",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- ...reqdata,
- },
- }).then((res) => {
- console.log(res);
- this.status = 1;
- this.handleInit();
- });
- }
- this.handleVisible("opinion");
- },
- handleReturn() {
- this.$router.go(-1);
- },
- // 审批轨迹--确定关闭模态框
- handleConsent() {
- this.handleVisible("track");
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .approvalExamination-container {
- background: #ffffff;
- padding: 0 20px;
- padding-top: 20px;
- margin: 15px;
- overflow: auto;
- width: calc(100% - 30px);
- max-width: calc(100% - 30px);
- height: 100%;
- overflow-x: hidden;
- }
- ::v-deep .el-row {
- padding-bottom: 12px;
- }
- </style>
|