123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503 |
- <template>
- <div class="filingDetail">
- <div class="filingDetail-main">
- <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
- <el-collapse-item :title="'报备单详情'" name="1">
- <show-data-table
- v-if="newTime !== ''"
- style="padding: -5px 0 10px 0"
- :sitem="sitem"
- :new-time="newTime"
- :columns="editColumns"
- >
- <template slot="annex">
- <div v-if="sitem" style="display: flex;align-items: center;">
- {{ getAnnexName() }}
- <el-button type="text" size="mini" style="margin-left:10px" @click="download">下载</el-button>
- </div>
- </template>
- <template slot="status">
- <el-tag
- :size="tablebtnSize"
- :type="
- (statusOptions.find((item) => item.value == sitem.status) || {}).type ||
- ''
- "
- v-text="
- (statusOptions.find((item) => item.value == sitem.status) || {})
- .label || '--'
- "
- />
- </template>
- <template slot="expect_service_proportion">
- <span>{{ sitem.expect_service_proportion }}%</span>
- </template>
- <template slot="service_proportion">
- <span>{{ sitem.service_proportion }}%</span>
- </template>
- <template slot="supplierName">
- <span>{{ sitem.supplierName }}</span>
- <el-popover placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>供应商编号:</span>
- <span>{{ sitem.supplierNo }}</span>
- </li>
- </ul>
- <i slot="reference" class="el-icon-warning-outline fr" />
- </el-popover>
- </template>
- <template slot="customerName">
- <span>{{ sitem.customerName }}</span>
- <el-popover placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>业务公司编号:</span>
- <span>{{ sitem.customerCode }}</span>
- </li>
- </ul>
- <i slot="reference" class="el-icon-warning-outline fr" />
- </el-popover>
- </template>
- <template slot="companyName">
- <span>{{ sitem.companyName }}</span>
- <el-popover v-if="sitem.companyCode" placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>企业客户编号:</span>
- <span>{{ sitem.companyCode }}</span>
- </li>
- </ul>
- <i slot="reference" class="el-icon-warning-outline fr" />
- </el-popover>
- </template>
- <template slot="is_determine_price">
- <el-tag
- :size="'mini'"
- v-text="
- (
- is_determine_price_options.find(
- (item) => item.id == sitem.is_determine_price + ''
- ) || {}
- ).label || '--'
- "
- />
- </template>
- </show-data-table>
- </el-collapse-item>
- <el-collapse-item title="商品信息" name="20">
- <show-data-table
- v-if="newTime !== ''"
- :new-time="newTime"
- :columns="coveColumns"
- :sitem="sitem"
- >
- <template slot="brand_name">
- <span>{{ sitem.brand_name }}</span>
- <el-popover placement="top" width="450" trigger="hover">
- <div>
- <p
- v-if="mapBrandColor[brandType].text"
- :style="`color:${mapBrandColor[brandType].color};font-size:16px;text-align:center;margin-bottom:${brandType === 'warning' || brandType === 'noStart' ? '10px' : '0px'}`"
- >{{mapBrandColor[brandType].text(sitem.brand_name)}}</p>
- <show-data-table
- v-if="brandType !== 'danger'"
- :columns="brandColumns"
- :sitem="{
- name:sitem.brand_name,
- ...brandData,
- }"
- >
- <template slot="long">
- {{
- String(brandData.long) === "1" ? "非长期" : "长期"
- }}
- </template>
- <template slot="brandTime">
- {{String(brandData.starttime)}} ~ {{String(brandData.long) === "0" ? "长期有效" : String(brandData.endtime)}}
- </template>
- <template slot="brandImage">
- <div
- v-if="brandData.brand_book"
- style="display:flex"
- class="hover"
- v-viewer
- >
- <img
- v-for="url in brandData.brand_book.split(',')"
- :key="url"
- :src="url"
- style="display: inline-block; width: 20px;height:20px;margin-left:5px"
- alt
- />
- </div>
- </template>
- </show-data-table>
- </div>
- <i
- slot="reference"
- class="el-icon-warning-outline fr"
- :style="`color:${mapBrandColor[brandType].color} !important;font-weight:500`"
- />
- </el-popover>
- </template>
- <template slot="good_name">
- <span>{{ sitem.good_name }}</span>
- <span v-for="(si, i) in sitem.specinfo" :key="si.spec_id + i">
- <span v-if="i !== 0">-</span>
- <span v-else>_</span>
- <span>{{ si.spec_name }}[{{ si.spec_value_name }}]</span>
- </span>
- <el-popover v-if="sitem.spuCode" placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>商品编号:</span>
- <span>{{ sitem.spuCode }}</span>
- </li>
- </ul>
- <i slot="reference" class="el-icon-warning-outline fr" />
- </el-popover>
- </template>
- <template slot="send_way">
- <span>{{ sitem.send_way === "1" ? "供应商包邮" : "公司自提" }}</span>
- </template>
- <template slot="good_type">
- <el-tag
- :size="'mini'"
- v-text="
- (options1.find((item) => item.id == sitem.good_type) || {}).name || '--'
- "
- />
- <span
- v-if="sitem.good_type === '1'"
- style="padding: 0 0 0 5px"
- >{{ sitem.moq }}起订/工期{{ sitem.customized }}天</span>
- </template>
- <template slot="supply_area">
- <el-tag
- :size="'mini'"
- v-text="
- (options6.find((item) => item.id === sitem.supply_area) || {}).name ||
- '--'
- "
- />
- </template>
- <template slot="pay_way">
- <el-tag
- :size="'mini'"
- v-text="
- (options13.find((item) => item.id == sitem.pay_way) || {}).name || '--'
- "
- />
- </template>
- <template slot="noble">
- <span v-if="sitem.noble_name">
- {{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
- sitem.noble_name
- }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
- sitem.is_gold_price === "0" ? "不" : ""
- }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
- sitem.config
- }}-{{ sitem.other_config }}
- </span>
- <span v-else>--</span>
- </template>
- <template slot="good_img">
- <img
- v-for="(si, sii) in sitem.good_img"
- :key="si + sii"
- v-viewer
- style="width: 23px; height: 23px; margin: 0 5px 0 0"
- class="fl"
- :src="si"
- alt
- >
- </template>
- </show-data-table>
- </el-collapse-item>
- </el-collapse>
- </div>
- </div>
- </template>
- <script>
- import asyncRequest from '@/apis/service/sellOut/filing'
- import resToken from '@/mixins/resToken'
- import { mapGetters } from 'vuex'
- import {
- editColumns,
- costArr,
- bargainingArr,
- options1,
- options2,
- options3,
- options4,
- options5,
- options6,
- options7,
- options8,
- options9,
- options10,
- options11,
- options13,
- statusOptions,
- coveColumns,
- is_determine_price_options
- } from '../config/columns'
- export default {
- name: 'FilingDetail',
- mixins: [resToken],
- computed: {
- ...mapGetters(['tablebtnSize', 'searchSize', 'size', 'private_field'])
- },
- data() {
- return {
- size: 'small',
- eaxmList: [],
- brandColumns: [
- {
- prop: "name",
- label: "品牌",
- span: 24
- },
- {
- prop: "long",
- label: "授权类型",
- span: 24,
- _slot_: "long"
- },
- {
- label: "授权图片",
- span: 24,
- _slot_: "brandImage"
- },
- {
- label: "授权时间",
- span: 24,
- _slot_: "brandTime"
- },
- {
- prop:'remark',
- label: "备注",
- span: 24,
- }
- ],
- costArr,
- bargainingArr,
- editColumns,
- options1,
- options2,
- options3,
- options4,
- options5,
- options6,
- options7,
- options8,
- options9,
- options10,
- options11,
- options13,
- statusOptions,
- is_determine_price_options,
- coveColumns,
- projectTabs: '1',
- activeNames: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '20'],
- newTime: '',
- loading: false,
- queryType: '',
- queryId: '',
- status: '',
- sitem: null,
- brandType: "info",
- mapBrandColor: {
- warning: {
- text: name => `供应商 '${name}' 的品牌授权已过期`,
- color: "#E6A23C"
- },
- noStart: {
- text: name => `供应商 '${name}' 的品牌授权未开始`,
- color: "#E6A23C"
- },
- danger: {
- text: name => `供应商没有 '${name}' 的品牌授权`,
- color: "#F56C6C"
- },
- info: {
- color: "#909399"
- }
- },
- orderItem: {},
- moneyDirItem: {},
- moneyItem: {},
- BossItem: {}
- }
- },
- mounted() {
- this.initForm()
- },
- methods: {
- download() {
- const { fill_url } = this.sitem
- const a = document.createElement('a')
- a.style.display = 'none'
- a.href = fill_url
- document.body.appendChild(a)
- a.click()
- document.body.removeChild(a)
- },
- getAnnexName() {
- const { fill_url } = this.sitem
- if (!fill_url) return ''
- const chunks = fill_url.split('/')
- const [name, suffix] = (chunks[chunks.length - 1] || '').split('.')
- if (name.length > 10) {
- return ([name[0], name[1], name[2], ' ... ', name[name.length - 2], name[name.length - 1]]).join('') + '.' + suffix
- }
- return name + '.' + suffix
- },
- async initForm() {
- const { id, type } = this.$route.query
- this.queryId = id
- this.queryType = type
- this.projectTabs = '1'
- this.loading = true
- await this.initData()
- this.loading = false
- },
- handleClick(row) {
- console.log(row)
- },
- async refresh() {
- this.routeReGoto('supplierFiling', {})
- },
- async initData() {
- this.loading = true
- const { code, message, data } = await asyncRequest.detail({
- id: this.queryId
- })
- this.eaxmList = []
- this.loading = false
- if (code === 0) {
- this.sitem = JSON.parse(JSON.stringify(data))
- const { cat_info } = this.sitem
- let cat = ''
- if (cat_info && cat_info.length > 0) {
- cat_info.forEach((e, i) => {
- cat += i === 0 ? e.name : '_' + e.name
- })
- }
- this.sitem.cat = cat
- const { status, wait_num, orderCode } = this.sitem
- this.status = status
- const { brand_id, supplierNo } = data;
- const result = await asyncRequest.keepqueryl({
- brand_id,
- gyscode: supplierNo
- });
- if (result.code === 0) {
- if (result.data.length === 0) {
- // 没有找到授权信息
- this.brandType = "danger";
- }
- this.brandData = result.data;
- const { endtime, starttime ,long } = this.brandData;
- const now = new Date();
- const start = new Date(starttime);
- if(start > now){
- this.brandType = "noStart"
- }
- if (String(long) === "1") {
- // 短期 查看授权是否过期
- const end = new Date(endtime);
- if (now > end) {
- // 过期
- this.brandType = "warning";
- }
- }
- }
- this.$emit('change-detail', data)
- this.$emit('change-status', status)
- this.$emit('change-num', wait_num)
- this.$emit('change-order-code', orderCode)
- this.getNewTime()
- } else if (code >= 100 && code <= 104) {
- await this.logout()
- } else {
- this.$message.warning(message)
- }
- },
- getNewTime() {
- this.newTime = new Date().valueOf()
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .filingDetail {
- position: relative;
- height: 100%;
- width: 100%;
- box-sizing: border-box;
- .filingDetail-main {
- position: relative;
- padding: 10px;
- height: 100%;
- width: 100%;
- }
- .filingDetail-title {
- border-top: 1px solid #ebeef5;
- span {
- height: 50px;
- line-height: 50px;
- font-family: "微软雅黑", sans-serif;
- font-weight: 400;
- font-style: normal;
- font-size: 16fpx;
- text-align: left;
- }
- }
- /deep/ .ddiv {
- border-top: 1px solid #dcdfe6;
- }
- /deep/ .dtitle {
- width: 40px;
- text-align: center;
- height: 100%;
- min-height: 100%;
- ul {
- padding: 12px 0 0 0;
- }
- }
- /deep/ .dmain {
- padding: 20px 0 0 0;
- width: calc(100% - 40px);
- border-left: 1px solid #dcdfe6;
- }
- }
- </style>
|