engin_examine.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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="16" 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.refEnginRecordNo }}</div>
  32. </el-col>
  33. <el-col :span="8" class="item">
  34. <div class="label">项目类别</div>
  35. <div class="value">{{ detailData.refProjectName }}</div>
  36. </el-col>
  37. <el-col :span="8" class="item">
  38. <div class="label">工程登录类型</div>
  39. <div class="value">{{ detailData.enginOrderType | enginTypeFilter }}</div>
  40. </el-col>
  41. <el-col :span="8" class="item">
  42. <div class="label">跨厂区编号</div>
  43. <div class="value">{{ detailData.refFactoryNo }}</div>
  44. </el-col>
  45. <el-col :span="8" class="item">
  46. <div class="label">使用单位</div>
  47. <div class="value">{{ detailData.refUseUnit }}</div>
  48. </el-col>
  49. <el-col :span="8" class="item">
  50. <div class="label">行业类别</div>
  51. <div class="value">{{ detailData.refTradeCategory }}</div>
  52. </el-col>
  53. <el-col :span="8" class="item">
  54. <div class="label">联系人</div>
  55. <div class="value">{{ detailData.refLinkman }}</div>
  56. </el-col>
  57. <el-col :span="8" class="item">
  58. <div class="label">固定电话</div>
  59. <div class="value">{{ detailData.refTel }}</div>
  60. </el-col>
  61. <el-col :span="8" class="item">
  62. <div class="label">移动电话</div>
  63. <div class="value">{{ detailData.refPhone }}</div>
  64. </el-col>
  65. <el-col :span="24" class="item" v-if="!isCustomer">
  66. <div class="label">文件编号</div>
  67. <div class="value">{{ detailData.fileNo }}</div>
  68. </el-col>
  69. <el-col :span="24" class="item">
  70. <div class="label">安装地址</div>
  71. <div class="value">{{ detailData.refInstallAddress }}</div>
  72. </el-col>
  73. <el-col :span="24" class="item">
  74. <div class="label">备注</div>
  75. <div class="value">{{ detailData.remark }}</div>
  76. </el-col>
  77. <el-col :span="24" class="item file">
  78. <div class="label">附件</div>
  79. <div class="value">
  80. <div class="file-list" v-if="detailData.fileUrl">
  81. <div class="file-item" v-for="item in detailData.salesOrderPictures">
  82. <el-image
  83. v-if="checkFileType(item.fileUrl) == 'image'"
  84. class="img"
  85. :src="imageURL + item.fileUrl"
  86. :preview-src-list="[imageURL + item.fileUrl]"
  87. ></el-image>
  88. <div v-else class="box2" @click="openLink(item.fileUrl)">
  89. <img src="@/assets/common/word.png" v-if="checkFileType(item.fileUrl) == 'word'" />
  90. <img src="@/assets/common/excel.png" v-if="checkFileType(item.fileUrl) == 'excel'" />
  91. <img src="@/assets/common/ppt.png" v-if="checkFileType(item.fileUrl) == 'ppt'" />
  92. <img src="@/assets/common/pdf.png" v-if="checkFileType(item.fileUrl) == 'pdf'" />
  93. <div class="name ellipsis-3">{{ item.fileName }}</div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </el-col>
  99. <el-col :span="6" class="item">
  100. <div class="label">制单人</div>
  101. <div class="value">{{ detailData.createBy }}</div>
  102. </el-col>
  103. <el-col :span="6" class="item">
  104. <div class="label">制单日期</div>
  105. <div class="value">{{ detailData.createTime }}</div>
  106. </el-col>
  107. <el-col :span="6" class="item">
  108. <div class="label">审核人</div>
  109. <div class="value">{{ detailData.approvalName }}</div>
  110. </el-col>
  111. <el-col :span="6" class="item">
  112. <div class="label">审核日期</div>
  113. <div class="value">{{ detailData.approvalTime }}</div>
  114. </el-col>
  115. <el-col :span="24" class="item">
  116. <div class="label">审批说明</div>
  117. <div class="value">{{ detailData.approvalRemark }}</div>
  118. </el-col>
  119. </el-row>
  120. </div>
  121. <div class="main-title">
  122. <div class="title">货品信息</div>
  123. </div>
  124. <div class="table" style="margin-top: 20px">
  125. <el-table
  126. :data="goodsList"
  127. element-loading-text="Loading"
  128. border
  129. fit
  130. highlight-current-row
  131. stripe
  132. max-height="400"
  133. >
  134. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  135. <el-table-column
  136. align="left"
  137. label="销售类型"
  138. prop="saleTypeName"
  139. min-width="100"
  140. show-overflow-tooltip
  141. ></el-table-column>
  142. <el-table-column
  143. align="left"
  144. label="订单日期"
  145. prop="theTime"
  146. min-width="160"
  147. show-overflow-tooltip
  148. ></el-table-column>
  149. <el-table-column
  150. align="left"
  151. label="销售订单号"
  152. prop="enginOrderNo"
  153. min-width="180"
  154. show-overflow-tooltip
  155. ></el-table-column>
  156. <el-table-column
  157. align="left"
  158. label="物料编码"
  159. prop="materialCode"
  160. min-width="120"
  161. show-overflow-tooltip
  162. ></el-table-column>
  163. <el-table-column
  164. align="left"
  165. label="产品编码"
  166. prop="materialOldNumber"
  167. min-width="120"
  168. show-overflow-tooltip
  169. ></el-table-column>
  170. <el-table-column
  171. align="left"
  172. label="产品名称"
  173. prop="materialName"
  174. min-width="160"
  175. show-overflow-tooltip
  176. ></el-table-column>
  177. <el-table-column
  178. align="left"
  179. label="规格型号"
  180. prop="specification"
  181. min-width="160"
  182. show-overflow-tooltip
  183. ></el-table-column>
  184. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  185. <template slot-scope="scope">
  186. {{ scope.row.price | numToFixed }}
  187. </template>
  188. </el-table-column>
  189. <el-table-column align="right" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
  190. <template slot-scope="scope">
  191. {{ scope.row.totalAmount | numToFixed }}
  192. </template>
  193. </el-table-column>
  194. <el-table-column
  195. align="right"
  196. label="申请数量"
  197. prop="refundableQty"
  198. min-width="100"
  199. show-overflow-tooltip
  200. ></el-table-column>
  201. <el-table-column align="right" label="审批数量" prop="approvalNumber" min-width="100" show-overflow-tooltip>
  202. <template slot-scope="scope">
  203. <el-input
  204. v-model="scope.row.approvalNumber"
  205. disabled
  206. size="small"
  207. type="number"
  208. @mousewheel.native.prevent
  209. ></el-input>
  210. </template>
  211. </el-table-column>
  212. <el-table-column align="left" label="表头备注" prop="headerRemark" min-width="160" show-overflow-tooltip>
  213. <template slot-scope="scope">
  214. <el-input v-model="scope.row.headerRemark" size="small"></el-input>
  215. </template>
  216. </el-table-column>
  217. <!-- <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column> -->
  218. <el-table-column align="left" label="表体备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip>
  219. <template slot-scope="scope">
  220. <el-input v-model="scope.row.invoiceRemark" size="small"></el-input>
  221. </template>
  222. </el-table-column>
  223. </el-table>
  224. </div>
  225. <div class="main-title">
  226. <div class="title">审批信息</div>
  227. </div>
  228. <div class="diy-table-1">
  229. <el-row :gutter="0">
  230. <el-col :span="12" class="item">
  231. <div class="label">审批人</div>
  232. <div class="value">{{ userName }}</div>
  233. </el-col>
  234. <el-col :span="12" class="item">
  235. <div class="label">审批日期</div>
  236. <div class="value">{{ getDate() }}</div>
  237. </el-col>
  238. <el-col :span="24" class="item">
  239. <div class="label">审批说明</div>
  240. <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入内容"></el-input></div>
  241. </el-col>
  242. </el-row>
  243. </div>
  244. <div class="page-footer">
  245. <div class="footer">
  246. <el-button type="primary" @click="clickSubmitForm('OK')">审批通过</el-button>
  247. <el-button type="warning" @click="clickSubmitForm('SAVE')">审批驳回</el-button>
  248. <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px">
  249. <el-button slot="reference">返回列表</el-button>
  250. </el-popconfirm>
  251. </div>
  252. </div>
  253. </div>
  254. </template>
  255. <script>
  256. import { getEnginDetail, examineEngin } from '@/api/supply/apply'
  257. export default {
  258. name: 'EnginExamine',
  259. componentName: 'EnginExamine',
  260. props: ['listItem'],
  261. filters: {
  262. statusFilter(val) {
  263. const statusList = [
  264. { label: '已保存', value: 'SAVE' },
  265. { label: '待审核', value: 'WAIT' },
  266. { label: '审核通过', value: 'OK' },
  267. // { label: '审核驳回', value: 'FAIL' },,
  268. { label: '已关闭', value: 'CLOSE' }
  269. ]
  270. let obj = statusList.find(o => o.value == val)
  271. return obj ? obj.label : ''
  272. },
  273. enginTypeFilter(val) {
  274. const MAP = {
  275. HOME: '家用',
  276. TRADE: '商用'
  277. }
  278. return MAP[val]
  279. }
  280. },
  281. data() {
  282. return {
  283. imageURL: this.$imageUrl,
  284. detailData: {},
  285. userName: JSON.parse(localStorage.getItem('supply_user')).nickName,
  286. goodsList: [],
  287. examineForm: {
  288. remark: ''
  289. },
  290. isCustomer: JSON.parse(localStorage.getItem('supply_user')).isCustomer
  291. }
  292. },
  293. created() {
  294. this.getDetail()
  295. },
  296. methods: {
  297. getDate() {
  298. var date = new Date()
  299. var seperator1 = '-'
  300. var year = date.getFullYear()
  301. var month = date.getMonth() + 1
  302. var strDate = date.getDate()
  303. if (month >= 1 && month <= 9) {
  304. month = '0' + month
  305. }
  306. if (strDate >= 0 && strDate <= 9) {
  307. strDate = '0' + strDate
  308. }
  309. var currentdate = year + seperator1 + month + seperator1 + strDate
  310. return currentdate
  311. },
  312. // 返回列表
  313. goBack() {
  314. this.$emit('backListFormDetail')
  315. },
  316. // 获取详情
  317. getDetail() {
  318. getEnginDetail({ id: this.listItem.id }).then(res => {
  319. this.detailData = res.data
  320. res.data.orders.forEach(item => {
  321. item.approvalNumber = item.refundableQty
  322. })
  323. this.goodsList = res.data.orders
  324. })
  325. },
  326. // 检查文件类型
  327. checkFileType(url) {
  328. if (!url) return ''
  329. const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
  330. if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
  331. return 'image'
  332. } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
  333. return 'word'
  334. } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
  335. return 'excel'
  336. } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
  337. return 'ppt'
  338. } else if (['pdf'].includes(fileSuffix)) {
  339. return 'pdf'
  340. } else {
  341. return ''
  342. }
  343. },
  344. // 打开链接
  345. openLink(url) {
  346. getFileUrl({ key: url }).then(res => {
  347. window.open(res.data)
  348. })
  349. },
  350. // 提交审批
  351. clickSubmitForm(val) {
  352. for (let i = 0; i < this.goodsList.length; i++) {
  353. // if(this.goodsList[i].approvalNumber === '') {
  354. // this.$errorMsg('请填写审批数量');
  355. // return;
  356. // }
  357. // if(this.goodsList[i].approvalNumber > this.goodsList[i].refundableQty) {
  358. // this.$errorMsg('审批数量不可大于申请数量');
  359. // return;
  360. // }
  361. }
  362. this.$confirm('此操作将审批订单, 是否继续?', '提示', {
  363. confirmButtonText: '确定',
  364. cancelButtonText: '取消',
  365. type: 'warning'
  366. })
  367. .then(() => {
  368. let params = {
  369. id: this.detailData.id,
  370. examineStatus: val,
  371. approvalRemark: this.examineForm.remark,
  372. orders: this.goodsList
  373. }
  374. examineEngin(params).then(res => {
  375. this.$emit('shuaxinlb')
  376. this.$successMsg()
  377. this.goBack()
  378. // this.$parent?.getList()
  379. })
  380. })
  381. .catch(() => {})
  382. }
  383. }
  384. }
  385. </script>
  386. <style scoped lang="scss">
  387. .detail-container {
  388. width: 100%;
  389. height: 100%;
  390. }
  391. .main-title {
  392. display: flex;
  393. justify-content: space-between;
  394. align-items: center;
  395. margin-top: 20px;
  396. height: 60px;
  397. border-bottom: 1px solid #dcdfe6;
  398. margin-bottom: 20px;
  399. .title {
  400. font-size: 16px;
  401. font-weight: 600;
  402. padding-left: 10px;
  403. }
  404. }
  405. </style>