index.vue 14 KB

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