home_examine.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  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.enginOrderNo}}</div>
  12. </el-col>
  13. <el-col :span="8" class="item">
  14. <div class="label">订单日期</div>
  15. <div class="value">{{detailData.orderDate}}</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.refPromiseStatus}}</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">
  52. <el-select v-model="detailData.saleTypeId" placeholder="选择销售类型" style="width: 100%" clearable>
  53. <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
  54. </el-select>
  55. </div>
  56. </el-col>
  57. <el-col :span="8" class="item">
  58. <div class="label">联系人</div>
  59. <div class="value">{{detailData.aaa}}</div>
  60. </el-col>
  61. <el-col :span="8" class="item">
  62. <div class="label">固定电话</div>
  63. <div class="value">{{detailData.aaa}}</div>
  64. </el-col>
  65. <el-col :span="8" class="item">
  66. <div class="label">移动电话</div>
  67. <div class="value">{{detailData.aaa}}</div>
  68. </el-col>
  69. <el-col :span="8" class="item">
  70. <div class="label">不扣押金</div>
  71. <div class="value">
  72. {{detailData.takeDeposit ? '是':'否'}}
  73. <!-- <el-checkbox v-model="detailData.takeDeposit">{{detailData.takeDeposit ? '是':'否'}}</el-checkbox> -->
  74. </div>
  75. </el-col>
  76. <el-col :span="8" class="item">
  77. <div class="label">文件编码</div>
  78. <div class="value">{{detailData.fileNo}}</div>
  79. </el-col>
  80. <el-col :span="8" class="item">
  81. <div class="label">业务员</div>
  82. <div class="value">{{detailData.serviceName}}</div>
  83. </el-col>
  84. <!-- <el-col :span="24" class="item">
  85. <div class="label">格力回复</div>
  86. <div class="value">
  87. <el-input v-model="detailData.note1" placeholder="请输入格力回复"></el-input>
  88. </div>
  89. </el-col>
  90. <el-col :span="24" class="item">
  91. <div class="label">格力内部备注</div>
  92. <div class="value">
  93. <el-input v-model="detailData.note2" placeholder="请输入格力内部备注"></el-input>
  94. </div>
  95. </el-col> -->
  96. <el-col :span="16" class="item">
  97. <div class="label">项目说明</div>
  98. <div class="value">{{detailData.refProjectNote}}</div>
  99. </el-col>
  100. <el-col :span="8" class="item">
  101. <div class="label">项目类型</div>
  102. <div class="value">{{detailData.refProjectType}}</div>
  103. </el-col>
  104. <el-col :span="24" class="item">
  105. <div class="label">格力内部备注</div>
  106. <div class="value">{{detailData.geLiInerNote}}</div>
  107. </el-col>
  108. <el-col :span="16" class="item">
  109. <div class="label">备注</div>
  110. <div class="value">{{detailData.remark}}</div>
  111. </el-col>
  112. <el-col :span="8" class="item">
  113. <div class="label">第几次申报</div>
  114. <div class="value">{{detailData.refDeclareNo}}</div>
  115. </el-col>
  116. <el-col :span="6" class="item">
  117. <div class="label">制单人</div>
  118. <div class="value">{{detailData.createName}}</div>
  119. </el-col>
  120. <el-col :span="6" class="item">
  121. <div class="label">制单日期</div>
  122. <div class="value">{{detailData.createTime}}</div>
  123. </el-col>
  124. <el-col :span="6" class="item">
  125. <div class="label">关闭人</div>
  126. <div class="value">{{detailData.closeName}}</div>
  127. </el-col>
  128. <el-col :span="6" class="item">
  129. <div class="label">关闭日期</div>
  130. <div class="value">{{detailData.closeTime}}</div>
  131. </el-col>
  132. </el-row>
  133. </div>
  134. <div class="main-title">
  135. <div class="title">货品信息</div>
  136. </div>
  137. <div class="table" style="margin-top: 20px">
  138. <el-table
  139. :data="detailData.items"
  140. element-loading-text="Loading"
  141. border
  142. fit
  143. highlight-current-row
  144. stripe
  145. max-height="400">
  146. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  147. <el-table-column align="center" label="引用记录" prop="useRefCount" min-width="160" show-overflow-tooltip></el-table-column>
  148. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
  149. <el-table-column align="center" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip></el-table-column>
  150. <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
  151. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  152. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  153. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  154. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  155. <template slot-scope="scope">
  156. <!-- {{ scope.row.price | numToFixed }} -->
  157. <el-input v-model="scope.row.price" size="small" type="number"></el-input>
  158. </template>
  159. </el-table-column>
  160. <el-table-column align="right" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
  161. <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
  162. <template slot-scope="scope">
  163. <!-- {{ (scope.row.qty*100 - scope.row.directTransferQty*100 - scope.row.retiredQty*100) / 100 }} -->
  164. <el-input v-model="scope.row.qty" size="small" type="number"></el-input>
  165. </template>
  166. </el-table-column>
  167. <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
  168. <template slot-scope="scope">
  169. {{ scope.row.totalAmount | numToFixed }}
  170. </template>
  171. </el-table-column>
  172. <!-- <el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="140" show-overflow-tooltip></el-table-column>
  173. <el-table-column align="right" label="使用返利金额" prop="rebateAmount" min-width="120" show-overflow-tooltip>
  174. <template slot-scope="scope">
  175. {{ scope.row.rebateAmount | numToFixed }}
  176. </template>
  177. </el-table-column> -->
  178. <el-table-column align="center" label="返利类型" prop="customerWalletId2" min-width="160" show-overflow-tooltip>
  179. <template slot-scope="scope">
  180. <el-select v-model="scope.row.customerWalletId2" placeholder="选择返利类型" size="small" clearable @change="changeFlWallet(scope.$index)">
  181. <el-option
  182. v-for="item in scope.row.rebateWallets"
  183. :key="item.customerWalletId"
  184. :label="item.customerWalletName"
  185. :value="item.customerWalletId">
  186. </el-option>
  187. </el-select>
  188. </template>
  189. </el-table-column>
  190. <el-table-column align="right" label="返利金额" min-width="100" show-overflow-tooltip>
  191. <template slot-scope="scope">
  192. {{(scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100}}
  193. </template>
  194. </el-table-column>
  195. <el-table-column align="right" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip>
  196. <template slot-scope="scope">
  197. {{ scope.row.discAmount | numToFixed }}
  198. </template>
  199. </el-table-column>
  200. <!-- <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="140" show-overflow-tooltip></el-table-column>
  201. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  202. <template slot-scope="scope">
  203. {{ scope.row.payAmount | numToFixed }}
  204. </template>
  205. </el-table-column> -->
  206. <el-table-column align="center" label="现金钱包" prop="customerWalletId" min-width="160" show-overflow-tooltip>
  207. <template slot-scope="scope">
  208. <el-select v-model="scope.row.customerWalletId" placeholder="选择现金钱包" size="small" clearable @change="changeXjWallet(scope.$index)">
  209. <el-option
  210. v-for="item in scope.row.wallets"
  211. :key="item.customerWalletId"
  212. :label="item.customerWalletName"
  213. :value="item.customerWalletId">
  214. </el-option>
  215. </el-select>
  216. </template>
  217. </el-table-column>
  218. <el-table-column align="right" label="实付金额" prop="qty" min-width="100" show-overflow-tooltip>
  219. <template slot-scope="scope">
  220. {{(((scope.row.price * scope.row.qty) * 100 - ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 - ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) / 100) | numToFixed}}
  221. </template>
  222. </el-table-column>
  223. <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
  224. <template slot-scope="scope">
  225. {{ scope.row.isDirectTransfer ? '是' : '否' }}
  226. </template>
  227. </el-table-column>
  228. <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
  229. <el-table-column align="right" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
  230. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  231. <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
  232. </el-table>
  233. </div>
  234. <div class="main-title">
  235. <div class="title">审批信息</div>
  236. </div>
  237. <div class="diy-table-1">
  238. <el-row :gutter="0">
  239. <el-col :span="12" class="item">
  240. <div class="label">审批人</div>
  241. <div class="value">{{userName}}</div>
  242. </el-col>
  243. <el-col :span="12" class="item">
  244. <div class="label">审批日期</div>
  245. <div class="value">{{getDate()}}</div>
  246. </el-col>
  247. <el-col :span="24" class="item">
  248. <div class="label">审批说明</div>
  249. <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入审批说明"></el-input></div>
  250. </el-col>
  251. </el-row>
  252. </div>
  253. <div class="page-footer">
  254. <div class="footer">
  255. <el-button type="primary" @click="clickSubmitForm(1)" :loading="formLoading">审批通过</el-button>
  256. <el-button type="warning" @click="clickSubmitForm(0)" :loading="formLoading">审批驳回</el-button>
  257. <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
  258. <el-button slot="reference">关 闭</el-button>
  259. </el-popconfirm>
  260. </div>
  261. </div>
  262. </div>
  263. </template>
  264. <script>
  265. import { getOrderDetail, examineHome } from "@/api/supply/engin";
  266. import { getTypeList } from '@/api/common'
  267. export default {
  268. name: 'HomeExamine',
  269. componentName: 'HomeExamine',
  270. props: ['listItem'],
  271. filters: {
  272. statusFilter(val) {
  273. const statusList = [
  274. { label: '已保存', value: 'SAVE' },
  275. { label: '待审核', value: 'WAIT' },
  276. { label: '审核通过', value: 'OK' },
  277. { label: '审核驳回', value: 'FAIL' },
  278. { label: '已关闭', value: 'CLOSE' },
  279. ];
  280. let obj = statusList.find(o => o.value == val);
  281. return obj ? obj.label : ''
  282. }
  283. },
  284. data() {
  285. return {
  286. userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
  287. detailData: {},
  288. examineForm: {
  289. remark: '',
  290. },
  291. salesTypeList: [],
  292. formLoading: false,
  293. }
  294. },
  295. created() {
  296. this.getSalesTypeList();
  297. this.getDetail();
  298. },
  299. methods: {
  300. getDate() {
  301. var date = new Date();
  302. var seperator1 = "-";
  303. var year = date.getFullYear();
  304. var month = date.getMonth() + 1;
  305. var strDate = date.getDate();
  306. if (month >= 1 && month <= 9) {
  307. month = "0" + month;
  308. }
  309. if (strDate >= 0 && strDate <= 9) {
  310. strDate = "0" + strDate;
  311. }
  312. var currentdate = year + seperator1 + month + seperator1 + strDate;
  313. return currentdate;
  314. },
  315. // 获取销售类型列表
  316. getSalesTypeList() {
  317. getTypeList({
  318. pageNum: 1,
  319. pageSize: -1
  320. }).then((res) => {
  321. this.salesTypeList = res.data.records;
  322. })
  323. },
  324. // 返回列表
  325. goBack() {
  326. this.$emit('backListFormDetail');
  327. },
  328. // 获取详情
  329. getDetail() {
  330. getOrderDetail({id: this.listItem.parentId}).then(res => {
  331. if(res.data.items) {
  332. res.data.items.forEach(item => {
  333. item.sums1 = ['directTransferQty', 'qty', 'enginNum', 'refundableQty', 'tdQty', 'hasSendQty'];
  334. item.sums2 = ['totalAmount', 'payAmount', 'price', 'discAmount', 'rebateAmount'];
  335. })
  336. }
  337. res.data.items.forEach(item => {
  338. item.rebateWallets = item.customerWalletList.filter(item => {
  339. return item.type === 'REBATE';
  340. });
  341. item.wallets = item.customerWalletList.filter(item => {
  342. return item.type === 'COMMONLY';
  343. });
  344. })
  345. this.detailData = res.data;
  346. })
  347. },
  348. // 修改返利钱包
  349. changeFlWallet(index) {
  350. if(this.detailData.items[index].customerWalletId2) {
  351. let obj = this.detailData.items[index].rebateWallets.find(o => o.customerWalletId == this.detailData.items[index].customerWalletId2);
  352. this.detailData.items[index].rebateRate = obj.rebateRate;
  353. this.detailData.items[index].customerWalletName2 = obj.customerWalletName;
  354. }else {
  355. this.detailData.items[index].rebateRate = '';
  356. this.detailData.items[index].customerWalletName2 = '';
  357. }
  358. },
  359. // 修改现金钱包
  360. changeXjWallet(index) {
  361. if(this.detailData.items[index].customerWalletId) {
  362. let obj = this.detailData.items[index].wallets.find(o => o.customerWalletId == this.detailData.items[index].customerWalletId);
  363. this.detailData.items[index].customerWalletName = obj.customerWalletName;
  364. }else {
  365. this.detailData.items[index].customerWalletName = '';
  366. }
  367. },
  368. // 审批
  369. clickSubmitForm(val) {
  370. this.$confirm('此操作将审批订单, 是否继续?', '提示', {
  371. confirmButtonText: '确定',
  372. cancelButtonText: '取消',
  373. type: 'warning'
  374. }).then(() => {
  375. let saleTypeItem = this.salesTypeList.find(o => o.id == this.detailData.saleTypeId);
  376. let params = JSON.parse(JSON.stringify(this.detailData));
  377. params.examineNote = this.examineForm.remark;
  378. params.examineResult = val;
  379. params.saleTypeId = this.detailData.saleTypeId;
  380. params.saleTypeCode = saleTypeItem.saleCode;
  381. params.saleTypeName = saleTypeItem.saleName;
  382. this.formLoading = true;
  383. examineHome(params).then(res => {
  384. if(!res.data) {
  385. this.$successMsg();
  386. this.goBack();
  387. this.$parent.getList();
  388. }else {
  389. this.$confirm('审批成功!是否跳转下一张待审批订单?', '提示', {
  390. confirmButtonText: '跳转',
  391. cancelButtonText: '取消',
  392. type: 'warning'
  393. }).then(() => {
  394. this.$successMsg('进入下一张待审批订单');
  395. this.detailData = res.data;
  396. }).catch(() => {
  397. this.goBack();
  398. this.$parent.getList();
  399. });
  400. }
  401. }).finally(res => {
  402. this.formLoading = false;
  403. })
  404. }).catch(() => {});
  405. },
  406. }
  407. }
  408. </script>
  409. <style scoped lang="scss">
  410. .detail-container {
  411. width: 100%;
  412. height: 100%;
  413. }
  414. .main-title {
  415. display: flex;
  416. justify-content: space-between;
  417. align-items: center;
  418. margin-top: 20px;
  419. height: 60px;
  420. border-bottom: 1px solid #DCDFE6;
  421. margin-bottom: 20px;
  422. .title {
  423. font-size: 16px;
  424. font-weight: 600;
  425. padding-left: 10px;
  426. }
  427. }
  428. </style>