engin_examine.vue 12 KB

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