sales_examine.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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 :gutter="0">
  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.orderTime }}</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.orderNo }}</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">
  36. <el-input v-model="detailData.remark" placeholder="请输入备注"></el-input>
  37. </div>
  38. </el-col>
  39. <el-col :span="24" class="item file" style="width: 100%; height: auto">
  40. <div class="label">附件</div>
  41. <div class="value">
  42. <div class="file-list">
  43. <div class="file-item" v-for="item in detailData.salesOrderPictures">
  44. <el-image
  45. v-if="checkFileType(item.fileUrl) == 'image'"
  46. class="img"
  47. :src="$imageUrl + item.fileUrl"
  48. :preview-src-list="[$imageUrl + item.fileUrl]"
  49. ></el-image>
  50. <div v-else class="box2" @click="openLink(item.fileUrl)">
  51. <img src="@/assets/common/word.png" v-if="checkFileType(item.fileUrl) == 'word'" />
  52. <img src="@/assets/common/excel.png" v-if="checkFileType(item.fileUrl) == 'excel'" />
  53. <img src="@/assets/common/ppt.png" v-if="checkFileType(item.fileUrl) == 'ppt'" />
  54. <img src="@/assets/common/pdf.png" v-if="checkFileType(item.fileUrl) == 'pdf'" />
  55. <div class="name ellipsis-3">{{ item.fileName }}</div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </el-col>
  61. </el-row>
  62. </div>
  63. <div class="main-title">
  64. <div class="title">货品信息</div>
  65. </div>
  66. <div class="table">
  67. <el-table
  68. :data="detailData.saleOrderData"
  69. element-loading-text="Loading"
  70. border
  71. fit
  72. highlight-current-row
  73. stripe
  74. max-height="400"
  75. show-summary
  76. :summary-method="$getSummaries"
  77. >
  78. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  79. <el-table-column
  80. align="center"
  81. label="物料编码"
  82. prop="materialCode"
  83. min-width="120"
  84. show-overflow-tooltip
  85. ></el-table-column>
  86. <el-table-column
  87. align="center"
  88. label="产品编码"
  89. prop="materialOldNumber"
  90. min-width="120"
  91. show-overflow-tooltip
  92. ></el-table-column>
  93. <el-table-column
  94. align="center"
  95. label="产品名称"
  96. prop="materialName"
  97. min-width="160"
  98. show-overflow-tooltip
  99. ></el-table-column>
  100. <el-table-column
  101. align="center"
  102. label="规格型号"
  103. prop="specification"
  104. min-width="160"
  105. show-overflow-tooltip
  106. ></el-table-column>
  107. <el-table-column
  108. align="center"
  109. label="单位"
  110. prop="unit"
  111. min-width="100"
  112. show-overflow-tooltip
  113. ></el-table-column>
  114. <el-table-column
  115. align="right"
  116. label="数量"
  117. prop="refundableQty"
  118. min-width="100"
  119. show-overflow-tooltip
  120. ></el-table-column>
  121. <!-- <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  122. <template slot-scope="scope">
  123. {{ scope.row.price | numToFixed }}
  124. </template>
  125. </el-table-column>
  126. <el-table-column align="right" label="订单金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  127. <template slot-scope="scope">
  128. {{ scope.row.payAmount | numToFixed }}
  129. </template>
  130. </el-table-column> -->
  131. </el-table>
  132. </div>
  133. <div class="main-title">
  134. <div class="title">审批记录</div>
  135. </div>
  136. <div class="diy-table-1">
  137. <el-row :gutter="0">
  138. <el-col :span="12" class="item">
  139. <div class="label">审批人</div>
  140. <div class="value">{{ userName }}</div>
  141. </el-col>
  142. <el-col :span="12" class="item">
  143. <div class="label">审批日期</div>
  144. <div class="value">{{ getDate() }}</div>
  145. </el-col>
  146. <el-col :span="24" class="item">
  147. <div class="label">制单人</div>
  148. <div class="value">{{ detailData.createBy }}</div>
  149. </el-col>
  150. <el-col :span="24" class="item">
  151. <div class="label">审批说明</div>
  152. <div class="value">
  153. <el-input v-model="examineForm.remark" placeholder="请输入内容"></el-input>
  154. </div>
  155. </el-col>
  156. </el-row>
  157. </div>
  158. <div class="page-footer">
  159. <div class="footer">
  160. <el-button type="primary" @click="clickSubmitForm('OK')">审批通过</el-button>
  161. <el-button type="warning" @click="clickSubmitForm('FAIL')">审批驳回</el-button>
  162. <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px">
  163. <el-button slot="reference">关 闭</el-button>
  164. </el-popconfirm>
  165. </div>
  166. </div>
  167. </div>
  168. </template>
  169. <script>
  170. import { getDetail, examineData } from '@/api/supply/sales'
  171. import { getFileUrl } from '@/api/common'
  172. export default {
  173. name: 'SalesDetail',
  174. componentName: 'SalesDetail',
  175. props: ['listItem'],
  176. filters: {
  177. statusFilter(val) {
  178. const statusList = [
  179. { label: '已保存', value: 'SAVE' },
  180. { label: '待审核', value: 'WAIT' },
  181. { label: '审核通过', value: 'OK' }
  182. // { label: '审核驳回', value: 'FAIL' },,
  183. ]
  184. let obj = statusList.find(o => o.value == val)
  185. return obj ? obj.label : ''
  186. }
  187. },
  188. data() {
  189. return {
  190. userName: JSON.parse(localStorage.getItem('supply_user')).nickName,
  191. detailData: {},
  192. formLoading: false,
  193. srcList: [],
  194. examineForm: {
  195. remark: ''
  196. }
  197. }
  198. },
  199. created() {
  200. this.getDetail()
  201. },
  202. methods: {
  203. getDate() {
  204. var date = new Date()
  205. var seperator1 = '-'
  206. var year = date.getFullYear()
  207. var month = date.getMonth() + 1
  208. var strDate = date.getDate()
  209. if (month >= 1 && month <= 9) {
  210. month = '0' + month
  211. }
  212. if (strDate >= 0 && strDate <= 9) {
  213. strDate = '0' + strDate
  214. }
  215. var currentdate = year + seperator1 + month + seperator1 + strDate
  216. return currentdate
  217. },
  218. // 打开链接
  219. openLink(url) {
  220. getFileUrl({ key: url }).then(res => {
  221. window.open(res.data)
  222. })
  223. },
  224. checkFileType(url) {
  225. if (!url) return ''
  226. const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
  227. if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
  228. return 'image'
  229. } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
  230. return 'word'
  231. } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
  232. return 'excel'
  233. } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
  234. return 'ppt'
  235. } else if (['pdf'].includes(fileSuffix)) {
  236. return 'pdf'
  237. } else if (['zip', 'rar', 'gz', 'apk'].includes(fileSuffix)) {
  238. return 'file'
  239. } else {
  240. return ''
  241. }
  242. },
  243. // 返回列表
  244. goBack() {
  245. this.$emit('backListFormExamine')
  246. },
  247. // 获取详情
  248. getDetail() {
  249. getDetail({ id: this.listItem.id }).then(res => {
  250. if (res.data.saleOrderData) {
  251. res.data.saleOrderData.forEach(item => {
  252. item.sums1 = ['refundableQty']
  253. item.sums2 = ['payAmount', 'price']
  254. })
  255. }
  256. this.detailData = res.data
  257. this.srcList = [this.$imageUrl + this.detailData.fileUrl]
  258. })
  259. },
  260. // 提交审批
  261. clickSubmitForm(val) {
  262. this.$confirm('此操作将审批订单, 是否继续?', '提示', {
  263. confirmButtonText: '确定',
  264. cancelButtonText: '取消',
  265. type: 'warning'
  266. })
  267. .then(() => {
  268. let params = {
  269. id: this.listItem.id,
  270. approvalRemark: this.examineForm.remark,
  271. examineStatus: val
  272. }
  273. this.formLoading = true
  274. examineData(params)
  275. .then(res => {
  276. this.$successMsg()
  277. this.goBack()
  278. this.$parent.getList()
  279. })
  280. .finally(res => {
  281. this.formLoading = false
  282. })
  283. })
  284. .catch(() => {})
  285. }
  286. }
  287. }
  288. </script>
  289. <style scoped lang="scss">
  290. .detail-container {
  291. width: 100%;
  292. height: 100%;
  293. }
  294. .main-title {
  295. display: flex;
  296. justify-content: space-between;
  297. align-items: center;
  298. margin-top: 30px;
  299. height: 60px;
  300. border-bottom: 1px solid #dcdfe6;
  301. margin-bottom: 20px;
  302. .title {
  303. font-size: 16px;
  304. font-weight: 600;
  305. padding-left: 10px;
  306. }
  307. }
  308. .img-box {
  309. height: 150px;
  310. display: flex;
  311. align-items: center;
  312. }
  313. </style>