apply_detail.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <div class="detail-container">
  3. <el-page-header @back="goBack" content="详情"></el-page-header>
  4. <div class="main-title">
  5. <div class="title">发货申请单信息</div>
  6. </div>
  7. <div class="diy-table-1">
  8. <el-row>
  9. <el-col :span="8" class="item">
  10. <div class="label">发货申请单号</div>
  11. <div class="value">{{detailData.id}}</div>
  12. </el-col>
  13. <el-col :span="8" class="item">
  14. <div class="label">申请日期</div>
  15. <div class="value">{{detailData.createTime}}</div>
  16. </el-col>
  17. <el-col :span="8" class="item">
  18. <div class="label">单据状态</div>
  19. <div class="value">{{detailData.examineStatus | statusFilter}}</div>
  20. </el-col>
  21. <el-col :span="8" class="item">
  22. <div class="label">经销商编号</div>
  23. <div class="value">{{detailData.customerNumber}}</div>
  24. </el-col>
  25. <el-col :span="8" class="item">
  26. <div class="label">经销商名称</div>
  27. <div class="value">{{detailData.customerName}}</div>
  28. </el-col>
  29. <el-col :span="8" class="item">
  30. <div class="label">仓库</div>
  31. <div class="value">{{detailData.correspondName}}</div>
  32. </el-col>
  33. <el-col :span="24" class="item">
  34. <div class="label">备注</div>
  35. <div class="value">{{detailData.remark}}</div>
  36. </el-col>
  37. <el-col :span="24" class="item file">
  38. <div class="label">附件</div>
  39. <div class="value">
  40. <div class="file-list" v-if="detailData.fileUrl">
  41. <div class="file-item">
  42. <el-image v-if="checkFileType(detailData.fileUrl) == 'image'" class="img" :src="imageURL + detailData.fileUrl" :preview-src-list="[imageURL + detailData.fileUrl]"></el-image>
  43. <div v-else class="box2" @click="openLink(detailData.fileUrl)">
  44. <img src="@/assets/common/word.png" v-if="checkFileType(detailData.fileUrl) == 'word'" />
  45. <img src="@/assets/common/excel.png" v-if="checkFileType(detailData.fileUrl) == 'excel'" />
  46. <img src="@/assets/common/ppt.png" v-if="checkFileType(detailData.fileUrl) == 'ppt'" />
  47. <img src="@/assets/common/pdf.png" v-if="checkFileType(detailData.fileUrl) == 'pdf'" />
  48. <div class="name ellipsis-3">{{ detailData.fileName }}</div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </el-col>
  54. <el-col :span="6" class="item">
  55. <div class="label">制单人</div>
  56. <div class="value">{{detailData.createBy}}</div>
  57. </el-col>
  58. <el-col :span="6" class="item">
  59. <div class="label">制单日期</div>
  60. <div class="value">{{detailData.createTime}}</div>
  61. </el-col>
  62. <el-col :span="6" class="item">
  63. <div class="label">审核人</div>
  64. <div class="value">{{detailData.approvalName}}</div>
  65. </el-col>
  66. <el-col :span="6" class="item">
  67. <div class="label">审核日期</div>
  68. <div class="value">{{detailData.approvalTime}}</div>
  69. </el-col>
  70. <el-col :span="24" class="item">
  71. <div class="label">审批说明</div>
  72. <div class="value">{{detailData.approvalRemark}}</div>
  73. </el-col>
  74. </el-row>
  75. </div>
  76. <div class="main-title">
  77. <div class="title">货品信息</div>
  78. </div>
  79. <div class="table" style="margin-top: 20px">
  80. <el-table :data="detailData.orders" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  81. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  82. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  83. <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
  84. <el-table-column align="center" label="产品编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
  85. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  86. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  87. <el-table-column align="center" label="计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  88. <el-table-column align="center" label="申请数量" prop="invoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
  89. <el-table-column align="center" label="审批数量" prop="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
  90. <el-table-column align="center" label="已退数量" prop="retiredQty" min-width="100" show-overflow-tooltip></el-table-column>
  91. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  92. </el-table>
  93. </div>
  94. <div v-if="isExamine">
  95. <div class="main-title">
  96. <div class="title">审批记录</div>
  97. </div>
  98. <div class="diy-table-1">
  99. <el-row :gutter="0">
  100. <el-col :span="12" class="item">
  101. <div class="label">审批人</div>
  102. <div class="value">{{detailData.approvalName}}</div>
  103. </el-col>
  104. <el-col :span="12" class="item">
  105. <div class="label">审批结果</div>
  106. <div class="value">{{detailData.examineStatus | statusFilter}}</div>
  107. </el-col>
  108. <el-col :span="24" class="item">
  109. <div class="label">审批说明</div>
  110. <div class="value">{{detailData.approvalRemark}}</div>
  111. </el-col>
  112. </el-row>
  113. </div>
  114. </div>
  115. <div class="page-footer">
  116. <div class="footer">
  117. <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
  118. <el-button slot="reference">关 闭</el-button>
  119. </el-popconfirm>
  120. </div>
  121. </div>
  122. </div>
  123. </template>
  124. <script>
  125. import { getApplyDetail } from "@/api/supply/apply";
  126. import { getFileUrl } from '@/api/common';
  127. export default {
  128. name: 'ApplyDetail',
  129. componentName: 'ApplyDetail',
  130. props: ['listItem'],
  131. filters: {
  132. statusFilter(val) {
  133. const statusList = [
  134. { label: '已保存', value: 'SAVE' },
  135. { label: '待审核', value: 'WAIT' },
  136. { label: '审核通过', value: 'OK' },
  137. { label: '审核驳回', value: 'FAIL' },
  138. { label: '已关闭', value: 'CLOSE' },
  139. ];
  140. let obj = statusList.find(o => o.value == val);
  141. return obj ? obj.label : ''
  142. }
  143. },
  144. data() {
  145. return {
  146. imageURL: this.$imageUrl,
  147. detailData: {},
  148. }
  149. },
  150. computed: {
  151. isExamine() {
  152. return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === "FAIL"
  153. },
  154. },
  155. created() {
  156. this.getDetail();
  157. },
  158. methods: {
  159. // 返回列表
  160. goBack() {
  161. this.$emit('backListFormDetail');
  162. },
  163. // 获取详情
  164. getDetail() {
  165. getApplyDetail({id: this.listItem.id}).then(res => {
  166. this.detailData = res.data;
  167. })
  168. },
  169. // 检查文件类型
  170. checkFileType(url) {
  171. if(!url) return '';
  172. const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
  173. if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
  174. return 'image';
  175. }else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
  176. return 'word';
  177. }else if(['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
  178. return 'excel';
  179. }else if(['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
  180. return 'ppt';
  181. }else if(['pdf'].includes(fileSuffix)) {
  182. return 'pdf';
  183. }else {
  184. return '';
  185. }
  186. },
  187. // 打开链接
  188. openLink(url) {
  189. getFileUrl({key: url}).then(res => {
  190. window.open(res.data);
  191. })
  192. },
  193. }
  194. }
  195. </script>
  196. <style scoped lang="scss">
  197. .detail-container {
  198. width: 100%;
  199. height: 100%;
  200. }
  201. .main-title {
  202. display: flex;
  203. justify-content: space-between;
  204. align-items: center;
  205. margin-top: 20px;
  206. height: 60px;
  207. border-bottom: 1px solid #DCDFE6;
  208. margin-bottom: 20px;
  209. .title {
  210. font-size: 16px;
  211. font-weight: 600;
  212. padding-left: 10px;
  213. }
  214. }
  215. </style>