baseDetail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. <template>
  2. <div class="filingDetail">
  3. <div class="filingDetail-main">
  4. <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
  5. <el-collapse-item :title="'报备单详情'" name="1">
  6. <show-data-table
  7. v-if="newTime !== ''"
  8. style="padding: -5px 0 10px 0"
  9. :sitem="sitem"
  10. :new-time="newTime"
  11. :columns="editColumns"
  12. >
  13. <template slot="annex">
  14. <div v-if="sitem" style="display: flex;align-items: center;">
  15. {{ getAnnexName() }}
  16. <el-button type="text" size="mini" style="margin-left:10px" @click="download">下载</el-button>
  17. </div>
  18. </template>
  19. <template slot="status">
  20. <el-tag
  21. :size="tablebtnSize"
  22. :type="
  23. (statusOptions.find((item) => item.value == sitem.status) || {}).type ||
  24. ''
  25. "
  26. v-text="
  27. (statusOptions.find((item) => item.value == sitem.status) || {})
  28. .label || '--'
  29. "
  30. />
  31. </template>
  32. <template slot="expect_service_proportion">
  33. <span>{{ sitem.expect_service_proportion }}%</span>
  34. </template>
  35. <template slot="service_proportion">
  36. <span>{{ sitem.service_proportion }}%</span>
  37. </template>
  38. <template slot="supplierName">
  39. <span>{{ sitem.supplierName }}</span>
  40. <el-popover placement="top" width="300" trigger="hover">
  41. <ul>
  42. <li>
  43. <span>供应商编号:</span>
  44. <span>{{ sitem.supplierNo }}</span>
  45. </li>
  46. </ul>
  47. <i slot="reference" class="el-icon-warning-outline fr" />
  48. </el-popover>
  49. </template>
  50. <template slot="customerName">
  51. <span>{{ sitem.customerName }}</span>
  52. <el-popover placement="top" width="300" trigger="hover">
  53. <ul>
  54. <li>
  55. <span>业务公司编号:</span>
  56. <span>{{ sitem.customerCode }}</span>
  57. </li>
  58. </ul>
  59. <i slot="reference" class="el-icon-warning-outline fr" />
  60. </el-popover>
  61. </template>
  62. <template slot="companyName">
  63. <span>{{ sitem.companyName }}</span>
  64. <el-popover v-if="sitem.companyCode" placement="top" width="300" trigger="hover">
  65. <ul>
  66. <li>
  67. <span>企业客户编号:</span>
  68. <span>{{ sitem.companyCode }}</span>
  69. </li>
  70. </ul>
  71. <i slot="reference" class="el-icon-warning-outline fr" />
  72. </el-popover>
  73. </template>
  74. <template slot="is_determine_price">
  75. <el-tag
  76. :size="'mini'"
  77. v-text="
  78. (
  79. is_determine_price_options.find(
  80. (item) => item.id == sitem.is_determine_price + ''
  81. ) || {}
  82. ).label || '--'
  83. "
  84. />
  85. </template>
  86. </show-data-table>
  87. </el-collapse-item>
  88. <el-collapse-item title="商品信息" name="20">
  89. <show-data-table
  90. v-if="newTime !== ''"
  91. :new-time="newTime"
  92. :columns="coveColumns"
  93. :sitem="sitem"
  94. >
  95. <template slot="brand_name">
  96. <span>{{ sitem.brand_name }}</span>
  97. <el-popover placement="top" width="450" trigger="hover">
  98. <div>
  99. <p
  100. v-if="mapBrandColor[brandType].text"
  101. :style="`color:${mapBrandColor[brandType].color};font-size:16px;text-align:center;margin-bottom:${brandType === 'warning' || brandType === 'noStart' ? '10px' : '0px'}`"
  102. >{{mapBrandColor[brandType].text(sitem.brand_name)}}</p>
  103. <show-data-table
  104. v-if="brandType !== 'danger'"
  105. :columns="brandColumns"
  106. :sitem="{
  107. name:sitem.brand_name,
  108. ...brandData,
  109. }"
  110. >
  111. <template slot="long">
  112. {{
  113. String(brandData.long) === "1" ? "非长期" : "长期"
  114. }}
  115. </template>
  116. <template slot="brandTime">
  117. {{String(brandData.starttime)}} ~ {{String(brandData.long) === "0" ? "长期有效" : String(brandData.endtime)}}
  118. </template>
  119. <template slot="brandImage">
  120. <div
  121. v-if="brandData.brand_book"
  122. style="display:flex"
  123. class="hover"
  124. v-viewer
  125. >
  126. <img
  127. v-for="url in brandData.brand_book.split(',')"
  128. :key="url"
  129. :src="url"
  130. style="display: inline-block; width: 20px;height:20px;margin-left:5px"
  131. alt
  132. />
  133. </div>
  134. </template>
  135. </show-data-table>
  136. </div>
  137. <i
  138. slot="reference"
  139. class="el-icon-warning-outline fr"
  140. :style="`color:${mapBrandColor[brandType].color} !important;font-weight:500`"
  141. />
  142. </el-popover>
  143. </template>
  144. <template slot="good_name">
  145. <span>{{ sitem.good_name }}</span>
  146. <span v-for="(si, i) in sitem.specinfo" :key="si.spec_id + i">
  147. <span v-if="i !== 0">-</span>
  148. <span v-else>_</span>
  149. <span>{{ si.spec_name }}[{{ si.spec_value_name }}]</span>
  150. </span>
  151. <el-popover v-if="sitem.spuCode" placement="top" width="300" trigger="hover">
  152. <ul>
  153. <li>
  154. <span>商品编号:</span>
  155. <span>{{ sitem.spuCode }}</span>
  156. </li>
  157. </ul>
  158. <i slot="reference" class="el-icon-warning-outline fr" />
  159. </el-popover>
  160. </template>
  161. <template slot="send_way">
  162. <span>{{ sitem.send_way === "1" ? "供应商包邮" : "公司自提" }}</span>
  163. </template>
  164. <template slot="good_type">
  165. <el-tag
  166. :size="'mini'"
  167. v-text="
  168. (options1.find((item) => item.id == sitem.good_type) || {}).name || '--'
  169. "
  170. />
  171. <span
  172. v-if="sitem.good_type === '1'"
  173. style="padding: 0 0 0 5px"
  174. >{{ sitem.moq }}起订/工期{{ sitem.customized }}天</span>
  175. </template>
  176. <template slot="supply_area">
  177. <el-tag
  178. :size="'mini'"
  179. v-text="
  180. (options6.find((item) => item.id === sitem.supply_area) || {}).name ||
  181. '--'
  182. "
  183. />
  184. </template>
  185. <template slot="pay_way">
  186. <el-tag
  187. :size="'mini'"
  188. v-text="
  189. (options13.find((item) => item.id == sitem.pay_way) || {}).name || '--'
  190. "
  191. />
  192. </template>
  193. <template slot="noble">
  194. <span v-if="sitem.noble_name">
  195. {{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
  196. sitem.noble_name
  197. }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
  198. sitem.is_gold_price === "0" ? "不" : ""
  199. }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
  200. sitem.config
  201. }}-{{ sitem.other_config }}
  202. </span>
  203. <span v-else>--</span>
  204. </template>
  205. <template slot="good_img">
  206. <img
  207. v-for="(si, sii) in sitem.good_img"
  208. :key="si + sii"
  209. v-viewer
  210. style="width: 23px; height: 23px; margin: 0 5px 0 0"
  211. class="fl"
  212. :src="si"
  213. alt
  214. >
  215. </template>
  216. </show-data-table>
  217. </el-collapse-item>
  218. </el-collapse>
  219. </div>
  220. </div>
  221. </template>
  222. <script>
  223. import asyncRequest from '@/apis/service/sellOut/filing'
  224. import resToken from '@/mixins/resToken'
  225. import { mapGetters } from 'vuex'
  226. import {
  227. editColumns,
  228. costArr,
  229. bargainingArr,
  230. options1,
  231. options2,
  232. options3,
  233. options4,
  234. options5,
  235. options6,
  236. options7,
  237. options8,
  238. options9,
  239. options10,
  240. options11,
  241. options13,
  242. statusOptions,
  243. coveColumns,
  244. is_determine_price_options
  245. } from '../config/columns'
  246. export default {
  247. name: 'FilingDetail',
  248. mixins: [resToken],
  249. computed: {
  250. ...mapGetters(['tablebtnSize', 'searchSize', 'size', 'private_field'])
  251. },
  252. data() {
  253. return {
  254. size: 'small',
  255. eaxmList: [],
  256. brandColumns: [
  257. {
  258. prop: "name",
  259. label: "品牌",
  260. span: 24
  261. },
  262. {
  263. prop: "long",
  264. label: "授权类型",
  265. span: 24,
  266. _slot_: "long"
  267. },
  268. {
  269. label: "授权图片",
  270. span: 24,
  271. _slot_: "brandImage"
  272. },
  273. {
  274. label: "授权时间",
  275. span: 24,
  276. _slot_: "brandTime"
  277. },
  278. {
  279. prop:'remark',
  280. label: "备注",
  281. span: 24,
  282. }
  283. ],
  284. costArr,
  285. bargainingArr,
  286. editColumns,
  287. options1,
  288. options2,
  289. options3,
  290. options4,
  291. options5,
  292. options6,
  293. options7,
  294. options8,
  295. options9,
  296. options10,
  297. options11,
  298. options13,
  299. statusOptions,
  300. is_determine_price_options,
  301. coveColumns,
  302. projectTabs: '1',
  303. activeNames: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '20'],
  304. newTime: '',
  305. loading: false,
  306. queryType: '',
  307. queryId: '',
  308. status: '',
  309. sitem: null,
  310. brandType: "info",
  311. mapBrandColor: {
  312. warning: {
  313. text: name => `供应商 '${name}' 的品牌授权已过期`,
  314. color: "#E6A23C"
  315. },
  316. noStart: {
  317. text: name => `供应商 '${name}' 的品牌授权未开始`,
  318. color: "#E6A23C"
  319. },
  320. danger: {
  321. text: name => `供应商没有 '${name}' 的品牌授权`,
  322. color: "#F56C6C"
  323. },
  324. info: {
  325. color: "#909399"
  326. }
  327. },
  328. orderItem: {},
  329. moneyDirItem: {},
  330. moneyItem: {},
  331. BossItem: {}
  332. }
  333. },
  334. mounted() {
  335. this.initForm()
  336. },
  337. methods: {
  338. download() {
  339. const { fill_url } = this.sitem
  340. const a = document.createElement('a')
  341. a.style.display = 'none'
  342. a.href = fill_url
  343. document.body.appendChild(a)
  344. a.click()
  345. document.body.removeChild(a)
  346. },
  347. getAnnexName() {
  348. const { fill_url } = this.sitem
  349. if (!fill_url) return ''
  350. const chunks = fill_url.split('/')
  351. const [name, suffix] = (chunks[chunks.length - 1] || '').split('.')
  352. if (name.length > 10) {
  353. return ([name[0], name[1], name[2], ' ... ', name[name.length - 2], name[name.length - 1]]).join('') + '.' + suffix
  354. }
  355. return name + '.' + suffix
  356. },
  357. async initForm() {
  358. const { id, type } = this.$route.query
  359. this.queryId = id
  360. this.queryType = type
  361. this.projectTabs = '1'
  362. this.loading = true
  363. await this.initData()
  364. this.loading = false
  365. },
  366. handleClick(row) {
  367. console.log(row)
  368. },
  369. async refresh() {
  370. this.routeReGoto('supplierFiling', {})
  371. },
  372. async initData() {
  373. this.loading = true
  374. const { code, message, data } = await asyncRequest.detail({
  375. id: this.queryId
  376. })
  377. this.eaxmList = []
  378. this.loading = false
  379. if (code === 0) {
  380. this.sitem = JSON.parse(JSON.stringify(data))
  381. const { cat_info } = this.sitem
  382. let cat = ''
  383. if (cat_info && cat_info.length > 0) {
  384. cat_info.forEach((e, i) => {
  385. cat += i === 0 ? e.name : '_' + e.name
  386. })
  387. }
  388. this.sitem.cat = cat
  389. const { status, wait_num, orderCode } = this.sitem
  390. this.status = status
  391. const { brand_id, supplierNo } = data;
  392. const result = await asyncRequest.keepqueryl({
  393. brand_id,
  394. gyscode: supplierNo
  395. });
  396. if (result.code === 0) {
  397. if (result.data.length === 0) {
  398. // 没有找到授权信息
  399. this.brandType = "danger";
  400. }
  401. this.brandData = result.data;
  402. const { endtime, starttime ,long } = this.brandData;
  403. const now = new Date();
  404. const start = new Date(starttime);
  405. if(start > now){
  406. this.brandType = "noStart"
  407. }
  408. if (String(long) === "1") {
  409. // 短期 查看授权是否过期
  410. const end = new Date(endtime);
  411. if (now > end) {
  412. // 过期
  413. this.brandType = "warning";
  414. }
  415. }
  416. }
  417. this.$emit('change-detail', data)
  418. this.$emit('change-status', status)
  419. this.$emit('change-num', wait_num)
  420. this.$emit('change-order-code', orderCode)
  421. this.getNewTime()
  422. } else if (code >= 100 && code <= 104) {
  423. await this.logout()
  424. } else {
  425. this.$message.warning(message)
  426. }
  427. },
  428. getNewTime() {
  429. this.newTime = new Date().valueOf()
  430. }
  431. }
  432. }
  433. </script>
  434. <style lang="scss" scoped>
  435. .filingDetail {
  436. position: relative;
  437. height: 100%;
  438. width: 100%;
  439. box-sizing: border-box;
  440. .filingDetail-main {
  441. position: relative;
  442. padding: 10px;
  443. height: 100%;
  444. width: 100%;
  445. }
  446. .filingDetail-title {
  447. border-top: 1px solid #ebeef5;
  448. span {
  449. height: 50px;
  450. line-height: 50px;
  451. font-family: "微软雅黑", sans-serif;
  452. font-weight: 400;
  453. font-style: normal;
  454. font-size: 16fpx;
  455. text-align: left;
  456. }
  457. }
  458. /deep/ .ddiv {
  459. border-top: 1px solid #dcdfe6;
  460. }
  461. /deep/ .dtitle {
  462. width: 40px;
  463. text-align: center;
  464. height: 100%;
  465. min-height: 100%;
  466. ul {
  467. padding: 12px 0 0 0;
  468. }
  469. }
  470. /deep/ .dmain {
  471. padding: 20px 0 0 0;
  472. width: calc(100% - 40px);
  473. border-left: 1px solid #dcdfe6;
  474. }
  475. }
  476. </style>