123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <template>
- <div>
-
- <show-data-table
- :newTime="newTime"
- v-if="newTime !== '' && sitem"
- :sitem="sitem"
- :columns="columns"
- >
- <template slot="status">
- <el-tag
- :size="'mini'"
- :type="sitem.status == '0' ? 'warning' : ''"
- v-text="
- (statusOptions.find((item) => item.id === sitem.status) || {})
- .label || '--'
- "
- ></el-tag>
- </template>
- <template slot="order_type">
- <el-tag
- :size="'mini'"
- v-text="
- (
- cg_order_type_options.find(
- (item) => item.id === sitem.order_type
- ) || {}
- ).label || '--'
- "
- ></el-tag>
- </template>
- <template slot="diff_is_act">
- <el-tag
- :size="'mini'"
- v-text="
- (
- is_act_options.find((item) => item.value === sitem.diff_is_act) ||
- {}
- ).label || '--'
- "
- ></el-tag>
- </template>
- <template slot="diff_customer_remark">
- <el-tag
- :size="'mini'"
- v-if="sitem.diff_is_act === '1'"
- v-text="
- (
- customer_remark_options.find(
- (item) => item.value === sitem.diff_customer_remark
- ) || {}
- ).label || '--'
- "
- ></el-tag>
- <el-tag :size="'mini'" v-else v-text="'--'"></el-tag>
- </template>
- </show-data-table>
- </div>
- </template>
- <script>
- import { columns, statusOptions } from "./columns";
- import { cg_order_type_options } from "@/assets/js/statusList";
- //————————————————
- import mixinPage from "@/mixins/elPaginationHandle";
- import resToken from "@/mixins/resToken";
- import asyncRequest from "@/apis/service/purchaseIn/purchaseDiffOrder";
- export default {
- mixins: [mixinPage, resToken],
- props: ["queryId"],
- data() {
- return {
- cg_order_type_options,
- statusOptions,
- status: "",
- orderCode:"",
- customer_remark_options: [
- {
- value: "1",
- label: "竞价订单减工差",
- },
- {
- value: "2",
- label: "竞价订单不减工差",
- },
- ],
- is_act_options: [
- {
- value: "1",
- label: "接受工差",
- },
- {
- value: "2",
- label: "不接受工差-退回重做",
- },
- ],
- //——————————————————————
- columns,
- newTime: "",
- sitem: null,
- loading: false,
- };
- },
- mounted() {
- this.initData();
- },
- methods: {
- getNewTime() {
- this.newTime = new Date().valueOf();
- },
- async initData() {
- this.loading = true;
- const res = await asyncRequest.detail({ id: this.queryId });
- if (res && res.code === 0 && res.data) {
- this.sitem = res.data;
- const { can, status, cgdNo } = this.sitem;
- this.status = status;
- this.orderCode = cgdNo;
- if (can && can.length > 0) {
- this.sitem.class_cat = "";
- can.forEach((x, i) => {
- this.sitem.class_cat += i === 0 ? x.name : "/" + x.name;
- });
- }
- this.getNewTime();
- // if (this.order_type === "2") {
- // this.order_type = res.data.cgdNo;
- // this.statusOptions.unshift({ value: "0", label: "竞价单" });
- // }
- // this.order_type === "1" ? "CGGCD" : "ZXGCD";
- // this.order_type = res.data.order_type;
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(res.message);
- }
- this.loading = false;
- },
- },
- };
- </script>
- <style>
- </style>
|