index.vue 16 KB

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