engin_detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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">工程发货申请单信息</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="8" class="item">
  31. <div class="label">工程登录编号</div>
  32. <div class="value">{{detailData.refEnginRecordNo}}</div>
  33. </el-col>
  34. <el-col :span="8" class="item">
  35. <div class="label">工程项目名称</div>
  36. <div class="value">{{detailData.refProjectName}}</div>
  37. </el-col>
  38. <el-col :span="8" class="item">
  39. <div class="label">工程登录类型</div>
  40. <div class="value">{{detailData.enginOrderType | enginTypeFilter}}</div>
  41. </el-col>
  42. <el-col :span="8" class="item">
  43. <div class="label">厂工程编号</div>
  44. <div class="value">{{detailData.refFactoryNo}}</div>
  45. </el-col>
  46. <el-col :span="8" class="item">
  47. <div class="label">使用单位</div>
  48. <div class="value">{{detailData.refUseUnit}}</div>
  49. </el-col>
  50. <el-col :span="8" class="item">
  51. <div class="label"></div>
  52. <div class="value"></div>
  53. </el-col>
  54. <el-col :span="8" class="item">
  55. <div class="label">联系人</div>
  56. <div class="value">{{detailData.refLinkman}}</div>
  57. </el-col>
  58. <el-col :span="8" class="item">
  59. <div class="label">固定电话</div>
  60. <div class="value">{{detailData.refTel}}</div>
  61. </el-col>
  62. <el-col :span="8" class="item">
  63. <div class="label">移动电话</div>
  64. <div class="value">{{detailData.refPhone}}</div>
  65. </el-col>
  66. <el-col :span="24" class="item">
  67. <div class="label">安装地址</div>
  68. <div class="value">{{detailData.refInstallAddress}}</div>
  69. </el-col>
  70. <el-col :span="24" class="item">
  71. <div class="label">备注</div>
  72. <div class="value">{{detailData.remark}}</div>
  73. </el-col>
  74. <el-col :span="24" class="item file">
  75. <div class="label">附件</div>
  76. <div class="value">
  77. <div class="file-list" v-if="detailData.fileUrl">
  78. <div class="file-item">
  79. <el-image v-if="checkFileType(detailData.fileUrl) == 'image'" class="img" :src="imageURL + detailData.fileUrl" :preview-src-list="[imageURL + detailData.fileUrl]"></el-image>
  80. <div v-else class="box2" @click="openLink(detailData.fileUrl)">
  81. <img src="@/assets/common/word.png" v-if="checkFileType(detailData.fileUrl) == 'word'" />
  82. <img src="@/assets/common/excel.png" v-if="checkFileType(detailData.fileUrl) == 'excel'" />
  83. <img src="@/assets/common/ppt.png" v-if="checkFileType(detailData.fileUrl) == 'ppt'" />
  84. <img src="@/assets/common/pdf.png" v-if="checkFileType(detailData.fileUrl) == 'pdf'" />
  85. <div class="name ellipsis-3">{{ detailData.fileName }}</div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </el-col>
  91. <el-col :span="6" class="item">
  92. <div class="label">制单人</div>
  93. <div class="value">{{detailData.createBy}}</div>
  94. </el-col>
  95. <el-col :span="6" class="item">
  96. <div class="label">制单日期</div>
  97. <div class="value">{{detailData.createTime}}</div>
  98. </el-col>
  99. <el-col :span="6" class="item">
  100. <div class="label">审核人</div>
  101. <div class="value">{{detailData.approvalName}}</div>
  102. </el-col>
  103. <el-col :span="6" class="item">
  104. <div class="label">审核日期</div>
  105. <div class="value">{{detailData.approvalTime}}</div>
  106. </el-col>
  107. <el-col :span="24" class="item">
  108. <div class="label">审批说明</div>
  109. <div class="value">{{detailData.approvalRemark}}</div>
  110. </el-col>
  111. </el-row>
  112. </div>
  113. <div class="main-title">
  114. <div class="title">货品信息</div>
  115. </div>
  116. <div class="table" style="margin-top: 20px">
  117. <el-table
  118. :data="detailData.orders"
  119. element-loading-text="Loading"
  120. border
  121. fit
  122. highlight-current-row
  123. stripe
  124. show-summary
  125. :summary-method="$getSummaries">
  126. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  127. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  128. <el-table-column align="left" label="订单日期" prop="theTime" min-width="160" show-overflow-tooltip></el-table-column>
  129. <el-table-column align="left" label="销售订单号" prop="enginOrderNo" min-width="120" show-overflow-tooltip></el-table-column>
  130. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
  131. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
  132. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  133. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip></el-table-column>
  134. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  135. <el-table-column align="right" label="含税单价" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
  136. <template slot-scope="scope">
  137. {{scope.row.singlePayPrice | numToFixed}}
  138. </template>
  139. </el-table-column>
  140. <el-table-column align="right" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip>
  141. <template slot-scope="scope">
  142. {{scope.row.payAmount | numToFixed}}
  143. </template>
  144. </el-table-column>
  145. <el-table-column align="right" label="返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
  146. <template slot-scope="scope">
  147. {{scope.row.payRebateAmount | numToFixed}}
  148. </template>
  149. </el-table-column>
  150. <el-table-column align="right" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip>
  151. <template slot-scope="scope">
  152. {{scope.row.totalDiscAmount | numToFixed}}
  153. </template>
  154. </el-table-column>
  155. <el-table-column align="right" label="申请数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  156. <el-table-column align="right" label="审批数量" prop="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
  157. <el-table-column align="left" label="订单备注" prop="headerRemark" min-width="160" show-overflow-tooltip></el-table-column>
  158. <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  159. <el-table-column align="left" label="表体备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip></el-table-column>
  160. </el-table>
  161. </div>
  162. <div v-if="isExamine">
  163. <div class="main-title">
  164. <div class="title">审批记录</div>
  165. </div>
  166. <div class="diy-table-1">
  167. <el-row :gutter="0">
  168. <el-col :span="12" class="item">
  169. <div class="label">审批人</div>
  170. <div class="value">{{detailData.approvalName}}</div>
  171. </el-col>
  172. <el-col :span="12" class="item">
  173. <div class="label">审批结果</div>
  174. <div class="value">{{detailData.examineStatus | statusFilter}}</div>
  175. </el-col>
  176. <el-col :span="24" class="item">
  177. <div class="label">审批说明</div>
  178. <div class="value">{{detailData.approvalRemark}}</div>
  179. </el-col>
  180. </el-row>
  181. </div>
  182. </div>
  183. <div class="page-footer">
  184. <div class="footer">
  185. <el-button type="primary" icon="el-icon-printer" @click="toPrint" :disabled="detailData.examineStatus !== 'OK'">打 印</el-button>
  186. <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
  187. <el-button slot="reference">关 闭</el-button>
  188. </el-popconfirm>
  189. </div>
  190. </div>
  191. </div>
  192. <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" />
  193. </div>
  194. </template>
  195. <script>
  196. import { getEnginDetail } from "@/api/supply/apply";
  197. import { getFileUrl } from '@/api/common';
  198. import CommonPrint from "@/views/supply/deliver/components/common_print";
  199. export default {
  200. name: 'EnginDetail',
  201. componentName: 'EnginDetail',
  202. props: ['listItem'],
  203. components: {
  204. CommonPrint,
  205. },
  206. filters: {
  207. statusFilter(val) {
  208. const statusList = [
  209. { label: '已保存', value: 'SAVE' },
  210. { label: '待审核', value: 'WAIT' },
  211. { label: '审核通过', value: 'OK' },
  212. { label: '审核驳回', value: 'FAIL' },
  213. { label: '已关闭', value: 'CLOSE' },
  214. ];
  215. let obj = statusList.find(o => o.value == val);
  216. return obj ? obj.label : ''
  217. },
  218. enginTypeFilter(val) {
  219. const MAP = {
  220. HOME: '家用',
  221. TRADE: '商用',
  222. }
  223. return MAP[val];
  224. }
  225. },
  226. data() {
  227. return {
  228. imageURL: this.$imageUrl,
  229. detailData: {},
  230. printType: 1,
  231. printId: '',
  232. isShowPrint: false,
  233. }
  234. },
  235. computed: {
  236. isExamine() {
  237. return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === "FAIL"
  238. },
  239. },
  240. created() {
  241. this.getDetail();
  242. },
  243. methods: {
  244. // 返回列表
  245. goBack() {
  246. this.$emit('backListFormDetail');
  247. },
  248. // 获取详情
  249. getDetail() {
  250. getEnginDetail({id: this.listItem.id}).then(res => {
  251. if(res.data.orders) {
  252. res.data.orders.forEach(item => {
  253. item.sums1 = ['refundableQty', 'approvalNumber'];
  254. item.sums2 = ['singlePayPrice', 'payAmount', 'payRebateAmount', 'totalDiscAmount'];
  255. })
  256. }
  257. this.detailData = res.data;
  258. })
  259. },
  260. // 检查文件类型
  261. checkFileType(url) {
  262. if(!url) return '';
  263. const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
  264. if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
  265. return 'image';
  266. }else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
  267. return 'word';
  268. }else if(['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
  269. return 'excel';
  270. }else if(['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
  271. return 'ppt';
  272. }else if(['pdf'].includes(fileSuffix)) {
  273. return 'pdf';
  274. }else {
  275. return '';
  276. }
  277. },
  278. // 打开链接
  279. openLink(url) {
  280. getFileUrl({key: url}).then(res => {
  281. window.open(res.data);
  282. })
  283. },
  284. // 点击打印
  285. toPrint() {
  286. this.printId = this.listItem.id;
  287. this.isShowPrint = true;
  288. },
  289. backDetail() {
  290. this.printId = '';
  291. this.isShowPrint = false;
  292. },
  293. }
  294. }
  295. </script>
  296. <style scoped lang="scss">
  297. .detail-container {
  298. width: 100%;
  299. height: 100%;
  300. }
  301. .main-title {
  302. display: flex;
  303. justify-content: space-between;
  304. align-items: center;
  305. margin-top: 20px;
  306. height: 60px;
  307. border-bottom: 1px solid #DCDFE6;
  308. margin-bottom: 20px;
  309. .title {
  310. font-size: 16px;
  311. font-weight: 600;
  312. padding-left: 10px;
  313. }
  314. }
  315. </style>