main.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <div>
  3. <detailDatatable
  4. style="padding: 10px 0 5px 0"
  5. :newTime="newTime"
  6. v-if="sitem"
  7. :sitem="sitem"
  8. :columns="columns"
  9. >
  10. <template slot="status">
  11. <el-tag
  12. :size="'mini'"
  13. :type="sitem.status == '0' ? 'warning' : ''"
  14. v-text="
  15. (statusOptions.find((item) => item.id == sitem.status) || {})
  16. .label || '--'
  17. "
  18. ></el-tag>
  19. </template>
  20. <template slot="ocr_status">
  21. <el-tag
  22. :size="'mini'"
  23. :type="
  24. sitem.ocr_status == '0'
  25. ? 'info'
  26. : sitem.ocr_status == '1'
  27. ? 'primary'
  28. : sitem.ocr_status == '2'
  29. ? 'danger'
  30. : ''
  31. "
  32. v-text="
  33. (ocr_status.find((item) => item.id == sitem.ocr_status) || {})
  34. .label || '--'
  35. "
  36. ></el-tag>
  37. </template>
  38. <template slot="coop_state">
  39. <span
  40. v-text="
  41. (
  42. coop_stateoptions.find(
  43. (item) => item.value == sitem.coop_state
  44. ) || {}
  45. ).label || '--'
  46. "
  47. ></span>
  48. </template>
  49. <template slot="source">
  50. <span
  51. v-text="
  52. (
  53. sourceoptions.find(
  54. (item) => item.value == sitem.source
  55. ) || {}
  56. ).label || '--'
  57. "
  58. ></span>
  59. </template>
  60. <template slot="type">
  61. <span
  62. v-text="
  63. (
  64. typeoptions.find(
  65. (item) => item.value == sitem.type
  66. ) || {}
  67. ).label || '--'
  68. "
  69. ></span>
  70. </template>
  71. <template slot="category">
  72. <span
  73. v-text="
  74. (
  75. categoryoptions.find(
  76. (item) => item.value == sitem.category
  77. ) || {}
  78. ).label || '--'
  79. "
  80. ></span>
  81. </template>
  82. <template slot="delivery_way">
  83. <span
  84. v-text="
  85. (
  86. delivery_wayoptions.find(
  87. (item) => item.value == sitem.delivery_way
  88. ) || {}
  89. ).label || '--'
  90. "
  91. ></span>
  92. </template>
  93. <template slot="supplier_type">
  94. <span
  95. v-text="
  96. (
  97. supplier_typeoptions.find(
  98. (item) => item.value == sitem.supplier_type
  99. ) || {}
  100. ).label || '--'
  101. "
  102. ></span>
  103. </template>
  104. <template slot="level">
  105. <span
  106. v-text="
  107. (
  108. leveloptions.find(
  109. (item) => item.value == sitem.level
  110. ) || {}
  111. ).label || '--'
  112. "
  113. ></span>
  114. </template>
  115. <template slot="pay_type">
  116. <span
  117. v-text="
  118. (
  119. pay_typeoptions.find(
  120. (item) => item.value == sitem.pay_type
  121. ) || {}
  122. ).label || '--'
  123. "
  124. ></span>
  125. </template>
  126. <template slot="supplier_img">
  127. <img
  128. :src="sitem.supplier_img"
  129. class="avatar hover fl"
  130. v-viewer
  131. style="width:50px; height:50px"
  132. />
  133. </template>
  134. <template slot="prove_img">
  135. <img
  136. v-for="img in sitem.prove_img"
  137. :key="img"
  138. :src="img"
  139. class="avatar hover fl"
  140. v-viewer
  141. style="width:50px; height:50px"
  142. />
  143. </template>
  144. </detailDatatable>
  145. </div>
  146. </template>
  147. <script>
  148. import { columns } from "./columns";
  149. // import { cg_order_type_options } from "@/assets/js/statusList";
  150. import { xs_order_type_options } from "@/assets/js/statusList";
  151. //————————————————
  152. import mixinPage from "@/mixins/elPaginationHandle";
  153. import resToken from "@/mixins/resToken";
  154. import asyncRequest from "@/apis/service/serviceParam/supplier";
  155. import { mapGetters } from "vuex";
  156. import detailDatatable from "../detail-data-table";
  157. export default {
  158. mixins: [mixinPage, resToken],
  159. components:{
  160. detailDatatable
  161. },
  162. computed: {
  163. ...mapGetters(["tablebtnSize", "searchSize", "size", "private_field"]),
  164. powers() {
  165. let tran =
  166. this.$store.getters.btnList.find(
  167. (item) => item.menu_route == "standingBookDetail"
  168. ) || {};
  169. if (tran && tran.action && tran.action.length > 0) {
  170. return tran.action;
  171. } else {
  172. return [];
  173. }
  174. },
  175. },
  176. props: ["queryId"],
  177. data() {
  178. return {
  179. xs_order_type_options,
  180. // 状态
  181. statusOptions: [
  182. { id: "0", label: "禁用" },
  183. { id: "1", label: "启用" },
  184. ],
  185. ocr_status: [
  186. { id: "0", label: "未上传" },
  187. { id: "1", label: "识别成功" },
  188. { id: "2", label: "识别失败" },
  189. ],
  190. coop_stateoptions: [
  191. { value: "0", label: "白名单" },
  192. { value: "1", label: "黑名单" },
  193. ],
  194. sourceoptions: [
  195. { value: "0", label: "客户提供" },
  196. { value: "1", label: "供应商" },
  197. { value: "2", label: "公司开发" },
  198. ],
  199. typeoptions: [
  200. { value: "0", label: "正式供应商" },
  201. { value: "1", label: "临时供应商" },
  202. ],
  203. categoryoptions: [
  204. { value: "0", label: "单品类供应商" },
  205. { value: "1", label: "多品类供应商" },
  206. ],
  207. delivery_wayoptions: [
  208. { value: "0", label: "供应商发货" },
  209. { value: "1", label: "公司自提" },
  210. ],
  211. supplier_typeoptions: [
  212. { value: "0", label: "生产厂家" },
  213. { value: "1", label: "代理商" },
  214. { value: "2", label: "经销商" },
  215. { value: "3", label: "分销商" },
  216. { value: "4", label: "电商平台" },
  217. ],
  218. leveloptions: [
  219. { value: "2", label: "生产厂家" },
  220. { value: "0", label: "一级代理商" },
  221. { value: "1", label: "二级代理商" },
  222. ],
  223. pay_typeoptions: [
  224. { value: "0", label: "现结" },
  225. { value: "1", label: "月清" },
  226. { value: "2", label: "双月清" },
  227. ],
  228. ocr_status: [
  229. { id: "0", label: "未上传" },
  230. { id: "1", label: "识别成功" },
  231. { id: "2", label: "识别失败" },
  232. ],
  233. //——————————————————————
  234. columns,
  235. newTime: "",
  236. status: "",
  237. sitem: null,
  238. loading: false,
  239. };
  240. },
  241. mounted() {
  242. this.initData();
  243. },
  244. methods: {
  245. getNewTime() {
  246. this.newTime = new Date().valueOf();
  247. },
  248. async initData() {
  249. this.loading = true;
  250. const { code, message, data } = await asyncRequest.detail({
  251. id: this.queryId,
  252. });
  253. this.loading = false;
  254. if (code === 0) {
  255. this.sitem = JSON.parse(JSON.stringify(data));
  256. const { status } = this.sitem;
  257. this.status = status;
  258. this.getNewTime();
  259. } else if (code >= 100 && code <= 104) {
  260. await this.logout();
  261. } else {
  262. this.$message.warning(message);
  263. }
  264. },
  265. },
  266. };
  267. </script>
  268. <style lang="scss" scoped>
  269. /deep/ .label{
  270. // width: 120px !important;
  271. }
  272. </style>