direct_list.vue 19 KB

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