engin_examine.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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"></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="left" 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="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  131. <el-table-column align="right" label="申请数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  132. <el-table-column align="right" label="审批数量" prop="approvalNumber" min-width="100" show-overflow-tooltip>
  133. <template slot-scope="scope">
  134. <el-input v-model="scope.row.approvalNumber" disabled size="small" type="number"></el-input>
  135. </template>
  136. </el-table-column>
  137. <el-table-column align="left" label="备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip>
  138. <template slot-scope="scope">
  139. <el-input v-model="scope.row.invoiceRemark" size="small"></el-input>
  140. </template>
  141. </el-table-column>
  142. </el-table>
  143. </div>
  144. <div class="main-title">
  145. <div class="title">审批信息</div>
  146. </div>
  147. <div class="diy-table-1">
  148. <el-row :gutter="0">
  149. <el-col :span="12" class="item">
  150. <div class="label">审批人</div>
  151. <div class="value">{{userName}}</div>
  152. </el-col>
  153. <el-col :span="12" class="item">
  154. <div class="label">审批日期</div>
  155. <div class="value">{{getDate()}}</div>
  156. </el-col>
  157. <el-col :span="24" class="item">
  158. <div class="label">审批说明</div>
  159. <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入内容"></el-input></div>
  160. </el-col>
  161. </el-row>
  162. </div>
  163. <div class="page-footer">
  164. <div class="footer">
  165. <el-button type="primary" @click="clickSubmitForm('OK')">审批通过</el-button>
  166. <el-button type="warning" @click="clickSubmitForm('SAVE')">审批驳回</el-button>
  167. <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
  168. <el-button slot="reference">关 闭</el-button>
  169. </el-popconfirm>
  170. </div>
  171. </div>
  172. </div>
  173. </template>
  174. <script>
  175. import { getEnginDetail, examineEngin } from "@/api/supply/apply";
  176. export default {
  177. name: 'EnginExamine',
  178. componentName: 'EnginExamine',
  179. props: ['listItem'],
  180. filters: {
  181. statusFilter(val) {
  182. const statusList = [
  183. { label: '已保存', value: 'SAVE' },
  184. { label: '待审核', value: 'WAIT' },
  185. { label: '审核通过', value: 'OK' },
  186. { label: '审核驳回', value: 'FAIL' },
  187. { label: '已关闭', value: 'CLOSE' },
  188. ];
  189. let obj = statusList.find(o => o.value == val);
  190. return obj ? obj.label : ''
  191. },
  192. enginTypeFilter(val) {
  193. const MAP = {
  194. HOME: '家用',
  195. TRADE: '商用',
  196. }
  197. return MAP[val];
  198. }
  199. },
  200. data() {
  201. return {
  202. imageURL: this.$imageUrl,
  203. detailData: {},
  204. userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
  205. goodsList: [],
  206. examineForm: {
  207. remark: '',
  208. },
  209. }
  210. },
  211. created() {
  212. this.getDetail();
  213. },
  214. methods: {
  215. getDate() {
  216. var date = new Date();
  217. var seperator1 = "-";
  218. var year = date.getFullYear();
  219. var month = date.getMonth() + 1;
  220. var strDate = date.getDate();
  221. if (month >= 1 && month <= 9) {
  222. month = "0" + month;
  223. }
  224. if (strDate >= 0 && strDate <= 9) {
  225. strDate = "0" + strDate;
  226. }
  227. var currentdate = year + seperator1 + month + seperator1 + strDate;
  228. return currentdate;
  229. },
  230. // 返回列表
  231. goBack() {
  232. this.$emit('backListFormDetail');
  233. },
  234. // 获取详情
  235. getDetail() {
  236. getEnginDetail({id: this.listItem.id}).then(res => {
  237. this.detailData = res.data;
  238. res.data.orders.forEach(item => {
  239. item.approvalNumber = item.refundableQty;
  240. });
  241. this.goodsList = res.data.orders;
  242. })
  243. },
  244. // 检查文件类型
  245. checkFileType(url) {
  246. if(!url) return '';
  247. const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
  248. if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
  249. return 'image';
  250. }else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
  251. return 'word';
  252. }else if(['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
  253. return 'excel';
  254. }else if(['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
  255. return 'ppt';
  256. }else if(['pdf'].includes(fileSuffix)) {
  257. return 'pdf';
  258. }else {
  259. return '';
  260. }
  261. },
  262. // 打开链接
  263. openLink(url) {
  264. getFileUrl({key: url}).then(res => {
  265. window.open(res.data);
  266. })
  267. },
  268. // 提交审批
  269. clickSubmitForm(val) {
  270. for(let i=0; i<this.goodsList.length; i++) {
  271. // if(this.goodsList[i].approvalNumber === '') {
  272. // this.$errorMsg('请填写审批数量');
  273. // return;
  274. // }
  275. // if(this.goodsList[i].approvalNumber > this.goodsList[i].refundableQty) {
  276. // this.$errorMsg('审批数量不可大于申请数量');
  277. // return;
  278. // }
  279. }
  280. this.$confirm('此操作将审批订单, 是否继续?', '提示', {
  281. confirmButtonText: '确定',
  282. cancelButtonText: '取消',
  283. type: 'warning'
  284. }).then(() => {
  285. let params = {
  286. id: this.detailData.id,
  287. examineStatus: val,
  288. approvalRemark: this.examineForm.remark,
  289. orders: this.goodsList,
  290. };
  291. examineEngin(params).then(res => {
  292. this.$successMsg();
  293. this.goBack();
  294. this.$parent.getList();
  295. })
  296. }).catch(() => {});
  297. },
  298. }
  299. }
  300. </script>
  301. <style scoped lang="scss">
  302. .detail-container {
  303. width: 100%;
  304. height: 100%;
  305. }
  306. .main-title {
  307. display: flex;
  308. justify-content: space-between;
  309. align-items: center;
  310. margin-top: 20px;
  311. height: 60px;
  312. border-bottom: 1px solid #DCDFE6;
  313. margin-bottom: 20px;
  314. .title {
  315. font-size: 16px;
  316. font-weight: 600;
  317. padding-left: 10px;
  318. }
  319. }
  320. </style>