|
@@ -0,0 +1,159 @@
|
|
|
+<template>
|
|
|
+ <div v-loading="loading" class="v1">
|
|
|
+ <div v-for="(item, index) in ticketList" :key="index">
|
|
|
+ <div class="flex_row">
|
|
|
+ <el-link
|
|
|
+ :underline="false"
|
|
|
+ type="primary"
|
|
|
+ @click="toWorkDetail(item)"
|
|
|
+ >{{ item.ticketNo }}</el-link
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div v-for="(item1, index1) in item.implementList" :key="index1">
|
|
|
+ <!-- <div class="flex_row">
|
|
|
+ <span>{{ item1.name }}</span>
|
|
|
+ </div> -->
|
|
|
+ <template v-for="(item2, index2) in item1.formFields[0]">
|
|
|
+ <div
|
|
|
+ v-if="item2.formType === 'table'"
|
|
|
+ :key="index2"
|
|
|
+ :column="2"
|
|
|
+ title=""
|
|
|
+ class="field-wrap"
|
|
|
+ style="width: 800px"
|
|
|
+ >
|
|
|
+ <div>{{ item1.name }}->{{ item2.cnName }}</div>
|
|
|
+ <Table
|
|
|
+ :ticketId="item.ticketId"
|
|
|
+ :values="item2.value"
|
|
|
+ :component="item2"
|
|
|
+ :tableExtendList="item2.tableExtendList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { implementProcessAPI } from "@/api/demand";
|
|
|
+import Table from "./StatusRecordsItem/table.vue";
|
|
|
+export default {
|
|
|
+ components: { Table },
|
|
|
+ props: {
|
|
|
+ tickets: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return [];
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ ticketList: [],
|
|
|
+ loading: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ watch: {
|
|
|
+ tickets: {
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {
|
|
|
+ if (val && val.length) {
|
|
|
+ this.getImplementList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ mounted() {},
|
|
|
+ methods: {
|
|
|
+ getImplementList() {
|
|
|
+ if (!this.tickets.length) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const requestList = [];
|
|
|
+ for (let i = 0; i < this.tickets.length; i++) {
|
|
|
+ const ticketId = this.tickets[i].ticketId;
|
|
|
+ requestList.push(
|
|
|
+ implementProcessAPI({
|
|
|
+ ticketId,
|
|
|
+ })
|
|
|
+ );
|
|
|
+ }
|
|
|
+ this.loading = true;
|
|
|
+ Promise.all(requestList)
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ for (let i = 0; i < res.length; i++) {
|
|
|
+ const element = this.tickets[i];
|
|
|
+ const item = res[i];
|
|
|
+ if (!item) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (item.code !== 0) {
|
|
|
+ this.$alert(item.msg, "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ });
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ const implementList = (item.data || [])
|
|
|
+ .filter((item1) => item1.isEnable === 1)
|
|
|
+ .map((item1) => {
|
|
|
+ return Object.assign(
|
|
|
+ {
|
|
|
+ name: item1.name,
|
|
|
+ processCode: item1.code,
|
|
|
+ isCanRectifyEdit: item1.isCanRectifyEdit,
|
|
|
+ },
|
|
|
+ item1.lastProcess || {
|
|
|
+ operatorName: item1.finishUserName,
|
|
|
+ createDate: item1.finishDate,
|
|
|
+ isFinish: item1.isFinish,
|
|
|
+ }
|
|
|
+ );
|
|
|
+ })
|
|
|
+ .filter((item1) => {
|
|
|
+ if (!item1.formFields) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ const formFields = item1.formFields.map((item2) => item2[0]);
|
|
|
+ const tabField = formFields.find(
|
|
|
+ (item2) => item2.formType === "table"
|
|
|
+ );
|
|
|
+ return Boolean(tabField);
|
|
|
+ });
|
|
|
+ if (implementList.length) {
|
|
|
+ this.ticketList.push({
|
|
|
+ ticketId: element.ticketId,
|
|
|
+ ticketNo: element.ticketNo,
|
|
|
+ implementList,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(this.ticketList);
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ toWorkDetail(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/demand/workDetail",
|
|
|
+ query: {
|
|
|
+ ticketId: row.ticketId,
|
|
|
+ title: row.ticketNo,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+.v1 {
|
|
|
+ padding: 10px 30px;
|
|
|
+ min-height: 100px;
|
|
|
+}
|
|
|
+</style>
|