|
|
@@ -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>
|