apply_examine.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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.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 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="8" class="item">
  55. <div class="label">制单人</div>
  56. <div class="value">{{detailData.createBy}}</div>
  57. </el-col>
  58. <el-col :span="8" class="item">
  59. <div class="label">制单日期</div>
  60. <div class="value">{{detailData.createTime}}</div>
  61. </el-col>
  62. <el-col :span="8" class="item">
  63. <div class="label"></div>
  64. <div class="value"></div>
  65. </el-col>
  66. </el-row>
  67. </div>
  68. <div class="main-title">
  69. <div class="title">货品信息</div>
  70. </div>
  71. <div class="table" style="margin-top: 20px">
  72. <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  73. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  74. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  75. <el-table-column align="left" label="销售订单号" prop="mainOrderId" min-width="140" show-overflow-tooltip></el-table-column>
  76. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
  77. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
  78. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  79. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip></el-table-column>
  80. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  81. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  82. <template slot-scope="scope">
  83. {{ scope.row.price | numToFixed }}
  84. </template>
  85. </el-table-column>
  86. <el-table-column align="right" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
  87. <template slot-scope="scope">
  88. {{ scope.row.totalAmount | numToFixed }}
  89. </template>
  90. </el-table-column>
  91. <el-table-column align="right" label="申请数量" prop="invoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
  92. <el-table-column align="right" label="审批数量" prop="approvalNumber" min-width="100" show-overflow-tooltip>
  93. <template slot-scope="scope">
  94. <el-input v-model="scope.row.approvalNumber" disabled size="small" type="number"></el-input>
  95. </template>
  96. </el-table-column>
  97. <el-table-column align="right" label="已退数量" prop="retiredQty" min-width="100" show-overflow-tooltip></el-table-column>
  98. <el-table-column align="left" label="订单备注" prop="headerRemark" min-width="160" show-overflow-tooltip>
  99. <template slot-scope="scope">
  100. <el-input v-model="scope.row.headerRemark" size="small"></el-input>
  101. </template>
  102. </el-table-column>
  103. <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip>
  104. <template slot-scope="scope">
  105. <el-input v-model="scope.row.remark" size="small"></el-input>
  106. </template>
  107. </el-table-column>
  108. <el-table-column align="left" label="表体备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip>
  109. <template slot-scope="scope">
  110. <el-input v-model="scope.row.invoiceRemark" size="small"></el-input>
  111. </template>
  112. </el-table-column>
  113. <el-table-column align="left" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
  114. <el-table-column align="left" label="表头业务员" prop="k3ServiceName" min-width="100" show-overflow-tooltip></el-table-column>
  115. </el-table>
  116. </div>
  117. <div class="main-title">
  118. <div class="title">审批信息</div>
  119. </div>
  120. <div class="diy-table-1">
  121. <el-row :gutter="0">
  122. <el-col :span="12" class="item">
  123. <div class="label">审批人</div>
  124. <div class="value">{{userName}}</div>
  125. </el-col>
  126. <el-col :span="12" class="item">
  127. <div class="label">审批结果</div>
  128. <div class="value">
  129. <el-radio-group v-model="examineForm.status">
  130. <el-radio :label="true">通过</el-radio>
  131. <el-radio :label="false">驳回</el-radio>
  132. </el-radio-group>
  133. </div>
  134. </el-col>
  135. <el-col :span="24" class="item">
  136. <div class="label">审批说明</div>
  137. <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入内容"></el-input></div>
  138. </el-col>
  139. </el-row>
  140. </div>
  141. <div class="page-footer">
  142. <div class="footer">
  143. <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
  144. <el-popconfirm
  145. title="确定关闭吗?"
  146. @onConfirm="goBack"
  147. style="margin-left: 10px;"
  148. >
  149. <el-button slot="reference">关 闭</el-button>
  150. </el-popconfirm>
  151. </div>
  152. </div>
  153. </div>
  154. </template>
  155. <script>
  156. import { getApplyDetail, examineApply } from "@/api/supply/apply";
  157. export default {
  158. name: 'ApplyExamine',
  159. componentName: 'ApplyExamine',
  160. props: ['listItem'],
  161. filters: {
  162. statusFilter(val) {
  163. const statusList = [
  164. { label: '已保存', value: 'SAVE' },
  165. { label: '待审核', value: 'WAIT' },
  166. { label: '审核通过', value: 'OK' },
  167. { label: '审核驳回', value: 'FAIL' },
  168. { label: '已关闭', value: 'CLOSE' },
  169. ];
  170. let obj = statusList.find(o => o.value == val);
  171. return obj ? obj.label : ''
  172. }
  173. },
  174. data() {
  175. return {
  176. imageURL: this.$imageUrl,
  177. detailData: {},
  178. goodsList: [],
  179. userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
  180. formLoading: false,
  181. examineForm: {
  182. status: true,
  183. remark: '',
  184. },
  185. }
  186. },
  187. created() {
  188. this.getDetail();
  189. },
  190. methods: {
  191. // 返回列表
  192. goBack() {
  193. this.$emit('backListFormDetail');
  194. },
  195. // 获取详情
  196. getDetail() {
  197. getApplyDetail({id: this.listItem.id}).then(res => {
  198. this.detailData = res.data;
  199. res.data.orders.forEach((item, index) => {
  200. item.approvalNumber = item.invoiceNum;
  201. });
  202. this.goodsList = res.data.orders;
  203. })
  204. },
  205. // 检查文件类型
  206. checkFileType(url) {
  207. if(!url) return '';
  208. const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
  209. if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
  210. return 'image';
  211. }else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
  212. return 'word';
  213. }else if(['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
  214. return 'excel';
  215. }else if(['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
  216. return 'ppt';
  217. }else if(['pdf'].includes(fileSuffix)) {
  218. return 'pdf';
  219. }else {
  220. return '';
  221. }
  222. },
  223. // 打开链接
  224. openLink(url) {
  225. getFileUrl({key: url}).then(res => {
  226. window.open(res.data);
  227. })
  228. },
  229. // 提交审批
  230. clickSubmitForm() {
  231. for(let i=0; i<this.goodsList.length; i++) {
  232. if(this.goodsList[i].approvalNumber === '') {
  233. this.$errorMsg('请填写审批数量');
  234. return;
  235. }
  236. // if(this.goodsList[i].approvalNumber > this.goodsList[i].invoiceNum) {
  237. // this.$errorMsg('审批数量不可大于申请数量');
  238. // return;
  239. // }
  240. }
  241. this.formLoading = true;
  242. examineApply({
  243. id: this.listItem.id,
  244. examineStatus: this.examineForm.status ? 'OK' : 'SAVE',
  245. approvalRemark: this.examineForm.remark,
  246. orders: this.goodsList
  247. }).then(res => {
  248. this.$successMsg('审批成功');
  249. this.goBack();
  250. this.$parent.getList();
  251. }).finally(res => {
  252. this.formLoading = false;
  253. })
  254. },
  255. }
  256. }
  257. </script>
  258. <style scoped lang="scss">
  259. .detail-container {
  260. width: 100%;
  261. height: 100%;
  262. }
  263. .main-title {
  264. display: flex;
  265. justify-content: space-between;
  266. align-items: center;
  267. margin-top: 20px;
  268. height: 60px;
  269. border-bottom: 1px solid #DCDFE6;
  270. margin-bottom: 20px;
  271. .title {
  272. font-size: 16px;
  273. font-weight: 600;
  274. padding-left: 10px;
  275. }
  276. }
  277. ::v-deep input::-webkit-outer-spin-button,
  278. ::v-deep input::-webkit-inner-spin-button {
  279. -webkit-appearance: none;
  280. }
  281. ::v-deep input[type='number'] {
  282. -moz-appearance: textfield;
  283. }
  284. </style>