engin_list.vue 35 KB

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