engin_list.vue 34 KB

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