apply_examine.vue 12 KB

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