apply_detail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <template>
  2. <div class="detail-container">
  3. <div v-show="!isShowPrint">
  4. <el-page-header @back="goBack" content="详情"></el-page-header>
  5. <div class="main-title">
  6. <div class="title">{{ orderTypeList[detailData.type - 1].label }}信息</div>
  7. </div>
  8. <div class="diy-table-1">
  9. <el-row>
  10. <el-col :span="8" class="item">
  11. <div class="label">发货申请单号</div>
  12. <div class="value">{{ detailData.id }}</div>
  13. </el-col>
  14. <el-col :span="8" class="item">
  15. <div class="label">申请日期</div>
  16. <div class="value">{{ detailData.createTime }}</div>
  17. </el-col>
  18. <el-col :span="8" class="item">
  19. <div class="label">单据状态</div>
  20. <div class="value">{{ detailData.examineStatus | statusFilter }}</div>
  21. </el-col>
  22. <el-col :span="8" class="item">
  23. <div class="label">经销商编号</div>
  24. <div class="value">{{ detailData.customerNumber }}</div>
  25. </el-col>
  26. <el-col :span="16" class="item">
  27. <div class="label">经销商名称</div>
  28. <div class="value">{{ detailData.customerName }}</div>
  29. </el-col>
  30. <el-col :span="24" class="item">
  31. <div class="label">仓库</div>
  32. <div class="value">{{ detailData.correspondName }}</div>
  33. </el-col>
  34. <!-- <el-col :span="16" class="item">
  35. <div class="label">文件编号</div>
  36. <div class="value">{{detailData.fileNo}}</div>
  37. </el-col> -->
  38. <el-col :span="24" class="item">
  39. <div class="label">备注</div>
  40. <div class="value">
  41. <!-- {{detailData.remark}} -->
  42. <el-input v-model="detailData.remark" placeholder="填写备注" clearable></el-input>
  43. </div>
  44. </el-col>
  45. <el-col :span="24" class="item file">
  46. <div class="label">附件</div>
  47. <div class="value">
  48. <div class="file-list" v-for="item in detailData.salesOrderPictures">
  49. <div class="file-item">
  50. <el-image
  51. v-if="checkFileType(item.fileUrl) == 'image'"
  52. class="img"
  53. :src="imageURL + item.fileUrl"
  54. :preview-src-list="[imageURL + item.fileUrl]"
  55. ></el-image>
  56. <div v-else class="box2" @click="openLink(item.fileUrl)">
  57. <img src="@/assets/common/word.png" v-if="checkFileType(item.fileUrl) == 'word'" />
  58. <img src="@/assets/common/excel.png" v-if="checkFileType(item.fileUrl) == 'excel'" />
  59. <img src="@/assets/common/ppt.png" v-if="checkFileType(item.fileUrl) == 'ppt'" />
  60. <img src="@/assets/common/pdf.png" v-if="checkFileType(item.fileUrl) == 'pdf'" />
  61. <div class="name ellipsis-3">{{ item.fileName }}</div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </el-col>
  67. <el-col :span="6" class="item">
  68. <div class="label">制单人</div>
  69. <div class="value">{{ detailData.createBy }}</div>
  70. </el-col>
  71. <el-col :span="6" class="item">
  72. <div class="label">制单日期</div>
  73. <div class="value">{{ detailData.createTime }}</div>
  74. </el-col>
  75. <el-col :span="6" class="item">
  76. <div class="label">审核人</div>
  77. <div class="value">{{ detailData.approvalName }}</div>
  78. </el-col>
  79. <el-col :span="6" class="item">
  80. <div class="label">审核日期</div>
  81. <div class="value">{{ detailData.approvalTime }}</div>
  82. </el-col>
  83. <el-col :span="24" class="item">
  84. <div class="label">审批说明</div>
  85. <div class="value">{{ detailData.approvalRemark }}</div>
  86. </el-col>
  87. </el-row>
  88. </div>
  89. <div class="main-title">
  90. <div class="title">货品信息</div>
  91. </div>
  92. <div class="table" style="margin-top: 20px">
  93. <el-table
  94. :data="detailData.orders"
  95. element-loading-text="Loading"
  96. border
  97. fit
  98. highlight-current-row
  99. stripe
  100. show-summary
  101. :summary-method="$getSummaries"
  102. >
  103. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  104. <el-table-column
  105. align="left"
  106. label="销售类型"
  107. prop="saleTypeName"
  108. min-width="100"
  109. show-overflow-tooltip
  110. ></el-table-column>
  111. <el-table-column
  112. align="left"
  113. label="销售订单号"
  114. prop="mainOrderId"
  115. min-width="120"
  116. show-overflow-tooltip
  117. ></el-table-column>
  118. <el-table-column
  119. align="left"
  120. label="物料编码"
  121. prop="materialCode"
  122. min-width="120"
  123. show-overflow-tooltip
  124. ></el-table-column>
  125. <el-table-column
  126. align="left"
  127. label="产品编码"
  128. prop="materialOldNumber"
  129. min-width="120"
  130. show-overflow-tooltip
  131. ></el-table-column>
  132. <el-table-column
  133. align="left"
  134. label="产品名称"
  135. prop="materialName"
  136. min-width="160"
  137. show-overflow-tooltip
  138. ></el-table-column>
  139. <el-table-column
  140. align="left"
  141. label="规格型号"
  142. prop="specification"
  143. min-width="350"
  144. show-overflow-tooltip
  145. ></el-table-column>
  146. <el-table-column
  147. align="left"
  148. label="单位"
  149. prop="unit"
  150. min-width="100"
  151. show-overflow-tooltip
  152. ></el-table-column>
  153. <el-table-column
  154. align="left"
  155. label="文件编号"
  156. prop="fileNo"
  157. min-width="100"
  158. show-overflow-tooltip
  159. ></el-table-column>
  160. <el-table-column align="right" label="含税单价" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
  161. <template slot-scope="scope">
  162. {{ scope.row.singlePayPrice | numToFixed }}
  163. </template>
  164. </el-table-column>
  165. <el-table-column align="right" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip>
  166. <template slot-scope="scope">
  167. {{ scope.row.payAmount | numToFixed }}
  168. </template>
  169. </el-table-column>
  170. <el-table-column align="right" label="返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
  171. <template slot-scope="scope">
  172. {{ scope.row.payRebateAmount | numToFixed }}
  173. </template>
  174. </el-table-column>
  175. <el-table-column align="right" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip>
  176. <template slot-scope="scope">
  177. {{ scope.row.totalDiscAmount | numToFixed }}
  178. </template>
  179. </el-table-column>
  180. <el-table-column
  181. align="right"
  182. label="销售政策名称"
  183. prop="policyTitle"
  184. min-width="100"
  185. show-overflow-tooltip
  186. ></el-table-column>
  187. <el-table-column
  188. align="right"
  189. label="申请数量"
  190. prop="invoiceNum"
  191. min-width="100"
  192. show-overflow-tooltip
  193. ></el-table-column>
  194. <el-table-column
  195. align="right"
  196. label="审批数量"
  197. prop="approvalNumber"
  198. min-width="100"
  199. show-overflow-tooltip
  200. ></el-table-column>
  201. <el-table-column
  202. align="right"
  203. label="已退数量"
  204. prop="retiredQty"
  205. min-width="100"
  206. show-overflow-tooltip
  207. v-if="detailData.type !== 2"
  208. ></el-table-column>
  209. <el-table-column
  210. align="left"
  211. label="表头备注"
  212. prop="headerRemark"
  213. min-width="160"
  214. show-overflow-tooltip
  215. ></el-table-column>
  216. <!-- <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column> -->
  217. <el-table-column
  218. align="left"
  219. label="表体备注"
  220. prop="invoiceRemark"
  221. min-width="160"
  222. show-overflow-tooltip
  223. ></el-table-column>
  224. <el-table-column
  225. align="left"
  226. label="业务员"
  227. prop="serviceName"
  228. min-width="100"
  229. show-overflow-tooltip
  230. ></el-table-column>
  231. <el-table-column
  232. align="left"
  233. label="表头业务员"
  234. prop="k3ServiceName"
  235. min-width="100"
  236. show-overflow-tooltip
  237. ></el-table-column>
  238. </el-table>
  239. </div>
  240. <div v-if="isExamine">
  241. <div class="main-title">
  242. <div class="title">审批记录</div>
  243. </div>
  244. <div class="diy-table-1">
  245. <el-row :gutter="0">
  246. <el-col :span="12" class="item">
  247. <div class="label">审批人</div>
  248. <div class="value">{{ detailData.approvalName }}</div>
  249. </el-col>
  250. <el-col :span="12" class="item">
  251. <div class="label">审批结果</div>
  252. <div class="value">{{ detailData.examineStatus | statusFilter }}</div>
  253. </el-col>
  254. <el-col :span="24" class="item">
  255. <div class="label">审批说明</div>
  256. <div class="value">{{ detailData.approvalRemark }}</div>
  257. </el-col>
  258. </el-row>
  259. </div>
  260. </div>
  261. <div class="page-footer">
  262. <div class="footer">
  263. <el-button
  264. type="primary"
  265. icon="el-icon-printer"
  266. @click="toPrint"
  267. :disabled="detailData.examineStatus !== 'OK'"
  268. v-if="$checkBtnRole('print', $route.meta.roles)"
  269. >打 印</el-button
  270. >
  271. <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px">
  272. <el-button slot="reference">返回列表</el-button>
  273. </el-popconfirm>
  274. </div>
  275. </div>
  276. </div>
  277. <print-preview ref="preView" />
  278. <!-- <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" /> -->
  279. </div>
  280. </template>
  281. <script>
  282. import print from '@/mixin/print'
  283. import printPreview from '@/views/supply/deliver/components/design/preview.vue'
  284. import { getApplyDetail } from '@/api/supply/apply'
  285. import { getFileUrl } from '@/api/common'
  286. import CommonPrint from '@/views/supply/deliver/components/common_print'
  287. export default {
  288. name: 'ApplyDetail',
  289. componentName: 'ApplyDetail',
  290. props: ['listItem'],
  291. components: {
  292. CommonPrint,
  293. printPreview
  294. },
  295. mixins: [print],
  296. filters: {
  297. statusFilter(val) {
  298. const statusList = [
  299. { label: '已保存', value: 'SAVE' },
  300. { label: '待审核', value: 'WAIT' },
  301. { label: '审核通过', value: 'OK' },
  302. // { label: '审核驳回', value: 'FAIL' },,
  303. { label: '已关闭', value: 'CLOSE' }
  304. ]
  305. let obj = statusList.find(o => o.value == val)
  306. return obj ? obj.label : ''
  307. }
  308. },
  309. data() {
  310. return {
  311. imageURL: this.$imageUrl,
  312. detailData: {},
  313. printType: 1,
  314. printId: '',
  315. isShowPrint: false,
  316. orderTypeList: [
  317. { label: '发货申请单', value: 1 },
  318. { label: '退货申请单', value: 2 },
  319. { label: '直调发货单', value: 3 }
  320. ]
  321. }
  322. },
  323. computed: {
  324. isExamine() {
  325. return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
  326. }
  327. },
  328. created() {
  329. this.getDetail()
  330. },
  331. mounted() {
  332. this.initPrint()
  333. },
  334. // activated(){
  335. // this.initPrint()
  336. // },
  337. methods: {
  338. // 返回列表
  339. goBack() {
  340. this.$emit('backListFormDetail')
  341. },
  342. // 获取详情
  343. getDetail() {
  344. getApplyDetail({ id: this.listItem.id }).then(res => {
  345. if (res.data.orders) {
  346. res.data.orders.forEach(item => {
  347. item.sums1 = ['invoiceNum', 'approvalNumber', 'retiredQty']
  348. item.sums2 = ['singlePayPrice', 'payAmount', 'payRebateAmount', 'totalDiscAmount']
  349. })
  350. }
  351. this.detailData = res.data
  352. })
  353. },
  354. // 检查文件类型
  355. checkFileType(url) {
  356. if (!url) return ''
  357. const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
  358. if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
  359. return 'image'
  360. } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
  361. return 'word'
  362. } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
  363. return 'excel'
  364. } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
  365. return 'ppt'
  366. } else if (['pdf'].includes(fileSuffix)) {
  367. return 'pdf'
  368. } else {
  369. return ''
  370. }
  371. },
  372. // 打开链接
  373. openLink(url) {
  374. getFileUrl({ key: url }).then(res => {
  375. window.open(res.data)
  376. })
  377. },
  378. // 点击打印
  379. toPrint() {
  380. this.printId = this.listItem.id
  381. // this.isShowPrint = true;
  382. this.getDateil(this.listItem.id, 'getDeliverDetail').then(res => {
  383. this.$endLoading()
  384. this.$refs.preView.show(this.hiprintTemplate, this.outputData)
  385. })
  386. },
  387. backDetail() {
  388. this.printId = ''
  389. this.isShowPrint = false
  390. }
  391. }
  392. }
  393. </script>
  394. <style scoped lang="scss">
  395. .detail-container {
  396. width: 100%;
  397. height: 100%;
  398. }
  399. .main-title {
  400. display: flex;
  401. justify-content: space-between;
  402. align-items: center;
  403. margin-top: 20px;
  404. height: 60px;
  405. border-bottom: 1px solid #dcdfe6;
  406. margin-bottom: 20px;
  407. .title {
  408. font-size: 16px;
  409. font-weight: 600;
  410. padding-left: 10px;
  411. }
  412. }
  413. </style>