home_examine.vue 21 KB

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