apply_list.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowExamine && !isShowForm && !isShowReturnForm">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <Collapse :screen-form="screenForm">
  7. <template #left_btn>
  8. <el-radio-group v-model="screenForm.status" size="mini" @change="getList()">
  9. <el-radio-button label="">全部</el-radio-button>
  10. <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{
  11. item.label
  12. }}</el-radio-button>
  13. </el-radio-group>
  14. </template>
  15. <template #right_btn>
  16. <div>
  17. <el-button size="mini" @click="resetScreenForm">清空</el-button>
  18. <el-button type="primary" size="mini" @click="submitScreenForm">搜索</el-button>
  19. </div>
  20. </template>
  21. <template #search>
  22. <el-form ref="screenForm" :model="screenForm" label-width="100px" size="mini" label-position="left">
  23. <el-row :gutter="20">
  24. <el-col :xs="24" :sm="12" :lg="6">
  25. <el-form-item label="发货申请单" prop="orderNum">
  26. <el-input v-model="screenForm.orderNum" placeholder="请输入发货申请单" />
  27. </el-form-item>
  28. </el-col>
  29. <el-col :xs="24" :sm="12" :lg="6">
  30. <el-form-item label="仓库名称" prop="warehouse">
  31. <el-input v-model="screenForm.warehouse" placeholder="请输入仓库名称" />
  32. </el-form-item>
  33. </el-col>
  34. <el-col :xs="24" :sm="12" :lg="6">
  35. <el-form-item label="经销商编码" prop="jxsNum">
  36. <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编码" />
  37. </el-form-item>
  38. </el-col>
  39. <el-col :xs="24" :sm="12" :lg="6">
  40. <el-form-item label="经销商名称" prop="jxsName">
  41. <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称" />
  42. </el-form-item>
  43. </el-col>
  44. <el-col :xs="24" :sm="12" :lg="6">
  45. <el-form-item label="发货申请日期" prop="date">
  46. <el-date-picker
  47. v-model="screenForm.date"
  48. type="datetimerange"
  49. range-separator="至"
  50. style="width: 100%"
  51. value-format="yyyy-MM-dd HH:mm:ss"
  52. start-placeholder="开始日期"
  53. end-placeholder="结束日期"
  54. />
  55. </el-form-item>
  56. </el-col>
  57. <el-col :xs="24" :sm="12" :lg="6">
  58. <el-form-item label="产品名称" prop="chName">
  59. <el-input v-model="screenForm.chName" placeholder="请输入产品名称" />
  60. </el-form-item>
  61. </el-col>
  62. <el-col :xs="24" :sm="12" :lg="6">
  63. <el-form-item label="规格型号" prop="model">
  64. <el-input v-model="screenForm.model" placeholder="请输入规格型号" />
  65. </el-form-item>
  66. </el-col>
  67. <el-col :xs="24" :sm="12" :lg="6">
  68. <el-form-item label="表头业务员" prop="k3ServiceId">
  69. <el-select
  70. v-model="screenForm.k3ServiceId"
  71. placeholder="选择表头业务员"
  72. size="small"
  73. clearable
  74. filterable
  75. style="width: 100%"
  76. >
  77. <el-option
  78. v-for="item in salesmanList"
  79. :key="item.adminUserId"
  80. :label="item.nickName"
  81. :value="item.adminUserId"
  82. />
  83. </el-select>
  84. </el-form-item>
  85. </el-col>
  86. <el-col :xs="24" :sm="12" :lg="6">
  87. <el-form-item label="表体业务员" prop="serviceId">
  88. <el-select
  89. v-model="screenForm.serviceId"
  90. placeholder="选择表体业务员"
  91. size="mini"
  92. clearable
  93. filterable
  94. style="width: 100%"
  95. >
  96. <el-option
  97. v-for="item in salesmanList"
  98. :key="item.adminUserId"
  99. :label="item.nickName"
  100. :value="item.adminUserId"
  101. />
  102. </el-select>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :xs="24" :sm="12" :lg="6">
  106. <el-form-item label="订单类型" prop="orderType">
  107. <el-select v-model="screenForm.orderType" placeholder="请选择" clearable>
  108. <el-option
  109. v-for="item in orderTypeList"
  110. :key="item.value"
  111. :label="item.label"
  112. :value="item.value"
  113. />
  114. </el-select>
  115. </el-form-item>
  116. </el-col>
  117. <el-col :xs="24" :sm="12" :lg="6">
  118. <el-form-item label="订单号" prop="mainOrderId">
  119. <el-input v-model="screenForm.mainOrderId" placeholder="请输入订单号" />
  120. </el-form-item>
  121. </el-col>
  122. <el-col :xs="24" :sm="12" :lg="6">
  123. <el-form-item label="产品类别">
  124. <el-select
  125. v-model="screenForm.categoryId"
  126. style="width: 100%"
  127. placeholder="选择产品类别"
  128. filterable
  129. clearable
  130. >
  131. <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.id" />
  132. </el-select>
  133. </el-form-item>
  134. </el-col>
  135. <el-col :xs="24" :sm="12" :lg="6">
  136. <el-form-item label="审核人" prop="approvalName">
  137. <el-input v-model="screenForm.approvalName" placeholder="请输入审核人" />
  138. </el-form-item>
  139. </el-col>
  140. <el-col :xs="24" :sm="12" :lg="6">
  141. <el-form-item label="制单人" prop="createBy">
  142. <el-input v-model="screenForm.createBy" placeholder="请输入制单人" />
  143. </el-form-item>
  144. </el-col>
  145. <el-col :xs="24" :sm="12" :lg="6"> </el-col>
  146. </el-row>
  147. </el-form>
  148. </template>
  149. </Collapse>
  150. </div>
  151. <div class="mymain-container">
  152. <div class="btn-group clearfix">
  153. <div class="fl">
  154. <el-button
  155. v-if="$checkBtnRole('add', $route.meta.roles)"
  156. size="mini"
  157. type="primary"
  158. icon="el-icon-plus"
  159. @click="toForm()"
  160. >发货申请</el-button
  161. >
  162. <el-button
  163. v-if="$checkBtnRole('refund', $route.meta.roles)"
  164. size="mini"
  165. type="primary"
  166. icon="el-icon-plus"
  167. @click="toReturnForm()"
  168. >退货申请</el-button
  169. >
  170. <el-button
  171. v-if="$checkBtnRole('examine', $route.meta.roles)"
  172. size="mini"
  173. type="warning"
  174. icon="el-icon-finished"
  175. :disabled="multipleSelection.length < 1"
  176. @click="batchExamine"
  177. >批量审批</el-button
  178. >
  179. </div>
  180. <div class="fr">
  181. <ExportButton :ex-url="'invoice/listExport'" :ex-params="exParams" />
  182. </div>
  183. </div>
  184. <div class="table">
  185. <el-table
  186. v-loading="listLoading"
  187. :data="dataList"
  188. element-loading-text="Loading"
  189. border
  190. fit
  191. :row-style="rowClass"
  192. show-summary
  193. :summary-method="$getSummaries"
  194. @selection-change="handleSelectionChange"
  195. >
  196. <el-table-column align="center" type="selection" width="55" fixed="left" :selectable="selectable" />
  197. <el-table-column align="left" label="订单状态" prop="type" min-width="120" show-overflow-tooltip>
  198. <template slot-scope="scope">
  199. {{ scope.row.automaticStatus ? '非计划单推发货' : '计划单推发货' }}
  200. </template>
  201. </el-table-column>
  202. <el-table-column align="left" label="订单类型" prop="type" min-width="100" show-overflow-tooltip>
  203. <template slot-scope="scope">
  204. {{ scope.row.type | orderTypeFilter }}
  205. </template>
  206. </el-table-column>
  207. <el-table-column align="left" label="发货申请单" prop="id" min-width="130" show-overflow-tooltip>
  208. <template slot-scope="scope">
  209. <CopyButton :copy-text="scope.row.id" />
  210. <span>{{ scope.row.id }}</span>
  211. </template>
  212. </el-table-column>
  213. <el-table-column
  214. align="left"
  215. label="发货申请日期"
  216. prop="createTime"
  217. min-width="160"
  218. show-overflow-tooltip
  219. />
  220. <el-table-column align="left" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip>
  221. <template slot-scope="scope">
  222. {{ scope.row.type === 3 ? scope.row.stockName : scope.row.correspondName }}
  223. </template>
  224. </el-table-column>
  225. <el-table-column align="left" label="订单号" prop="mainOrderId" min-width="140" show-overflow-tooltip>
  226. <template slot-scope="scope">
  227. <CopyButton :copy-text="scope.row.mainOrderId" />
  228. <span>{{ scope.row.mainOrderId }}</span>
  229. </template>
  230. </el-table-column>
  231. <el-table-column
  232. align="left"
  233. label="经销商编码"
  234. prop="customerNumber"
  235. min-width="100"
  236. show-overflow-tooltip
  237. >
  238. <template slot-scope="scope">
  239. <CopyButton :copy-text="scope.row.customerNumber" />
  240. <span>{{ scope.row.customerNumber }}</span>
  241. </template>
  242. </el-table-column>
  243. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  244. <template slot-scope="scope">
  245. <CopyButton :copy-text="scope.row.customerName" />
  246. <span>{{ scope.row.customerName }}</span>
  247. </template>
  248. </el-table-column>
  249. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  250. <template slot-scope="scope">
  251. <CopyButton :copy-text="scope.row.materialCode" />
  252. <span>{{ scope.row.materialCode }}</span>
  253. </template>
  254. </el-table-column>
  255. <el-table-column
  256. align="left"
  257. label="产品编码"
  258. prop="materialOldNumber"
  259. min-width="140"
  260. show-overflow-tooltip
  261. >
  262. <template slot-scope="scope">
  263. <CopyButton :copy-text="scope.row.materialOldNumber" />
  264. <span>{{ scope.row.materialOldNumber }}</span>
  265. </template>
  266. </el-table-column>
  267. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  268. <template slot-scope="scope">
  269. <CopyButton :copy-text="scope.row.materialName" />
  270. <span>{{ scope.row.materialName }}</span>
  271. </template>
  272. </el-table-column>
  273. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  274. <template slot-scope="scope">
  275. <CopyButton :copy-text="scope.row.specification" />
  276. <span>{{ scope.row.specification }}</span>
  277. </template>
  278. </el-table-column>
  279. <el-table-column align="left" label="产品类别" prop="categoryName" min-width="100" show-overflow-tooltip>
  280. <template slot-scope="scope">
  281. <span>{{ scope.row.categoryName }}</span>
  282. </template>
  283. </el-table-column>
  284. <el-table-column
  285. align="left"
  286. label="销售政策名称"
  287. prop="policyTitle"
  288. min-width="100"
  289. show-overflow-tooltip
  290. />
  291. <el-table-column align="left" label="文件编号" prop="itemFileNo" min-width="100" show-overflow-tooltip />
  292. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  293. <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip />
  294. <el-table-column align="right" label="已退数量" prop="retiredQty" min-width="100" show-overflow-tooltip />
  295. <el-table-column align="right" label="含税单价" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
  296. <template slot-scope="scope">
  297. {{ scope.row.singlePayPrice | numToFixed }}
  298. </template>
  299. </el-table-column>
  300. <el-table-column align="right" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip>
  301. <template slot-scope="scope">
  302. {{ scope.row.payAmount | numToFixed }}
  303. </template>
  304. </el-table-column>
  305. <el-table-column
  306. align="right"
  307. label="返利金额"
  308. prop="payRebateAmount"
  309. min-width="100"
  310. show-overflow-tooltip
  311. >
  312. <template slot-scope="scope">
  313. {{ scope.row.payRebateAmount | numToFixed }}
  314. </template>
  315. </el-table-column>
  316. <el-table-column
  317. align="right"
  318. label="格力折扣"
  319. prop="totalDiscAmount"
  320. min-width="100"
  321. show-overflow-tooltip
  322. >
  323. <template slot-scope="scope">
  324. {{ scope.row.totalDiscAmount | numToFixed }}
  325. </template>
  326. </el-table-column>
  327. <el-table-column align="left" label="订单备注" prop="headerRemark" min-width="160" show-overflow-tooltip />
  328. <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip />
  329. <el-table-column align="left" label="表体备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip />
  330. <el-table-column
  331. align="left"
  332. label="审批说明"
  333. prop="approvalRemark"
  334. min-width="160"
  335. show-overflow-tooltip
  336. />
  337. <el-table-column align="left" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip />
  338. <el-table-column
  339. align="left"
  340. label="表头业务员"
  341. prop="k3ServiceName"
  342. min-width="100"
  343. show-overflow-tooltip
  344. />
  345. <el-table-column align="left" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip />
  346. <el-table-column align="left" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip />
  347. <el-table-column align="left" label="审核人" prop="approvalName" min-width="100" show-overflow-tooltip />
  348. <el-table-column align="left" label="审核日期" prop="approvalTime" min-width="160" show-overflow-tooltip />
  349. <el-table-column align="left" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  350. <template slot-scope="scope">
  351. {{ scope.row.examineStatus | statusFilter }}
  352. </template>
  353. </el-table-column>
  354. <el-table-column
  355. v-if="this.$store.getters.customerNumber === '100093' || this.$store.getters.customerNumber === '600023'"
  356. align="left"
  357. label="同步到格匠采购入库单"
  358. prop="gejiangSync"
  359. min-width="160"
  360. show-overflow-tooltip
  361. >
  362. <template slot-scope="scope">
  363. {{ scope.row.gejiangSync === 1 ? '同步成功' : scope.row.gejiangSync === 0 ? '待同步' : '同步失败' }}
  364. </template>
  365. </el-table-column>
  366. <el-table-column
  367. align="left"
  368. v-if="this.$store.getters.customerNumber === '100093' || this.$store.getters.customerNumber === '600023'"
  369. label="同步格匠失败原因"
  370. prop="gejiangSyncRemark"
  371. min-width="160"
  372. show-overflow-tooltip
  373. />
  374. <el-table-column align="center" label="操作" width="180" fixed="right">
  375. <template slot-scope="scope">
  376. <el-popconfirm
  377. v-if="
  378. $checkBtnRole('apply', $route.meta.roles) &&
  379. !scope.row.automaticStatus &&
  380. scope.row.examineStatus === 'SAVE'
  381. "
  382. style="margin-right: 10px"
  383. title="确定申请吗?"
  384. @onConfirm="handleSubmit(scope.row.id, 'WAIT')"
  385. >
  386. <el-button slot="reference" type="text">申请</el-button>
  387. </el-popconfirm>
  388. <el-popconfirm
  389. v-if="
  390. $checkBtnRole('apply', $route.meta.roles) &&
  391. !scope.row.automaticStatus &&
  392. scope.row.examineStatus === 'WAIT'
  393. "
  394. style="margin-right: 10px"
  395. title="确定撤回吗?"
  396. @onConfirm="handleSubmit(scope.row.id, 'SAVE')"
  397. >
  398. <el-button slot="reference" type="text">撤回</el-button>
  399. </el-popconfirm>
  400. <el-popconfirm
  401. v-if="
  402. $checkBtnRole('examine', $route.meta.roles) &&
  403. !scope.row.automaticStatus &&
  404. scope.row.examineStatus === 'OK'
  405. "
  406. style="margin-right: 10px"
  407. title="确定弃审吗?"
  408. @onConfirm="handleAbandon(scope.row.id)"
  409. >
  410. <el-button slot="reference" type="text">弃审</el-button>
  411. </el-popconfirm>
  412. <el-button
  413. v-if="
  414. $checkBtnRole('edit', $route.meta.roles) &&
  415. !scope.row.automaticStatus &&
  416. (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL') &&
  417. scope.row.type === 1
  418. "
  419. type="text"
  420. @click="toForm(scope.row)"
  421. >
  422. 编辑
  423. </el-button>
  424. <el-button
  425. v-if="
  426. $checkBtnRole('edit', $route.meta.roles) &&
  427. !scope.row.automaticStatus &&
  428. (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL') &&
  429. scope.row.type === 2
  430. "
  431. type="text"
  432. @click="toReturnForm(scope.row)"
  433. >
  434. 编辑
  435. </el-button>
  436. <el-button
  437. v-if="
  438. $checkBtnRole('examine', $route.meta.roles) &&
  439. !scope.row.automaticStatus &&
  440. scope.row.examineStatus === 'WAIT'
  441. "
  442. type="text"
  443. @click="toExamine(scope.row)"
  444. >
  445. 审单
  446. </el-button>
  447. <el-button type="text" @click="toDetail(scope.row)"> 详情 </el-button>
  448. <el-popconfirm
  449. v-if="
  450. $checkBtnRole('del', $route.meta.roles) &&
  451. !scope.row.automaticStatus &&
  452. scope.row.type == 2 &&
  453. (scope.row.examineStatus !== 'OK' || scope.row.examineStatus === 'SAVE')
  454. "
  455. style="margin-left: 10px"
  456. title="确定删除吗?"
  457. @onConfirm="handleDelete(scope.row.id)"
  458. >
  459. <el-button slot="reference" type="text" style="color: #f56c6c">删除</el-button>
  460. </el-popconfirm>
  461. </template>
  462. </el-table-column>
  463. </el-table>
  464. </div>
  465. </div>
  466. <div class="pagination clearfix">
  467. <div class="fr">
  468. <el-pagination
  469. :current-page="currentPage"
  470. :page-sizes="[10, 20, 30, 50]"
  471. :page-size="10"
  472. layout="total, sizes, prev, pager, next, jumper"
  473. :total="listTotal"
  474. @size-change="handleSizeChange"
  475. @current-change="handleCurrentChange"
  476. />
  477. </div>
  478. </div>
  479. </div>
  480. <ExamineDialog :is-show.sync="isShowExamineDialog" :examine-form.sync="examineForm" />
  481. <ApplyDetail v-if="isShowDetail" ref="refDetail" :list-item="queryItem" @backListFormDetail="backList" />
  482. <ApplyExamine v-if="isShowExamine" :list-item="queryItem" @backListFormDetail="backList" />
  483. <ApplyForm v-if="isShowForm" :list-item="queryItem" @backListFormDetail="backList" />
  484. <ApplyReturnForm v-if="isShowReturnForm" :list-item="queryItem" :is-show="isShow" @backListFormDetail="backList" />
  485. </div>
  486. </template>
  487. <script>
  488. import { getApplyList, submitApply, deleteApply, abandonApply, examineBatchApply } from '@/api/supply/apply'
  489. import { getCategoryList, getSalesmanList } from '@/api/common'
  490. import ApplyDetail from '@/views/supply/apply/components/apply_detail'
  491. import ApplyExamine from '@/views/supply/apply/components/apply_examine'
  492. import ApplyForm from '@/views/supply/apply/components/apply_form'
  493. import ApplyReturnForm from '@/views/supply/apply/components/apply_return_form'
  494. import ExamineDialog from '@/components/Common/examine-dialog'
  495. let that
  496. export default {
  497. components: {
  498. ApplyDetail,
  499. ApplyExamine,
  500. ApplyForm,
  501. ApplyReturnForm,
  502. ExamineDialog
  503. },
  504. filters: {
  505. statusFilter(val) {
  506. const obj = that.statusList.find(o => o.value == val)
  507. return obj ? obj.label : ''
  508. },
  509. orderTypeFilter(val) {
  510. const obj = that.orderTypeList.find(o => o.value == val)
  511. return obj ? obj.label : ''
  512. }
  513. },
  514. data() {
  515. return {
  516. currentPage: 1, // 当前页码
  517. pageSize: 10, // 每页数量
  518. listTotal: 0, // 列表总数
  519. dataList: null, // 列表数据
  520. listLoading: false, // 列表加载loading
  521. screenForm: {
  522. // 筛选表单数据
  523. status: '',
  524. orderNum: '',
  525. warehouse: '',
  526. jxsNum: '',
  527. jxsName: '',
  528. date: '',
  529. chName: '',
  530. model: '',
  531. salesMan: '',
  532. orderType: '',
  533. mainOrderId: '',
  534. k3ServiceId: '',
  535. serviceId: '',
  536. categoryId: '',
  537. approvalName: '',
  538. createBy: ''
  539. },
  540. statusList: [
  541. { label: '已保存', value: 'SAVE' },
  542. { label: '待审核', value: 'WAIT' },
  543. { label: '审核通过', value: 'OK' },
  544. // // { label: '审核驳回', value: 'FAIL' },,
  545. { label: '已关闭', value: 'CLOSE' }
  546. ],
  547. orderTypeList: [
  548. { label: '发货申请单', value: 1 },
  549. { label: '退货申请单', value: 2 },
  550. { label: '直调发货单', value: 3 }
  551. ],
  552. salesmanList: [],
  553. queryItem: {},
  554. isShowDetail: false,
  555. isShowExamine: false,
  556. isShowForm: false,
  557. isShowReturnForm: false,
  558. selectRow: [],
  559. multipleSelection: [],
  560. isShowExamineDialog: false,
  561. examineForm: {
  562. status: '',
  563. remark: ''
  564. },
  565. categoryList: []
  566. }
  567. },
  568. computed: {
  569. exParams() {
  570. return {
  571. id: this.screenForm.orderNum,
  572. correspondName: this.screenForm.warehouse,
  573. customerNumber: this.screenForm.jxsNum,
  574. customerName: this.screenForm.jxsName,
  575. productName: this.screenForm.chName,
  576. specification: this.screenForm.model,
  577. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  578. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  579. examineStatus: this.screenForm.status,
  580. k3ServiceId: this.screenForm.k3ServiceId,
  581. serviceId: this.screenForm.serviceId,
  582. createBy: this.screenForm.createBy,
  583. type: this.screenForm.orderType,
  584. mainOrderId: this.screenForm.mainOrderId,
  585. categoryId: this.screenForm.categoryId,
  586. approvalName: this.screenForm.approvalName
  587. }
  588. }
  589. },
  590. watch: {
  591. multipleSelection(data) {
  592. // 监听选中状态
  593. this.selectRow = []
  594. if (data.length > 0) {
  595. data.forEach((item, index) => {
  596. this.selectRow.push(item.id)
  597. })
  598. }
  599. }
  600. },
  601. beforeCreate() {
  602. that = this
  603. },
  604. created() {
  605. this.getSalesmanList()
  606. this.getList()
  607. this.getCategoryList()
  608. this.isShow = false
  609. if (this.$route.query && this.$route.query.isShow) {
  610. this.isShow = this.$route.query.isShow
  611. this.toReturnForm()
  612. }
  613. },
  614. // activated() {
  615. // this.isShow = false
  616. // if (this.$route.query && this.$route.query.isShow) {
  617. // this.isShow = this.$route.query.isShow
  618. // this.toReturnForm()
  619. // }
  620. // },
  621. methods: {
  622. // 获取业务员列表
  623. getSalesmanList() {
  624. getSalesmanList({
  625. pageNum: 1,
  626. pageSize: -1,
  627. isCustomer: 0,
  628. status: true
  629. }).then(res => {
  630. this.salesmanList = res.data.records
  631. })
  632. },
  633. // 查询列表
  634. getList() {
  635. this.listLoading = true
  636. const params = {
  637. pageNum: this.currentPage,
  638. pageSize: this.pageSize,
  639. id: this.screenForm.orderNum,
  640. correspondName: this.screenForm.warehouse,
  641. customerNumber: this.screenForm.jxsNum,
  642. createBy: this.screenForm.createBy,
  643. customerName: this.screenForm.jxsName,
  644. productName: this.screenForm.chName,
  645. specification: this.screenForm.model,
  646. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  647. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  648. examineStatus: this.screenForm.status,
  649. serviceId: this.screenForm.salesMan,
  650. type: this.screenForm.orderType,
  651. k3ServiceId: this.screenForm.k3ServiceId,
  652. mainOrderId: this.screenForm.mainOrderId,
  653. categoryId: this.screenForm.categoryId,
  654. approvalName: this.screenForm.approvalName
  655. }
  656. getApplyList(params).then(res => {
  657. res.data.records.forEach(item => {
  658. item.sums1 = ['refundableQty', 'retiredQty']
  659. item.sums2 = ['singlePayPrice', 'payAmount', 'payRebateAmount', 'totalDiscAmount']
  660. })
  661. this.dataList = res.data.records
  662. this.listTotal = res.data.total
  663. this.listLoading = false
  664. })
  665. },
  666. // 提交筛选表单
  667. submitScreenForm() {
  668. this.currentPage = 1
  669. this.getList()
  670. },
  671. handleCollapse() {
  672. this.isCollapse = !this.isCollapse
  673. },
  674. // 重置筛选表单
  675. resetScreenForm() {
  676. this.$refs.screenForm.resetFields()
  677. this.currentPage = 1
  678. this.getList()
  679. },
  680. // 更改每页数量
  681. handleSizeChange(val) {
  682. this.pageSize = val
  683. this.currentPage = 1
  684. this.getList()
  685. },
  686. // 更改当前页
  687. handleCurrentChange(val) {
  688. this.currentPage = val
  689. this.getList()
  690. },
  691. // 进入表单
  692. toForm(item) {
  693. this.queryItem = item
  694. this.isShowForm = true
  695. },
  696. // 进入表单
  697. toReturnForm(item) {
  698. this.queryItem = item
  699. this.isShowReturnForm = true
  700. },
  701. // 进入审批
  702. toExamine(item) {
  703. this.queryItem = item
  704. this.isShowExamine = true
  705. },
  706. // 进入详情
  707. toDetail(item) {
  708. this.queryItem = item
  709. this.isShowDetail = true
  710. this.$nextTick(() => {
  711. this.$refs.refDetail.initPrint()
  712. })
  713. // this.$refs.refDetail.initPrint()
  714. },
  715. backList() {
  716. this.queryItem = {}
  717. this.isShowDetail = false
  718. this.isShowExamine = false
  719. this.isShowForm = false
  720. this.isShowReturnForm = false
  721. },
  722. handleDelete(id) {
  723. deleteApply({ id }).then(res => {
  724. this.$successMsg()
  725. this.getList()
  726. })
  727. },
  728. // 申请/撤回
  729. handleSubmit(id, examineStatus) {
  730. submitApply({ id, examineStatus }).then(res => {
  731. this.$successMsg()
  732. this.getList()
  733. })
  734. },
  735. // 弃审
  736. handleAbandon(id) {
  737. abandonApply({ id }).then(res => {
  738. this.$successMsg()
  739. this.getList()
  740. })
  741. },
  742. handleSelectionChange(val) {
  743. this.multipleSelection = val
  744. if (val) {
  745. this.selections = val
  746. } else {
  747. this.selections = []
  748. }
  749. },
  750. rowClass({ row, rowIndex }) {
  751. if (this.selectRow.includes(row.id)) {
  752. return { 'background-color': '#ecf5ff' }
  753. }
  754. },
  755. // 打开 批量审批
  756. batchExamine() {
  757. this.isShowExamineDialog = true
  758. },
  759. // 提交 批量审批
  760. submitExamineForm() {
  761. let ids = this.multipleSelection.map(item => {
  762. return item.id
  763. })
  764. ids = Array.from(new Set(ids))
  765. examineBatchApply({
  766. ids: ids.join(','),
  767. examineStatus: this.examineForm.status,
  768. approvalRemark: this.examineForm.remark
  769. }).then(res => {
  770. this.isShowExamineDialog = false
  771. this.getList()
  772. this.$successMsg('审批成功')
  773. })
  774. },
  775. // 获取存货类别列表
  776. getCategoryList() {
  777. getCategoryList({
  778. pageNum: 1,
  779. pageSize: -1
  780. }).then(res => {
  781. this.categoryList = res.data.records
  782. })
  783. },
  784. /**
  785. * 根据条件禁用行复选框
  786. * 函数返回值为false则禁用选择(反之亦然)
  787. * @param {Object} row - 行数据
  788. * @param {String} index - 索引值
  789. * @return Boolean
  790. */
  791. selectable: function (row, index) {
  792. if (row.automaticStatus) {
  793. return false
  794. }
  795. return true
  796. // 函数必须有返回值且是布尔值
  797. // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
  798. // 如果没有返回值则默认返回false(全部无法选中)
  799. }
  800. }
  801. }
  802. </script>
  803. <style lang="scss" scoped></style>