direct_list.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowExamine && !isShowForm">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <Collapse :screen-form="screenForm">
  7. <template #right_btn>
  8. <el-button size="mini" @click="resetScreenForm">清空</el-button>
  9. <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
  10. </template>
  11. <template #left_btn>
  12. <div>
  13. <el-radio-group v-model="screenForm.status" @change="getList()" size="mini">
  14. <el-radio-button label="">全部</el-radio-button>
  15. <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{
  16. item.label
  17. }}</el-radio-button>
  18. </el-radio-group>
  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="请输入直接调拨单号"></el-input>
  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="请输入仓库"></el-input>
  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="请输入经销商编码"></el-input>
  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="请输入经销商名称"></el-input>
  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-date-picker>
  56. </el-form-item>
  57. </el-col>
  58. <el-col :xs="24" :sm="12" :lg="6">
  59. <el-form-item label="产品名称" prop="chName">
  60. <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
  61. </el-form-item>
  62. </el-col>
  63. <el-col :xs="24" :sm="12" :lg="6">
  64. <el-form-item label="规格型号" prop="model">
  65. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  66. </el-form-item>
  67. </el-col>
  68. </el-row>
  69. </el-form>
  70. </template>
  71. </Collapse>
  72. </div>
  73. <div class="mymain-container">
  74. <div class="btn-group clearfix">
  75. <div class="fl">
  76. <el-button
  77. size="mini"
  78. type="danger"
  79. icon="el-icon-minus"
  80. :disabled="multipleSelection.length < 1"
  81. @click="batchDelete()"
  82. v-if="$checkBtnRole('del', $route.meta.roles)"
  83. >批量删除</el-button
  84. >
  85. </div>
  86. <div class="fr">
  87. <ExportButton :exUrl="'requisition/export'" :exParams="exParams" />
  88. </div>
  89. </div>
  90. <div class="table">
  91. <el-table
  92. v-loading="listLoading"
  93. :data="dataList"
  94. element-loading-text="Loading"
  95. border
  96. fit
  97. highlight-current-row
  98. stripe
  99. @selection-change="handleSelectionChange"
  100. >
  101. <el-table-column align="center" type="selection" width="55"></el-table-column>
  102. <el-table-column align="left" label="直接调拨单号" prop="id" min-width="190" show-overflow-tooltip>
  103. <template slot-scope="scope">
  104. <CopyButton :copyText="scope.row.id" />
  105. <span>{{ scope.row.id }}</span>
  106. </template>
  107. </el-table-column>
  108. <el-table-column align="left" label="订单号" prop="mainOrderId" min-width="140" show-overflow-tooltip>
  109. <template slot-scope="scope">
  110. <CopyButton
  111. :copyText="
  112. scope.row.orderType === 'TRADE' ||
  113. scope.row.orderType === 'HOME' ||
  114. scope.row.orderType === 'REQUISITION_TRADE' ||
  115. scope.row.orderType === 'REQUISITION_HOME'
  116. ? scope.row.enginOrderNo
  117. : scope.row.mainOrderId
  118. "
  119. />
  120. <span>{{
  121. scope.row.orderType === 'TRADE' ||
  122. scope.row.orderType === 'HOME' ||
  123. scope.row.orderType === 'REQUISITION_TRADE' ||
  124. scope.row.orderType === 'REQUISITION_HOME'
  125. ? scope.row.enginOrderNo
  126. : scope.row.mainOrderId
  127. }}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column align="left" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  131. <template slot-scope="scope">
  132. {{ scope.row.examineStatus | statusFilter }}
  133. </template>
  134. </el-table-column>
  135. <el-table-column
  136. align="left"
  137. label="单据日期"
  138. prop="orderTime"
  139. min-width="160"
  140. show-overflow-tooltip
  141. ></el-table-column>
  142. <el-table-column
  143. align="left"
  144. label="经销商编码"
  145. prop="customerNumber"
  146. min-width="100"
  147. show-overflow-tooltip
  148. >
  149. <template slot-scope="scope">
  150. <CopyButton :copyText="scope.row.customerNumber" />
  151. <span>{{ scope.row.customerNumber }}</span>
  152. </template>
  153. </el-table-column>
  154. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  155. <template slot-scope="scope">
  156. <CopyButton :copyText="scope.row.customerName" />
  157. <span>{{ scope.row.customerName }}</span>
  158. </template>
  159. </el-table-column>
  160. <el-table-column
  161. align="left"
  162. label="调拨方向"
  163. prop="direction"
  164. min-width="100"
  165. show-overflow-tooltip
  166. ></el-table-column>
  167. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  168. <template slot-scope="scope">
  169. <CopyButton :copyText="scope.row.materialCode" />
  170. <span>{{ scope.row.materialCode }}</span>
  171. </template>
  172. </el-table-column>
  173. <el-table-column
  174. align="left"
  175. label="产品编码"
  176. prop="materialOldNumber"
  177. min-width="140"
  178. show-overflow-tooltip
  179. >
  180. <template slot-scope="scope">
  181. <CopyButton :copyText="scope.row.materialOldNumber" />
  182. <span>{{ scope.row.materialOldNumber }}</span>
  183. </template>
  184. </el-table-column>
  185. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  186. <template slot-scope="scope">
  187. <CopyButton :copyText="scope.row.materialName" />
  188. <span>{{ scope.row.materialName }}</span>
  189. </template>
  190. </el-table-column>
  191. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  192. <template slot-scope="scope">
  193. <CopyButton :copyText="scope.row.specification" />
  194. <span>{{ scope.row.specification }}</span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column
  198. align="left"
  199. label="单位"
  200. prop="unit"
  201. min-width="100"
  202. show-overflow-tooltip
  203. ></el-table-column>
  204. <el-table-column
  205. align="left"
  206. label="调拨数量"
  207. prop="qty"
  208. min-width="100"
  209. show-overflow-tooltip
  210. ></el-table-column>
  211. <el-table-column
  212. align="left"
  213. label="调出仓库"
  214. prop="correspondName"
  215. min-width="100"
  216. show-overflow-tooltip
  217. ></el-table-column>
  218. <el-table-column
  219. align="left"
  220. label="调出仓位"
  221. prop="stockName"
  222. min-width="100"
  223. show-overflow-tooltip
  224. ></el-table-column>
  225. <el-table-column
  226. align="left"
  227. label="调入仓库"
  228. prop="inCorrespondName"
  229. min-width="100"
  230. show-overflow-tooltip
  231. ></el-table-column>
  232. <el-table-column
  233. align="left"
  234. label="调入仓位"
  235. prop="inStockName"
  236. min-width="100"
  237. show-overflow-tooltip
  238. ></el-table-column>
  239. <el-table-column
  240. align="left"
  241. label="备注信息"
  242. prop="remark"
  243. min-width="160"
  244. show-overflow-tooltip
  245. ></el-table-column>
  246. <el-table-column
  247. align="left"
  248. label="制单人"
  249. prop="createBy"
  250. min-width="100"
  251. show-overflow-tooltip
  252. ></el-table-column>
  253. <el-table-column
  254. align="left"
  255. label="制单日期"
  256. prop="createTime"
  257. min-width="160"
  258. show-overflow-tooltip
  259. ></el-table-column>
  260. <el-table-column
  261. align="left"
  262. label="审核人"
  263. prop="approvalName"
  264. min-width="100"
  265. show-overflow-tooltip
  266. ></el-table-column>
  267. <el-table-column
  268. align="left"
  269. label="审核日期"
  270. prop="approvalTime"
  271. min-width="160"
  272. show-overflow-tooltip
  273. ></el-table-column>
  274. <el-table-column align="center" label="操作" width="180" fixed="right">
  275. <template slot-scope="scope">
  276. <el-button
  277. type="text"
  278. @click="toForm(scope.row)"
  279. v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'"
  280. >编辑</el-button
  281. >
  282. <el-button
  283. type="text"
  284. @click="toExamine(scope.row)"
  285. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
  286. >审单</el-button
  287. >
  288. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  289. <el-popconfirm
  290. style="margin-left: 10px"
  291. title="确定删除吗?"
  292. @onConfirm="handleDelete(scope.row.id)"
  293. v-if="$checkBtnRole('del', $route.meta.roles)"
  294. >
  295. <el-button slot="reference" type="text">删除</el-button>
  296. </el-popconfirm>
  297. </template>
  298. </el-table-column>
  299. </el-table>
  300. </div>
  301. </div>
  302. <div class="pagination clearfix">
  303. <div class="fr">
  304. <el-pagination
  305. @size-change="handleSizeChange"
  306. @current-change="handleCurrentChange"
  307. :current-page="currentPage"
  308. :page-sizes="[10, 20, 30, 50]"
  309. :page-size="10"
  310. layout="total, sizes, prev, pager, next, jumper"
  311. :total="listTotal"
  312. >
  313. </el-pagination>
  314. </div>
  315. </div>
  316. </div>
  317. <DirectDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  318. <DirectExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  319. <DirectForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  320. </div>
  321. </template>
  322. <script>
  323. import { getList, submitApply, deleteData } from '@/api/supply/direct'
  324. import DirectDetail from '@/views/supply/direct/components/direct_detail'
  325. import DirectExamine from '@/views/supply/direct/components/direct_examine'
  326. import DirectForm from '@/views/supply/direct/components/direct_form'
  327. let that
  328. export default {
  329. components: {
  330. DirectDetail,
  331. DirectExamine,
  332. DirectForm
  333. },
  334. filters: {
  335. statusFilter(val) {
  336. let obj = that.statusList.find(o => o.value == val)
  337. return obj ? obj.label : ''
  338. }
  339. },
  340. data() {
  341. return {
  342. currentPage: 1, // 当前页码
  343. pageSize: 10, // 每页数量
  344. listTotal: 0, // 列表总数
  345. dataList: null, // 列表数据
  346. listLoading: false, // 列表加载loading
  347. screenForm: {
  348. // 筛选表单数据
  349. orderNum: '',
  350. warehouse: '',
  351. jxsNum: '',
  352. jxsName: '',
  353. date: '',
  354. chName: '',
  355. model: '',
  356. status: ''
  357. },
  358. statusList: [
  359. { label: '已保存', value: 'SAVE' },
  360. { label: '待审核', value: 'WAIT' },
  361. { label: '审核通过', value: 'OK' },
  362. // // { label: '审核驳回', value: 'FAIL' },,
  363. { label: '已关闭', value: 'CLOSE' }
  364. ],
  365. isCollapse: true,
  366. queryItem: {},
  367. isShowDetail: false,
  368. isShowExamine: false,
  369. isShowForm: false,
  370. multipleSelection: []
  371. }
  372. },
  373. computed: {
  374. exParams() {
  375. return {
  376. id: this.screenForm.orderNum,
  377. correspondId: this.screenForm.warehouse,
  378. customerNumber: this.screenForm.jxsNum,
  379. customerName: this.screenForm.jxsName,
  380. productName: this.screenForm.chName,
  381. specification: this.screenForm.model,
  382. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  383. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  384. examineStatus: this.screenForm.status
  385. }
  386. }
  387. },
  388. beforeCreate() {
  389. that = this
  390. },
  391. created() {
  392. this.getList()
  393. },
  394. methods: {
  395. // 查询列表
  396. getList() {
  397. this.listLoading = true
  398. let params = {
  399. pageNum: this.currentPage,
  400. pageSize: this.pageSize,
  401. id: this.screenForm.orderNum,
  402. correspondId: this.screenForm.warehouse,
  403. customerNumber: this.screenForm.jxsNum,
  404. customerName: this.screenForm.jxsName,
  405. productName: this.screenForm.chName,
  406. specification: this.screenForm.model,
  407. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  408. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  409. examineStatus: this.screenForm.status
  410. }
  411. getList(params).then(res => {
  412. this.dataList = res.data.records
  413. this.listTotal = res.data.total
  414. this.listLoading = false
  415. })
  416. },
  417. // 提交筛选表单
  418. submitScreenForm() {
  419. this.currentPage = 1
  420. this.getList()
  421. },
  422. // 重置筛选表单
  423. resetScreenForm() {
  424. this.$refs.screenForm.resetFields()
  425. this.currentPage = 1
  426. this.getList()
  427. },
  428. // 更改每页数量
  429. handleSizeChange(val) {
  430. this.pageSize = val
  431. this.currentPage = 1
  432. this.getList()
  433. },
  434. // 更改当前页
  435. handleCurrentChange(val) {
  436. this.currentPage = val
  437. this.getList()
  438. },
  439. // 进入表单
  440. toForm(item) {
  441. this.queryItem = item
  442. this.isShowForm = true
  443. },
  444. // 进入审批
  445. toExamine(item) {
  446. this.queryItem = item
  447. this.isShowExamine = true
  448. },
  449. // 进入详情
  450. toDetail(item) {
  451. this.queryItem = item
  452. this.isShowDetail = true
  453. },
  454. backList() {
  455. this.queryItem = {}
  456. this.isShowDetail = false
  457. this.isShowExamine = false
  458. this.isShowForm = false
  459. },
  460. // 删除
  461. handleDelete(id) {
  462. deleteData({ ids: id }).then(res => {
  463. this.$successMsg()
  464. this.getList()
  465. })
  466. },
  467. // 批量删除
  468. batchDelete() {
  469. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  470. confirmButtonText: '确定',
  471. cancelButtonText: '取消',
  472. type: 'warning'
  473. })
  474. .then(() => {
  475. let ids = this.multipleSelection.map(item => {
  476. return item.id
  477. })
  478. deleteData({ ids: ids.join(',') }).then(res => {
  479. this.$successMsg()
  480. this.getList()
  481. })
  482. })
  483. .catch(() => {})
  484. },
  485. handleSelectionChange(val) {
  486. this.multipleSelection = val
  487. },
  488. // 申请/撤回
  489. handleSubmit(id, examineStatus) {
  490. submitApply({ id, examineStatus }).then(res => {
  491. this.$successMsg()
  492. this.getList()
  493. })
  494. }
  495. }
  496. }
  497. </script>
  498. <style lang="scss" scoped></style>