engin_list.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowForm && !isShowExamine">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <Collapse :screen-form="screenForm">
  7. <template #right_btn>
  8. <el-button size="mini" @click="resetScreenForm">清空</el-button>
  9. <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
  10. </template>
  11. <template #left_btn>
  12. <el-radio-group size="mini" v-model="screenForm.examineStatus" @change="getList">
  13. <el-radio-button label="">全部</el-radio-button>
  14. <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value"
  15. >{{ item.label }}
  16. </el-radio-button>
  17. </el-radio-group>
  18. </template>
  19. <template #search>
  20. <el-form ref="screenForm" :model="screenForm" label-width="100px" size="mini" label-position="left">
  21. <el-row :gutter="20">
  22. <el-col :xs="24" :sm="12" :lg="6">
  23. <el-form-item label="工程登录编号" prop="orderNum">
  24. <el-input v-model="screenForm.orderNum" placeholder="请输入工程登录编号"></el-input>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :xs="24" :sm="12" :lg="6">
  28. <el-form-item label="工程编码" prop="enginNum">
  29. <el-input v-model="screenForm.enginNum" placeholder="请输入工程编码"></el-input>
  30. </el-form-item>
  31. </el-col>
  32. <!-- <el-col :xs="24" :sm="12" :lg="6">
  33. <el-form-item label="工程登录编号" prop="loginNum">
  34. <el-input v-model="screenForm.loginNum" placeholder="请输入工程登录编号"></el-input>
  35. </el-form-item>
  36. </el-col> -->
  37. <el-col :xs="24" :sm="12" :lg="6">
  38. <el-form-item label="项目名称" prop="enginName">
  39. <el-input v-model="screenForm.enginName" placeholder="请输入项目名称"></el-input>
  40. </el-form-item>
  41. </el-col>
  42. <el-col :xs="24" :sm="12" :lg="6">
  43. <el-form-item label="单据日期" prop="date">
  44. <el-date-picker
  45. v-model="screenForm.orderDate"
  46. type="datetimerange"
  47. :default-time="['00:00:00', '23:59:59']"
  48. range-separator="至"
  49. style="width: 100%"
  50. value-format="yyyy-MM-dd HH:mm:ss"
  51. start-placeholder="开始日期"
  52. end-placeholder="结束日期"
  53. >
  54. </el-date-picker>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :xs="24" :sm="12" :lg="6">
  58. <el-form-item label="经销商" prop="dealer">
  59. <el-input v-model="screenForm.dealer" placeholder="请输入经销商"></el-input>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :xs="24" :sm="12" :lg="6">
  63. <el-form-item label="使用单位" prop="company">
  64. <el-input v-model="screenForm.company" placeholder="请输入使用单位"></el-input>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :xs="24" :sm="12" :lg="6">
  68. <el-form-item label="制表人" prop="createMan">
  69. <el-input v-model="screenForm.createMan" placeholder="请输入制表人"></el-input>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :xs="24" :sm="12" :lg="6">
  73. <el-form-item label="审核人" prop="examineMan">
  74. <el-input v-model="screenForm.examineMan" placeholder="请输入审核人"></el-input>
  75. </el-form-item>
  76. </el-col>
  77. <el-col :xs="24" :sm="12" :lg="6">
  78. <el-form-item label="业务员" prop="salesMan">
  79. <el-select
  80. v-model="screenForm.salesMan"
  81. placeholder="选择业务员"
  82. clearable
  83. filterable
  84. style="width: 100%"
  85. >
  86. <el-option
  87. v-for="item in salesmanList"
  88. :key="item.adminUserId"
  89. :label="item.nickName"
  90. :value="item.adminUserId"
  91. >
  92. </el-option>
  93. </el-select>
  94. </el-form-item>
  95. </el-col>
  96. <el-col :xs="24" :sm="12" :lg="6">
  97. <el-form-item label="规格型号" prop="model">
  98. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :xs="24" :sm="12" :lg="6">
  102. <el-form-item label="是否直调" prop="isDirectTransfer">
  103. <el-select
  104. v-model="screenForm.isDirectTransfer"
  105. placeholder="选择是否直"
  106. clearable
  107. style="width: 100%"
  108. >
  109. <el-option :value="null" label="默认"></el-option>
  110. <el-option v-for="item in transfer" :key="item.value" :label="item.label" :value="item.value">
  111. </el-option>
  112. </el-select>
  113. </el-form-item>
  114. </el-col>
  115. <el-col :xs="24" :sm="12" :lg="6">
  116. <el-form-item label="是否关闭" prop="isClose">
  117. <el-select v-model="screenForm.isClose" placeholder="是否关闭" clearable style="width: 100%">
  118. <el-option label="是" :value="true"> </el-option>
  119. <el-option label="否" :value="false"> </el-option>
  120. </el-select>
  121. </el-form-item>
  122. </el-col>
  123. </el-row>
  124. </el-form>
  125. </template>
  126. </Collapse>
  127. </div>
  128. <div class="mymain-container">
  129. <div class="btn-group clearfix">
  130. <div class="fl">
  131. <el-button
  132. v-if="$checkBtnRole('add', $route.meta.roles)"
  133. size="mini"
  134. type="primary"
  135. icon="el-icon-plus"
  136. @click="toForm()"
  137. >新增
  138. </el-button>
  139. </div>
  140. <div class="fr">
  141. <ExportButton :ex-url="'engin-info-order/export'" :ex-params="exParams" />
  142. </div>
  143. </div>
  144. <div class="table">
  145. <el-table
  146. v-loading="listLoading"
  147. :data="dataList"
  148. element-loading-text="Loading"
  149. border
  150. fit
  151. highlight-current-row
  152. stripe
  153. show-summary
  154. :summary-method="$getSummaries"
  155. >
  156. <el-table-column
  157. align="left"
  158. label="审核状态"
  159. sortable
  160. prop="examineStatus"
  161. min-width="100"
  162. show-overflow-tooltip
  163. >
  164. <template slot-scope="scope">
  165. {{ scope.row.examineStatus | statusFilter }}
  166. </template>
  167. </el-table-column>
  168. <!-- <el-table-column align="left" label="数量" sortable prop="qty" min-width="160" show-overflow-tooltip />-->
  169. <!-- <el-table-column align="left" label="金额" sortable prop="price" min-width="160" show-overflow-tooltip />-->
  170. <el-table-column
  171. align="left"
  172. label="工程登录编号"
  173. sortable
  174. prop="enginInfoNo"
  175. min-width="150"
  176. show-overflow-tooltip
  177. >
  178. <template slot-scope="scope">
  179. <CopyButton :copy-text="scope.row.enginInfoNo" />
  180. <span>{{ scope.row.enginInfoNo }}</span>
  181. </template>
  182. </el-table-column>
  183. <el-table-column
  184. align="left"
  185. label="订单日期"
  186. sortable
  187. prop="orderDate"
  188. min-width="120"
  189. show-overflow-tooltip
  190. >
  191. <template slot-scope="scope">
  192. <div>
  193. <span>{{ scope.row.orderDate | dateToDayFilter }}</span>
  194. <el-button
  195. v-if="
  196. $checkBtnRole('date', $route.meta.roles) &&
  197. (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT')
  198. "
  199. type="text"
  200. icon="el-icon-edit"
  201. style="padding: 0; margin-left: 6px"
  202. @click="editDate(scope.row)"
  203. />
  204. </div>
  205. </template>
  206. </el-table-column>
  207. <el-table-column
  208. align="left"
  209. label="经销商编码"
  210. sortable
  211. prop="customerNumber"
  212. min-width="120"
  213. show-overflow-tooltip
  214. >
  215. <template slot-scope="scope">
  216. <CopyButton :copy-text="scope.row.customerNumber" />
  217. <span>{{ scope.row.customerNumber }}</span>
  218. </template>
  219. </el-table-column>
  220. <el-table-column
  221. align="left"
  222. label="经销商名称"
  223. sortable
  224. prop="customerName"
  225. min-width="250"
  226. show-overflow-tooltip
  227. >
  228. <template slot-scope="scope">
  229. <CopyButton :copy-text="scope.row.customerName" />
  230. <span>{{ scope.row.customerName }}</span>
  231. </template>
  232. </el-table-column>
  233. <el-table-column
  234. align="left"
  235. label="项目名称"
  236. sortable
  237. prop="projectName"
  238. min-width="160"
  239. show-overflow-tooltip
  240. />
  241. <el-table-column
  242. align="left"
  243. label="使用单位"
  244. sortable
  245. prop="useUnit"
  246. min-width="160"
  247. show-overflow-tooltip
  248. />
  249. <el-table-column
  250. align="left"
  251. label="安装地址"
  252. sortable
  253. prop="installAddress"
  254. min-width="160"
  255. show-overflow-tooltip
  256. />
  257. <el-table-column
  258. align="left"
  259. label="物料编码"
  260. sortable
  261. prop="materialNumber"
  262. min-width="120"
  263. show-overflow-tooltip
  264. >
  265. <template slot-scope="scope">
  266. <CopyButton :copy-text="scope.row.materialNumber" />
  267. <span>{{ scope.row.materialNumber }}</span>
  268. </template>
  269. </el-table-column>
  270. <el-table-column
  271. align="left"
  272. label="产品编码"
  273. sortable
  274. prop="materialOldNumber"
  275. min-width="140"
  276. show-overflow-tooltip
  277. >
  278. <template slot-scope="scope">
  279. <CopyButton :copy-text="scope.row.materialOldNumber" />
  280. <span>{{ scope.row.materialOldNumber }}</span>
  281. </template>
  282. </el-table-column>
  283. <el-table-column
  284. align="left"
  285. label="产品名称"
  286. sortable
  287. prop="materialName"
  288. min-width="160"
  289. show-overflow-tooltip
  290. >
  291. <template slot-scope="scope">
  292. <CopyButton :copy-text="scope.row.materialName" />
  293. <span>{{ scope.row.materialName }}</span>
  294. </template>
  295. </el-table-column>
  296. <el-table-column
  297. align="left"
  298. label="规格型号"
  299. sortable
  300. prop="specification"
  301. min-width="350"
  302. show-overflow-tooltip
  303. >
  304. <template slot-scope="scope">
  305. <CopyButton :copy-text="scope.row.specification" />
  306. <span>{{ scope.row.specification }}</span>
  307. </template>
  308. </el-table-column>
  309. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  310. <el-table-column align="right" label="数量" prop="qty" min-width="100" sortable show-overflow-tooltip />
  311. <el-table-column align="right" label="已订数量" prop="hasOrderQty" min-width="100" show-overflow-tooltip />
  312. <el-table-column align="right" label="可订数量" prop="compute_kdQty" min-width="100" show-overflow-tooltip>
  313. <template slot-scope="scope">
  314. {{ computeAllowQty(scope.row.qty, scope.row.hasOrderQty) }}
  315. </template>
  316. </el-table-column>
  317. <el-table-column
  318. align="right"
  319. label="出库数量"
  320. prop="hasDeliverQty"
  321. min-width="100"
  322. show-overflow-tooltip
  323. />
  324. <el-table-column align="right" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
  325. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  326. <template slot-scope="scope">
  327. {{ scope.row.price | numToFixed }}
  328. </template>
  329. </el-table-column>
  330. <el-table-column
  331. align="right"
  332. label="金额"
  333. prop="totalAmount"
  334. min-width="100"
  335. sortable
  336. show-overflow-tooltip
  337. >
  338. <template slot-scope="scope">
  339. {{ scope.row.totalAmount | numToFixed }}
  340. </template>
  341. </el-table-column>
  342. <el-table-column
  343. align="left"
  344. label="表体业务员"
  345. sortable
  346. prop="itemServiceName"
  347. min-width="110"
  348. show-overflow-tooltip
  349. />
  350. <el-table-column
  351. align="left"
  352. label="表头业务员"
  353. sortable
  354. prop="serviceName"
  355. min-width="110"
  356. show-overflow-tooltip
  357. />
  358. <el-table-column align="left" label="备注" sortable prop="remark" min-width="160" show-overflow-tooltip />
  359. <el-table-column
  360. align="left"
  361. label="制表人"
  362. sortable
  363. prop="createName"
  364. min-width="100"
  365. show-overflow-tooltip
  366. />
  367. <el-table-column
  368. align="left"
  369. label="制表日期"
  370. sortable
  371. prop="createTime"
  372. min-width="160"
  373. show-overflow-tooltip
  374. />
  375. <el-table-column
  376. align="left"
  377. label="审核人"
  378. sortable
  379. prop="confirmName"
  380. min-width="100"
  381. show-overflow-tooltip
  382. />
  383. <el-table-column
  384. align="left"
  385. label="审核日期"
  386. sortable
  387. prop="confirmTime"
  388. min-width="160"
  389. show-overflow-tooltip
  390. />
  391. <el-table-column align="left" label="状态" sortable prop="isClose" min-width="160" show-overflow-tooltip>
  392. <template v-slot="{ row }">
  393. {{ row.isClose ? '关闭' : '启用' }}
  394. </template>
  395. </el-table-column>
  396. <el-table-column align="center" label="操作" width="210" fixed="right">
  397. <template slot-scope="scope">
  398. <el-popconfirm
  399. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'"
  400. style="margin-right: 10px"
  401. title="确定申请吗?"
  402. @onConfirm="handleSubmit(scope.row.enginInfoId)"
  403. >
  404. <el-button slot="reference" type="text">申请</el-button>
  405. </el-popconfirm>
  406. <el-popconfirm
  407. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
  408. style="margin-right: 10px"
  409. title="确定撤回吗?"
  410. @onConfirm="handleWithdraw(scope.row.enginInfoId)"
  411. >
  412. <el-button slot="reference" type="text">撤回</el-button>
  413. </el-popconfirm>
  414. <el-popconfirm
  415. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'"
  416. style="margin-right: 10px"
  417. title="确定弃审吗?"
  418. @onConfirm="handleAbandon(scope.row.enginInfoId)"
  419. >
  420. <el-button slot="reference" type="text">弃审</el-button>
  421. </el-popconfirm>
  422. <el-button
  423. v-if="
  424. $checkBtnRole('edit', $route.meta.roles) &&
  425. (!isDealer || (isDealer && scope.row.examineStatus === 'SAVE'))
  426. "
  427. type="text"
  428. @click="toForm(scope.row)"
  429. >
  430. 编辑
  431. </el-button>
  432. <el-button
  433. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
  434. type="text"
  435. @click="toExamine(scope.row)"
  436. >
  437. 审批
  438. </el-button>
  439. <el-button type="text" @click="toDetail(scope.row)"> 详情</el-button>
  440. <el-popconfirm
  441. v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'"
  442. style="margin-left: 10px"
  443. title="确定删除吗?"
  444. @onConfirm="handleDelete(scope.row.enginInfoId)"
  445. >
  446. <el-button slot="reference" type="text" style="color: #f56c6c">删除</el-button>
  447. </el-popconfirm>
  448. </template>
  449. </el-table-column>
  450. </el-table>
  451. </div>
  452. </div>
  453. <div class="pagination clearfix">
  454. <div class="fr">
  455. <el-pagination
  456. :current-page="currentPage"
  457. :page-sizes="[10, 20, 30, 50]"
  458. :page-size="10"
  459. layout="total, sizes, prev, pager, next, jumper"
  460. :total="listTotal"
  461. @size-change="handleSizeChange"
  462. @current-change="handleCurrentChange"
  463. />
  464. </div>
  465. </div>
  466. </div>
  467. <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" />
  468. <EnginDetail v-if="isShowDetail" :list-item="queryItem" @backListFormDetail="backList" />
  469. <EnginForm v-if="isShowForm" :list-item="queryItem" @backListFormDetail="backList" />
  470. <EnginExamine v-if="isShowExamine" :list-item="queryItem" @backListFormDetail="backList" />
  471. </div>
  472. </template>
  473. <script>
  474. import { getEnginList, applyEngin, withdrawEngin, deleteEngin, editDateEngin, abandonEngin } from '@/api/supply/engin'
  475. import { getSalesmanList, getTypeList } from '@/api/common'
  476. import EnginDetail from '@/views/supply/engin/components/engin_detail'
  477. import EnginForm from '@/views/supply/engin/components/engin_form'
  478. import EnginExamine from '@/views/supply/engin/components/engin_examine'
  479. import EditDateDialog from '@/components/Common/edit-date-dialog'
  480. import { getNoRebateWalletList } from '@/api/policy_list'
  481. let that
  482. export default {
  483. components: {
  484. EnginDetail,
  485. EnginForm,
  486. EnginExamine,
  487. EditDateDialog
  488. },
  489. filters: {
  490. statusFilter(val) {
  491. const obj = that.statusList.find(o => o.value == val)
  492. return obj ? obj.label : ''
  493. }
  494. },
  495. data() {
  496. return {
  497. currentPage: 1, // 当前页码
  498. pageSize: 10, // 每页数量
  499. listTotal: 0, // 列表总数
  500. dataList: null, // 列表数据
  501. listLoading: false, // 列表加载loading
  502. screenForm: {
  503. // 筛选表单数据
  504. orderNum: '',
  505. enginNum: '',
  506. loginNum: '',
  507. enginName: '',
  508. date: '',
  509. dealer: '',
  510. company: '',
  511. createMan: '',
  512. examineMan: '',
  513. status: '',
  514. salesMan: '',
  515. model: '',
  516. orderDate: '',
  517. isClose: '',
  518. isDirectTransfer: null,
  519. examineStatus: ''
  520. },
  521. statusList: [
  522. { label: '已保存', value: 'SAVE' },
  523. { label: '待审核', value: 'WAIT' },
  524. { label: '审核通过', value: 'OK' },
  525. // // { label: '审核驳回', value: 'FAIL' },,
  526. { label: '已关闭', value: 'CLOSE' }
  527. ],
  528. salesmanList: [],
  529. transfer: [
  530. { label: '是', value: true },
  531. { label: '否', value: false }
  532. ],
  533. queryItem: {},
  534. isShowDetail: false,
  535. isShowForm: false,
  536. isShowExamine: false,
  537. isCollapse: true,
  538. editId: null,
  539. NoRebateWalletList: [],
  540. typeList: [],
  541. isShowEditDateDialog: false,
  542. dateForm: {
  543. date: ''
  544. }
  545. }
  546. },
  547. computed: {
  548. isDealer() {
  549. return JSON.parse(localStorage.getItem('supply_user')).isCustomer
  550. },
  551. exParams() {
  552. return {
  553. enginInfoNo: this.screenForm.orderNum,
  554. projectNo: this.screenForm.enginNum,
  555. enginSignType: this.screenForm.loginNum,
  556. projectName: this.screenForm.enginName,
  557. startOrderDate: this.screenForm.orderDate ? this.screenForm.orderDate[0] : '',
  558. endOrderDate: this.screenForm.orderDate ? this.screenForm.orderDate[1] : '',
  559. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  560. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  561. customerKeyword: this.screenForm.dealer,
  562. useUnit: this.screenForm.company,
  563. createName: this.screenForm.createMan,
  564. confirmName: this.screenForm.examineMan,
  565. examineStatus: this.screenForm.examineStatus,
  566. isClose: this.screenForm.isClose,
  567. serviceId: this.screenForm.salesMan,
  568. specification: this.screenForm.model,
  569. isDirectTransfer: this.screenForm.isDirectTransfer
  570. }
  571. }
  572. },
  573. watch: {
  574. dataList: {
  575. handler(newValue, oldValue) {
  576. if (newValue && newValue.length) {
  577. newValue.forEach((item, index) => {
  578. this.dataList[index].compute_kdQty = this.computeAllowQty(item.qty, item.hasOrderQty)
  579. })
  580. }
  581. },
  582. immediate: true,
  583. deep: true
  584. }
  585. },
  586. beforeCreate() {
  587. that = this
  588. },
  589. created() {
  590. this.getSalesmanList()
  591. this.getList()
  592. },
  593. methods: {
  594. // 获取业务员列表
  595. getSalesmanList() {
  596. getSalesmanList({
  597. pageNum: 1,
  598. pageSize: -1,
  599. isCustomer: 0,
  600. status: true
  601. }).then(res => {
  602. this.salesmanList = res.data.records
  603. })
  604. getNoRebateWalletList({
  605. walletName: ''
  606. }).then(res => {
  607. console.log(res)
  608. this.NoRebateWalletList = res.data
  609. })
  610. getTypeList({ pageNum: 1, pageSize: -1 }).then(res => {
  611. this.typeList = res.data.records
  612. console.log(this.typeList)
  613. })
  614. },
  615. // 查询列表
  616. getList() {
  617. this.listLoading = true
  618. const params = {
  619. pageNum: this.currentPage,
  620. pageSize: this.pageSize,
  621. enginInfoNo: this.screenForm.orderNum,
  622. projectNo: this.screenForm.enginNum,
  623. enginSignType: this.screenForm.loginNum,
  624. projectName: this.screenForm.enginName,
  625. startOrderDate: this.screenForm.orderDate ? this.screenForm.orderDate[0] : '',
  626. endOrderDate: this.screenForm.orderDate ? this.screenForm.orderDate[1] : '',
  627. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  628. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  629. customerKeyword: this.screenForm.dealer,
  630. useUnit: this.screenForm.company,
  631. createName: this.screenForm.createMan,
  632. confirmName: this.screenForm.examineMan,
  633. examineStatus: this.screenForm.examineStatus,
  634. isClose: this.screenForm.isClose,
  635. serviceId: this.screenForm.salesMan,
  636. specification: this.screenForm.model,
  637. isDirectTransfer: this.screenForm.isDirectTransfer
  638. }
  639. getEnginList(params).then(res => {
  640. res.data.records.forEach(item => {
  641. item.sums1 = ['qty', 'hasOrderQty', 'compute_kdQty']
  642. item.sums2 = ['totalAmount', 'price']
  643. })
  644. this.dataList = res.data.records
  645. this.listTotal = res.data.total
  646. this.listLoading = false
  647. })
  648. },
  649. // 提交筛选表单
  650. submitScreenForm() {
  651. this.currentPage = 1
  652. this.getList()
  653. },
  654. // 重置筛选表单
  655. resetScreenForm() {
  656. this.$nextTick(()=>{
  657. this.$refs.screenForm.resetFields()
  658. })
  659. this.currentPage = 1
  660. this.getList()
  661. },
  662. // 更改每页数量
  663. handleSizeChange(val) {
  664. this.pageSize = val
  665. this.currentPage = 1
  666. this.getList()
  667. },
  668. // 更改当前页
  669. handleCurrentChange(val) {
  670. this.currentPage = val
  671. this.getList()
  672. },
  673. // 进入表单
  674. toForm(item) {
  675. this.queryItem = item
  676. this.isShowForm = true
  677. },
  678. // 进入审批
  679. toExamine(item) {
  680. this.queryItem = item
  681. this.isShowExamine = true
  682. },
  683. // 进入详情
  684. toDetail(item) {
  685. this.queryItem = item
  686. this.isShowDetail = true
  687. },
  688. backList() {
  689. this.queryItem = {}
  690. this.isShowDetail = false
  691. this.isShowForm = false
  692. this.isShowExamine = false
  693. },
  694. // 申请
  695. handleSubmit(id) {
  696. applyEngin({ id }).then(res => {
  697. this.$successMsg()
  698. this.getList()
  699. })
  700. },
  701. // 撤回
  702. handleWithdraw(id) {
  703. withdrawEngin({ id }).then(res => {
  704. this.$successMsg()
  705. this.getList()
  706. })
  707. },
  708. // 弃审
  709. handleAbandon(id) {
  710. abandonEngin({ id }).then(res => {
  711. this.$successMsg()
  712. this.getList()
  713. })
  714. },
  715. // 删除
  716. handleDelete(id) {
  717. deleteEngin({ ids: id }).then(res => {
  718. this.$successMsg()
  719. this.getList()
  720. })
  721. },
  722. // 打开 修改订单日期
  723. editDate(item) {
  724. this.editId = item.enginInfoId
  725. this.dateForm.date = item.orderDate.slice(0, 10)
  726. this.isShowEditDateDialog = true
  727. },
  728. // 提交 修改订单日期
  729. submitDateForm() {
  730. editDateEngin({
  731. enginInfoId: this.editId,
  732. orderDate: this.dateForm.date + ' 00:00:00'
  733. }).then(res => {
  734. this.isShowEditDateDialog = false
  735. this.getList()
  736. this.$successMsg('修改成功')
  737. })
  738. },
  739. computeAllowQty(qty = 0, hasOrderQty = 0) {
  740. const allowQty = qty - hasOrderQty
  741. if (allowQty < 0) {
  742. return 0
  743. }
  744. return allowQty
  745. }
  746. }
  747. }
  748. </script>
  749. <style lang="scss" scoped></style>