index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. <template>
  2. <!-- 采购订单出库 -->
  3. <div style="display: flex">
  4. <el-card style="width: 18%; margin-right: 18px; border-radius: 6px">
  5. <el-tabs v-model="activeNametree" type="card" @tab-click="tabClick" stretch>
  6. <!-- <el-tab-pane label="按分类" name="grp"></el-tab-pane> -->
  7. <el-tab-pane label="按机构" name="org"></el-tab-pane>
  8. </el-tabs>
  9. <el-tree
  10. :data="data"
  11. :props="defaultProps"
  12. node-key="spdId"
  13. @node-click="handleNodeClick"
  14. default-expand-all="true"
  15. style="margin-top: 10px"
  16. >
  17. <span class="custom-tree-node" slot-scope="{ node, data }">
  18. <div>{{ node.label }}</div>
  19. <div class="redTit">{{ data.wcknum }}</div>
  20. </span>
  21. </el-tree>
  22. </el-card>
  23. <div class="right-common-box">
  24. <el-tabs v-model="activeName" @tab-click="handleClick">
  25. <el-tab-pane label="待出库" name="first">
  26. <el-form :model="listQuery" ref="queryForm" :inline="true">
  27. <el-form-item label="采购单号" prop="id">
  28. <el-input v-model="listQuery.id" placeholder="请输入采购单号"></el-input>
  29. </el-form-item>
  30. <el-form-item label="客户名称" prop="branchName">
  31. <el-input
  32. v-model="listQuery.branchName"
  33. placeholder="请输入客户名称"
  34. ></el-input>
  35. </el-form-item>
  36. <el-form-item label="来源部门" prop="deptName">
  37. <el-input
  38. v-model="listQuery.deptName"
  39. placeholder="请输入来源部门"
  40. ></el-input>
  41. </el-form-item>
  42. <el-form-item label="采购时间" prop="docmkDate">
  43. <el-date-picker
  44. v-model="listQuery.docmkDate"
  45. type="daterange"
  46. range-separator="至"
  47. :editable="false"
  48. value-format="yyyy-MM-dd"
  49. start-placeholder="开始时间"
  50. end-placeholder="结束时间"
  51. style="width: 230px"
  52. />
  53. </el-form-item>
  54. <!-- <el-form-item label="当前状态" prop="stas">
  55. <el-select
  56. v-model="listQuery.stas"
  57. placeholder="请选择"
  58. clearable
  59. >
  60. <el-option
  61. v-for="item in stasOptions"
  62. :key="item.value"
  63. :label="item.lable"
  64. :value="item.value"
  65. ></el-option>
  66. </el-select>
  67. </el-form-item> -->
  68. <el-form-item>
  69. <el-button type="primary" @click="getOutboundData('search')"
  70. >查询
  71. </el-button>
  72. <el-button @click="reset">重置</el-button>
  73. </el-form-item>
  74. </el-form>
  75. <el-table
  76. v-loading="listLoading"
  77. element-loading-text="加载中"
  78. :data="list"
  79. fit
  80. stripe
  81. border
  82. height="500px"
  83. >
  84. <template slot="empty">
  85. <img src="@/assets/nopage.png" alt />
  86. <p>暂无数据</p>
  87. </template>
  88. <el-table-column fixed type="index" label="序号" width="60" />
  89. <el-table-column label="订单编号" prop="id" />
  90. <el-table-column label="订单种类" prop="detlCnt" />
  91. <el-table-column label="订单总数量" prop="qtySum" />
  92. <el-table-column label="剩余出库量" prop="delvCnt" />
  93. <el-table-column label="订单总金额" prop="purcAmt" width="100px" />
  94. <el-table-column label="客户名称" prop="branchName" />
  95. <el-table-column label="来源部门" prop="deptName" />
  96. <el-table-column label="采购类型" prop="purcType" width="100">
  97. <template #default="{ row }">
  98. <span v-if="row.purcType == '2'">{{ row.oprn }}</span>
  99. <span v-if="row.purcType == '1'">普通采购</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="采购时间" prop="docmkDate" width="140" />
  103. <el-table-column label="状态" prop="stas">
  104. <!-- <template #default="{ row }">
  105. <span v-if="row.stas == 'A'">未受理</span>
  106. <span v-if="row.stas == 'B'">未出库</span>
  107. <span v-if="row.stas == 'R'">被驳回</span>
  108. <span v-if="row.stas == 'C'">已出库</span>
  109. <span v-if="row.stas == 'D'">部分出库</span>
  110. <span v-if="row.stas == 'Y'">已入库</span>
  111. <span v-if="row.stas == 'P'">部分入库</span>
  112. </template> -->
  113. </el-table-column>
  114. <el-table-column label="操作" width="100" fixed="right">
  115. <template slot-scope="scope">
  116. <el-button type="text" @click="handleDetail(scope.row)">详情</el-button>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <!--分页-->
  121. <yl-pagination
  122. v-show="total > 0"
  123. :total="total"
  124. :page.sync="listQuery.current"
  125. :limit.sync="listQuery.size"
  126. @pagination="getOutboundData"
  127. />
  128. </el-tab-pane>
  129. <el-tab-pane label="已出库" name="second">
  130. <el-form :model="listQueryC" ref="queryFormC" :inline="true">
  131. <el-form-item label="出库单号" prop="delvOrdId">
  132. <el-input
  133. v-model="listQueryC.delvOrdId"
  134. placeholder="请输入出库单号"
  135. ></el-input>
  136. </el-form-item>
  137. <el-form-item label="关联采购单" prop="purcOrdId">
  138. <el-input
  139. v-model="listQueryC.purcOrdId"
  140. placeholder="请输入关联采购单"
  141. ></el-input>
  142. </el-form-item>
  143. <el-form-item label="客户名称" prop="branchName">
  144. <el-input
  145. v-model="listQueryC.branchName"
  146. placeholder="请输入客户名称"
  147. ></el-input>
  148. </el-form-item>
  149. <el-form-item label="来源部门" prop="deptName">
  150. <el-input
  151. v-model="listQueryC.deptName"
  152. placeholder="请输入来源部门"
  153. ></el-input>
  154. </el-form-item>
  155. <el-form-item label="出库时间" prop="docmkDate">
  156. <el-date-picker
  157. v-model="listQueryC.docmkDate"
  158. type="daterange"
  159. range-separator="至"
  160. :editable="false"
  161. value-format="yyyy-MM-dd"
  162. start-placeholder="开始时间"
  163. end-placeholder="结束时间"
  164. style="width: 230px"
  165. />
  166. </el-form-item>
  167. <!-- <el-form-item label="当前状态" prop="purcOrdStas">
  168. <el-select
  169. v-model="listQuery.purcOrdStas"
  170. placeholder="请选择"
  171. clearable
  172. >
  173. <el-option
  174. v-for="item in stasOptions"
  175. :key="item.value"
  176. :label="item.lable"
  177. :value="item.value"
  178. ></el-option>
  179. </el-select>
  180. </el-form-item> -->
  181. <el-form-item>
  182. <el-button type="primary" @click="getOutboundDataC('search')"
  183. >查询
  184. </el-button>
  185. <el-button @click="resetC">重置</el-button>
  186. </el-form-item>
  187. </el-form>
  188. <el-table
  189. v-loading="listLoading"
  190. element-loading-text="加载中"
  191. :data="listC"
  192. fit
  193. stripe
  194. border
  195. height="500px"
  196. >
  197. <template slot="empty">
  198. <img src="@/assets/nopage.png" alt />
  199. <p>暂无数据</p>
  200. </template>
  201. <el-table-column fixed type="index" label="序号" width="60" />
  202. <el-table-column label="出库单号" prop="delvOrdId" />
  203. <el-table-column label="关联采购单" prop="purcOrdId" />
  204. <el-table-column label="采购品种数" prop="detlCnt" />
  205. <el-table-column label="采购总数量" prop="qtySum" />
  206. <el-table-column label="本次出库量" prop="bcckl" />
  207. <el-table-column label="客户验收数量" prop="shppCnt" width="100px" />
  208. <el-table-column label="剩余出库量" prop="toDelvCnt" width="100px" />
  209. <el-table-column label="客户名称" prop="branchName" />
  210. <el-table-column label="来源部门" prop="deptName" />
  211. <el-table-column label="采购类型" prop="purcType" width="100">
  212. <template #default="{ row }">
  213. <span v-if="row.purcType == '2'">{{ row.oprn }}</span>
  214. <span v-if="row.purcType == '1'">普通采购</span>
  215. </template>
  216. </el-table-column>
  217. <el-table-column label="出库员" prop="docmker" />
  218. <el-table-column label="出库时间" prop="docmkDate" width="140" />
  219. <el-table-column label="状态" prop="delvOrdStas" width="100">
  220. <template #default="{ row }">
  221. <span v-if="row.delvOrdStas == 'A'">未受理</span>
  222. <span v-if="row.delvOrdStas == 'B'">已受理</span>
  223. <span v-if="row.delvOrdStas == 'R'">被驳回</span>
  224. <span v-if="row.delvOrdStas == 'C'">已出库</span>
  225. <span v-if="row.delvOrdStas == 'D'">部分出库</span>
  226. <span v-if="row.delvOrdStas == 'Y'">已入库</span>
  227. <span v-if="row.delvOrdStas == 'P'">部分入库</span>
  228. </template>
  229. </el-table-column>
  230. <el-table-column label="操作" width="100" fixed="right">
  231. <template slot-scope="scope">
  232. <el-button type="text" @click="handleDetailC(scope.row)">详情</el-button>
  233. </template>
  234. </el-table-column>
  235. </el-table>
  236. <!--分页-->
  237. <yl-pagination
  238. v-show="totalC > 0"
  239. :total="totalC"
  240. :page.sync="listQueryC.current"
  241. :limit.sync="listQueryC.size"
  242. @pagination="getOutboundDataC"
  243. />
  244. </el-tab-pane>
  245. </el-tabs>
  246. </div>
  247. </div>
  248. </template>
  249. <script>
  250. import ylPagination from "@/components/yl-pagination";
  251. import {
  252. getMcsOrdDck,
  253. getSplerMcsDelvOrdPage,
  254. selectSpdList,
  255. } from "@/api/orderManage-sup/index";
  256. export default {
  257. components: {
  258. ylPagination,
  259. },
  260. data() {
  261. return {
  262. activeNametree: "org",
  263. data: [],
  264. spdId: null,
  265. defaultProps: {
  266. children: "children",
  267. label: "spdName",
  268. },
  269. activeName: "first",
  270. listQuery: {
  271. current: 1,
  272. size: 10,
  273. id: "",
  274. branchName: "",
  275. docmkDateStart: "",
  276. docmkDateEnd: "",
  277. docmkDate: [],
  278. stas: "",
  279. spdId: "",
  280. },
  281. listQueryC: {
  282. current: 1,
  283. size: 10,
  284. purcOrdId: "",
  285. branchName: "",
  286. docmkDate: "",
  287. delvOrdId: "",
  288. docmkDateEnd: "",
  289. branchName: "",
  290. },
  291. stasOptions: [
  292. // {value: 'A', lable: "未受理"},
  293. { value: "B", lable: "未出库" },
  294. // {value: 'R', lable: "被驳回"},
  295. { value: "C", lable: "已出库" },
  296. { value: "D", lable: "部分出库" },
  297. // {value: 'Y', lable: "已入库"},
  298. // {value: 'P', lable: "部分入库"}
  299. ],
  300. listLoading: false,
  301. list: [],
  302. listC: [],
  303. total: 0,
  304. totalC: 0,
  305. routespdId:"",
  306. };
  307. },
  308. mounted() {
  309. this.getData();
  310. if (this.$route.query.spdId && this.$route.query.activeName == "first") {
  311. this.listQuery.spdId = this.$route.query.spdId;
  312. getMcsOrdDck(this.listQuery)
  313. .then((res) => {
  314. this.list = res.data.records;
  315. this.total = res.data.total;
  316. this.listLoading = false;
  317. })
  318. .catch((err) => {
  319. this.listLoading = false;
  320. });
  321. }
  322. if (this.$route.query.spdId && this.$route.query.activeName == "second") {
  323. this.activeName = "second";
  324. this.listQueryC.spdId = this.$route.query.spdId;
  325. getSplerMcsDelvOrdPage(this.listQueryC)
  326. .then((res) => {
  327. this.listC = res.data.records;
  328. this.totalC = res.data.total;
  329. this.listLoading = false;
  330. })
  331. .catch((err) => {
  332. this.listLoading = false;
  333. });
  334. }
  335. },
  336. methods: {
  337. tabClick(tab) {
  338. if (tab.label == "按机构") {
  339. this.defaultProps.label = "spdName";
  340. }
  341. // else if(tab.label == "按分类"){
  342. // // this.getData4();
  343. // // this.defaultProps.label = 'orgGrpName'
  344. // // this.listQuery.type = 'grp';
  345. // }
  346. },
  347. handleClick(tab) {
  348. console.log(tab.name, "name");
  349. if (tab.name == "first") {
  350. this.getOutboundData();
  351. } else {
  352. this.getOutboundDataC();
  353. }
  354. },
  355. // 获取医院列表
  356. getData(type) {
  357. this.data = [];
  358. selectSpdList()
  359. .then((res) => {
  360. this.listQuery.spdId = res.data[0].spdId;
  361. this.listQueryC.spdId = res.data[0].spdId;
  362. this.data = res.data;
  363. console.log(this.data, "dadad");
  364. })
  365. .catch((err) => {});
  366. },
  367. getOutboundData(type) {
  368. if (type == "search") {
  369. this.listQuery.current = 1;
  370. }
  371. this.listLoading = true;
  372. this.listQuery.spdId = this.spdId;
  373. this.listQuery.docmkDateStart = this.listQuery.docmkDate[0];
  374. this.listQuery.docmkDateEnd = this.listQuery.docmkDate[1];
  375. getMcsOrdDck(this.listQuery)
  376. .then((res) => {
  377. this.list = res.data.records;
  378. this.total = res.data.total;
  379. this.listLoading = false;
  380. })
  381. .catch((err) => {
  382. this.listLoading = false;
  383. });
  384. },
  385. // 点击获取耗材列表
  386. handleNodeClick(data) {
  387. console.log(data, "data");
  388. this.listLoading = true;
  389. this.listQuery.docmkDateStart = this.listQuery.docmkDate[0];
  390. this.listQuery.docmkDateEnd = this.listQuery.docmkDate[1];
  391. this.spdId = data.spdId;
  392. this.listQuery.spdId = this.spdId;
  393. getMcsOrdDck(this.listQuery)
  394. .then((res) => {
  395. this.list = res.data.records;
  396. this.total = res.data.total;
  397. this.listLoading = false;
  398. console.log(res, "医院目录");
  399. })
  400. .catch((err) => {
  401. this.listLoading = false;
  402. });
  403. },
  404. reset() {
  405. this.$refs.queryForm.resetFields();
  406. this.getOutboundData();
  407. },
  408. // 详情
  409. handleDetail(row) {
  410. if (this.spdId) {
  411. this.routespdId = this.spdId;
  412. } else {
  413. this.routespdId = this.$route.query.spdId;
  414. }
  415. this.$router.push({
  416. name: "deliveryDetail",
  417. query: {
  418. deptName: row.deptName,
  419. deptId: row.deptId,
  420. id: row.id,
  421. detlCnt: row.detlCnt,
  422. qtySum: row.qtySum,
  423. purcAmt: row.purcAmt,
  424. docmker: row.docmker,
  425. docmkDate: row.docmkDate,
  426. stas: row.stas,
  427. branchName: row.branchName,
  428. spdId: this.routespdId,
  429. activeName: this.activeName,
  430. oprn: row.oprn,
  431. oprtRoom: row.oprtRoom,
  432. oprtTime: row.oprtTime,
  433. atddr: row.atddr,
  434. purcType: row.purcType,
  435. },
  436. });
  437. },
  438. getOutboundDataC(type) {
  439. if (type == "search") {
  440. this.listQueryC.current = 1;
  441. }
  442. this.listLoading = true;
  443. this.listQueryC.spdId = this.spdId;
  444. this.listQueryC.docmkDateStart = this.listQueryC.docmkDate[0];
  445. this.listQueryC.docmkDateEnd = this.listQueryC.docmkDate[1];
  446. getSplerMcsDelvOrdPage(this.listQueryC)
  447. .then((res) => {
  448. this.listC = res.data.records;
  449. this.totalC = res.data.total;
  450. this.listLoading = false;
  451. })
  452. .catch((err) => {
  453. this.listLoading = false;
  454. });
  455. },
  456. resetC() {
  457. this.$refs.queryFormC.resetFields();
  458. this.getOutboundDataC();
  459. },
  460. // 详情
  461. handleDetailC(row) {
  462. if (this.spdId) {
  463. this.routespdId = this.spdId;
  464. } else {
  465. this.routespdId = this.$route.query.spdId;
  466. }
  467. this.$router.push({
  468. name: "alreadyDetail",
  469. query: {
  470. delvOrdId: row.delvOrdId,
  471. purcOrdId: row.purcOrdId,
  472. detlCnt: row.detlCnt,
  473. docmker: row.docmker,
  474. deptName: row.deptName,
  475. docmkDate: row.docmkDate,
  476. delvOrdStas: row.delvOrdStas,
  477. branchName: row.branchName,
  478. qtySum: row.qtySum,
  479. spdId: this.routespdId,
  480. activeName: this.activeName,
  481. purcAmt: row.purcAmt,
  482. oprn: row.oprn,
  483. oprtRoom: row.oprtRoom,
  484. oprtTime: row.oprtTime,
  485. atddr: row.atddr,
  486. purcType: row.purcType,
  487. },
  488. });
  489. },
  490. },
  491. };
  492. </script>
  493. <style lang="scss" scoped>
  494. .custom-tree-node {
  495. display: flex;
  496. flex-direction: row;
  497. justify-content: space-between;
  498. }
  499. .custom-tree-node ::v-deep .redTit {
  500. min-width: 30px;
  501. background-color: #f56c6c;
  502. min-height: 1px;
  503. border-radius: 10px;
  504. text-align: center;
  505. margin-left: 10px;
  506. padding: 1px;
  507. color: #fff;
  508. }
  509. </style>