apply_examine.vue 13 KB

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