Explorar el Código

质保卡申请记录tab

NULL1222 hace 2 días
padre
commit
5b5c128492

+ 105 - 0
src/bgj/workOrderManage/components/refuse.vue

@@ -0,0 +1,105 @@
+<template>
+  <div>
+    <el-button
+      slot="reference"
+      type="text"
+      size="mini"
+      @click="dialogTableVisible = true"
+      style="color: #f56c6c; margin-left: 10px"
+      >{{ $t("拒绝") }}</el-button
+    >
+    <el-dialog
+      :title="$t(`提示`)"
+      append-to-body
+      :visible.sync="dialogTableVisible"
+      width="500px"
+    >
+      <el-row :gutter="20">
+        <el-form
+          label-position="top"
+          ref="form"
+          :rules="rules"
+          inline
+          :label-width="tool.onlyZh('100px')"
+          :model="form"
+          size="small"
+        >
+          <el-col :span="24">
+            <el-form-item :label="$t(`拒绝原因`)" prop="reject_reason">
+              <el-input
+                v-model="form.reject_reason"
+                :placeholder="$t(`请填写`)"
+                style="width: 100%"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <div>
+          <el-button @click="dialogTableVisible = false" size="small">{{
+            $t("取 消")
+          }}</el-button>
+          <el-button type="primary" @click="submit" size="small">{{
+            $t("确 定")
+          }}</el-button>
+        </div>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      dialogTableVisible: false,
+      form: {
+        sc_workorderid: "",
+        sc_warrantycard_applyid: "",
+        reject_reason: "",
+        isAgreed: 0,
+      },
+      rules: {
+        reject_reason: [
+          {
+            required: true,
+            message: this.$t("请填写拒绝原因"),
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  props: ["sc_workorderid",'sc_warrantycard_applyid'],
+  methods: {
+    submit() {
+      this.$refs.form.validate(async (valid) => {
+        if (!valid) return false;
+        this.form.sc_workorderid = this.sc_workorderid;
+        this.form.sc_warrantycard_applyid = this.sc_warrantycard_applyid;
+        let res = await this.$api.requested({
+          id: 2026052910290102,
+          content: this.form,
+        });
+        this.tool.showMessage(res, () => {
+          this.$emit("refuseSuccess");
+          this.dialogTableVisible = false;
+        });
+      });
+    },
+  },
+  created() {},
+};
+</script>
+<style scoped>
+/deep/.el-form-item {
+  width: 100% !important;
+}
+/deep/.el-dialog__header {
+  border-bottom: 1px solid #dcdfe6;
+}
+/deep/.el-dialog__footer {
+  border-top: 1px solid #dcdfe6;
+}
+</style>

+ 194 - 0
src/bgj/workOrderManage/modules/applicationInfo.vue

@@ -0,0 +1,194 @@
+
+<template>
+  <div>
+    <div style="display: flex; align-items: center">
+      <el-input
+        :placeholder="$t('搜索')"
+        suffix-icon="el-icon-search"
+        v-model="params.content.where.condition"
+        style="width: 200px"
+        size="mini"
+        class="input-with-select inline-16"
+        @keyup.native.enter="listData((params.content.pageNumber = 1))"
+        @clear="clearData"
+        clearable
+      >
+      </el-input>
+      <slot name="addProduct"></slot>
+    </div>
+    <div style="margin-top: 15px">
+      <tableLayout
+        :layout="tablecols"
+        :data="list"
+        :opwidth="200"
+        :custom="true"
+        :width="false"
+        :height="tableHieght"
+        fixedName="operation"
+      >
+        <template v-slot:customcol="scope">
+          <div v-if="scope.column.columnname == 'apply_result'">
+            <span
+              :style="
+                scope.column.data.apply_result === '拒绝'
+                  ? 'color:#f56c6c'
+                  : 'color:#67c23a'
+              "
+              >{{ scope.column.data.apply_result }}</span
+            >
+          </div>
+          <div v-else>
+            {{
+              scope.column.columnname === "operation" ||
+              scope.column.data[scope.column.columnname]
+                ? scope.column.data[scope.column.columnname]
+                : "--"
+            }}
+          </div>
+        </template>
+        <template v-slot:opreation="scope">
+          <el-button
+            v-if="
+              tool.checkAuth($route.name, 'cardApproval') &&
+              scope.data.apply_result == ''
+            "
+            type="text"
+            @click="onAgree(scope.data)"
+            size="mini"
+            style="color: #67c23a"
+          >
+            {{ $t("同意") }}
+          </el-button>
+          <Refuse
+            v-if="
+              tool.checkAuth($route.name, 'cardApproval') &&
+              scope.data.apply_result == ''
+            "
+            class="inline-16"
+            :sc_workorderid="scope.data.sc_workorderid"
+            :sc_warrantycard_applyid="scope.data.sc_warrantycard_applyid"
+            @refuseSuccess="listData"
+          />
+        </template>
+      </tableLayout>
+    </div>
+    <div style="margin-top: 16px; text-align: right">
+      <el-pagination
+        background
+        small
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="params.content.pageNumber"
+        :page-size="params.content.pageSize"
+        layout="total, prev, pager, next, jumper"
+        :total="total"
+      >
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+import Refuse from "../components/refuse.vue";
+export default {
+  props: ["data"],
+  components: { Refuse },
+
+  data() {
+    return {
+      tableHieght: "calc(100vh - 380px)",
+      tablecols: [],
+      list: [],
+      total: 0,
+      params: {
+        id: 2026052911075602,
+        version: 1,
+        content: {
+          sc_workorderid: "",
+          pageNumber: 1,
+          pageSize: 20,
+          where: {
+            condition: "",
+          },
+        },
+      },
+      options: [],
+    };
+  },
+  methods: {
+    async listData() {
+      this.params.content.sc_workorderid = this.$route.query.id;
+      const res = await this.$api.requested(this.params);
+      this.list = res.data;
+      this.total = res.total;
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.params.content.pageSize = val;
+      this.listData();
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.params.content.pageNumber = val;
+      this.listData();
+    },
+    clearData() {
+      this.listData();
+    },
+    queryClick() {
+      this.listData();
+    },
+    onAgree(value) {
+      this.$confirm(
+        this.$t("是否同意该工单的质保卡申请") + "?",
+        this.$t("提示"),
+        {
+          confirmButtonText: this.$t("确定"),
+          cancelButtonText: this.$t("取消"),
+          type: "warning",
+          beforeClose: async (action, instance, done) => {
+            if (action === "confirm") {
+              instance.confirmButtonLoading = true;
+              try {
+                const res = await this.$api.requested({
+                  id: "2026052910290102",
+                  content: {
+                    sc_workorderid: value.sc_workorderid,
+                    sc_warrantycard_applyid: value.sc_warrantycard_applyid,
+                    isAgreed: 1,
+                  },
+                });
+                if (res.code !== 1) {
+                  this.$message.error(this.$t(res.msg));
+                  instance.confirmButtonLoading = false;
+                  return;
+                }
+                this.tool.showMessage(res, () => {
+                  setTimeout(() => {
+                    instance.confirmButtonLoading = false;
+                    done();
+                    this.listData();
+                  }, 500);
+                });
+              } catch (error) {
+                instance.confirmButtonLoading = false;
+              }
+            } else {
+              done();
+            }
+          },
+        }
+      ).catch(() => {});
+    },
+  },
+  created() {
+    this.listData();
+    console.log(this.$route.name);
+    this.tablecols = this.tool.tabelCol(
+      this.$route.name
+    ).applicationInfoTable.tablecols;
+  },
+};
+</script>
+<style scoped>
+</style>

+ 9 - 3
src/bgj/workOrderManage/modules/detail.vue

@@ -20,9 +20,10 @@
           v-if="
           v-if="
             mainData.status === '进行中' && tool.checkAuth($route.name, 'stop')
             mainData.status === '进行中' && tool.checkAuth($route.name, 'stop')
           "
           "
-          type="text"
           @click="onStop(mainData)"
           @click="onStop(mainData)"
           size="mini"
           size="mini"
+          type="primary"
+          style="margin-right: 10px"
         >
         >
           {{ $t(`暂 停`) }}
           {{ $t(`暂 停`) }}
         </el-button>
         </el-button>
@@ -30,9 +31,10 @@
           v-if="
           v-if="
             mainData.status === '暂停' && tool.checkAuth($route.name, 'turnOn')
             mainData.status === '暂停' && tool.checkAuth($route.name, 'turnOn')
           "
           "
-          type="text"
           @click="onTurnOn(mainData)"
           @click="onTurnOn(mainData)"
           size="mini"
           size="mini"
+          type="primary"
+          style="margin-right: 10px"
         >
         >
           {{ $t(`启 用`) }}
           {{ $t(`启 用`) }}
         </el-button>
         </el-button>
@@ -60,6 +62,9 @@
       <div slot="slot3">
       <div slot="slot3">
         <team :data="mainData"></team>
         <team :data="mainData"></team>
       </div>
       </div>
+      <div slot="slot4">
+        <applicationInfo :data="mainData"></applicationInfo>
+      </div>
     </basicDetails>
     </basicDetails>
   </div>
   </div>
 </template>
 </template>
@@ -70,6 +75,7 @@ import processInfo from "./processInfo/index";
 import Del from "../components/del";
 import Del from "../components/del";
 import material from "./material";
 import material from "./material";
 import team from "./team";
 import team from "./team";
+import applicationInfo from "./applicationInfo";
 export default {
 export default {
   name: "detail",
   name: "detail",
   data() {
   data() {
@@ -80,7 +86,7 @@ export default {
       btnLoading: false,
       btnLoading: false,
     };
     };
   },
   },
-  components: { BaseInfo, Del, processInfo, material, team },
+  components: { BaseInfo, Del, processInfo, material, team, applicationInfo },
   methods: {
   methods: {
     async queryMainData() {
     async queryMainData() {
       const res = await this.$api.requested({
       const res = await this.$api.requested({

+ 0 - 1
src/bgj/workOrderManage/modules/material.vue

@@ -107,7 +107,6 @@ export default {
       const res = await this.$api.requested(this.params);
       const res = await this.$api.requested(this.params);
       this.list = res.data;
       this.list = res.data;
       this.total = res.total;
       this.total = res.total;
-      console.log(this.list);
     },
     },
     handleSizeChange(val) {
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
       // console.log(`每页 ${val} 条`);