alreadyDetail.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. <template>
  2. <!-- 已出库 -->
  3. <div>
  4. <!-- <div class="common-card">
  5. <h3>订单状态</h3>
  6. <yl-step></yl-step>
  7. </div> -->
  8. <div class="common-card">
  9. <h3>基本信息</h3>
  10. <el-form :model="listForm" ref="listform" label-width="200px" class="grid-form-class">
  11. <div class="form-body">
  12. <div class="flex-css">
  13. <el-form-item label="出库单号" prop="delvOrdId">
  14. <div class="content">
  15. {{ listForm.delvOrdId }}
  16. </div>
  17. </el-form-item>
  18. <el-form-item label="订单号" prop="purcOrdId">
  19. <div class="content">
  20. {{ listForm.purcOrdId }}
  21. </div>
  22. </el-form-item>
  23. <el-form-item label="采购品种数" prop="detlCnt">
  24. <div class="content">
  25. {{ listForm.detlCnt }}
  26. </div>
  27. </el-form-item>
  28. </div>
  29. <div class="flex-css">
  30. <el-form-item label="采购总数量" prop="qtySum">
  31. <div class="content">
  32. {{ listForm.qtySum }}
  33. </div>
  34. </el-form-item>
  35. <el-form-item label="采购总金额" prop="docmkDate">
  36. <div class="content">
  37. {{ listForm.docmkDate }}
  38. </div>
  39. </el-form-item>
  40. <el-form-item label="来源部门" prop="deptName">
  41. <div class="content">
  42. {{ listForm.deptName }}
  43. </div>
  44. </el-form-item>
  45. </div>
  46. <div class="flex-css">
  47. <el-form-item label="客户名称" prop="branchName">
  48. <div class="content">
  49. {{ listForm.branchName }}
  50. </div>
  51. </el-form-item>
  52. <el-form-item label="出库人" prop="docmker">
  53. <div class="content">
  54. {{ listForm.docmker }}
  55. </div>
  56. </el-form-item>
  57. <el-form-item label="当前状态" prop="delvOrdStas">
  58. <div class="content" v-if="listForm.delvOrdStas ==='C'">
  59. 已出库
  60. </div>
  61. <div class="content" v-if="listForm.delvOrdStas ==='R'">
  62. 被驳回
  63. </div>
  64. <div class="content" v-if="listForm.delvOrdStas ==='D'">
  65. 部分出库
  66. </div>
  67. <div class="content" v-if="listForm.delvOrdStas ==='Y'">
  68. 已入库
  69. </div>
  70. <div class="content" v-if="listForm.delvOrdStas ==='P'">
  71. 部分入库
  72. </div>
  73. </el-form-item>
  74. </div>
  75. <div class="flex-css">
  76. <el-form-item label="出库时间" prop="docmkDate">
  77. <div class="content">
  78. {{ listForm.docmkDate }}
  79. </div>
  80. </el-form-item>
  81. </div>
  82. </div>
  83. </el-form>
  84. </div>
  85. <div class="common-card">
  86. <h3>订单明细</h3>
  87. <el-table
  88. :data="tableData"
  89. v-loading="loding"
  90. element-loading-text="加载中..."
  91. border
  92. :span-method="handleSpan"
  93. >
  94. <template slot="empty">
  95. <img src="@/assets/nopage.png" alt />
  96. <p>暂无数据</p>
  97. </template>
  98. <el-table-column fixed type="index" label="序号" width="60"/>
  99. <el-table-column label="耗材编码" prop="materialId" />
  100. <el-table-column label="医保编码" prop="hiCode" />
  101. <el-table-column label="耗材名称" width="300">
  102. <template slot-scope="scope">
  103. <mcs-info :info="scope.row"></mcs-info>
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="规格" prop="spec" />
  107. <el-table-column label="型号" prop="mol" />
  108. <el-table-column label="材质" prop="matl" />
  109. <el-table-column label="是否集采" prop="isFas" >
  110. <template #default="{ row }">
  111. <span v-if="row.isFas == '1'">否</span>
  112. <span v-if="row.isFas == '0'">是</span>
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="计价单位" prop="prcUnt" />
  116. <el-table-column label="采购单位" prop="purcUnt" />
  117. <el-table-column label="包装内数量" prop="convrat" width="90px"/>
  118. <el-table-column label="批次号" prop="lotNum" />
  119. <el-table-column label="生产日期" prop="manuDate" width="100px"/>
  120. <el-table-column label="有效期至" prop="prodExpy" width="100px"/>
  121. <el-table-column label="需求数量" prop="purcCnt" />
  122. <el-table-column label="剩余出库量" prop="toDelvCnt" width="90px"/>
  123. <el-table-column label="本次出库量" prop="delvCnt" width="90px"/>
  124. <el-table-column label="客户验收数量" prop="shppCnt" width="100px"/>
  125. <el-table-column label="客户拒收数量" prop="returnCnt" width="100px"/>
  126. <el-table-column label="报关单" prop="invoFileId" >
  127. <template slot-scope="scope">
  128. <yl-upload
  129. :fileId="scope.row.invoFileId"
  130. readonly
  131. v-if="scope.row.invoFileId"
  132. >
  133. </yl-upload>
  134. </template>
  135. </el-table-column>
  136. <!-- <el-table-column label="随货单" prop="dyntFileId" /> -->
  137. <el-table-column label="备注" prop="momo" />
  138. <!-- <el-table-column label="同行单" prop="dyntFileId" width="100">
  139. <template slot-scope="scope">
  140. <yl-upload
  141. :fileId="scope.row.dyntFileId"
  142. readonly
  143. v-if="scope.row.dyntFileId"
  144. >
  145. </yl-upload> -->
  146. <!-- <div style="display:flex;justify-content: space-between;align-items: center;" v-if="scope.row.dyntFileId"> -->
  147. <!-- <el-button type="text" @click="openPdf(scope.row)">
  148. {{ scope.row.dyntFileId }}
  149. </el-button> -->
  150. <!-- <el-button
  151. type="text"
  152. @click="handleTong(scope.$index,scope.row)"
  153. >选择同行单</el-button
  154. > -->
  155. <!-- </div>
  156. <div v-else>
  157. <el-button
  158. type="text"
  159. @click="handleTong(scope.$index,scope.row)"
  160. >选择同行单</el-button
  161. >
  162. </div> -->
  163. <!-- </template>
  164. </el-table-column> -->
  165. </el-table>
  166. <div class="foot-button" style="margin-top:30px;">
  167. <!-- <el-button type="danger" @click="handleOrderEnd" :loading="endLoad">结束订单</el-button> -->
  168. <el-button type="primary" @click="handleBack" :loading="endLoad">返 回</el-button>
  169. </div>
  170. </div>
  171. <!-- 选择发票 -->
  172. <el-dialog
  173. title="选择发票"
  174. :visible.sync="dialogFa"
  175. width="55%">
  176. <el-form :model="faForm" ref="faform" :inline="true">
  177. <el-form-item label="发票信息" prop="aa">
  178. <el-input v-model="faForm.aa" placeholder="请输入发票名称"></el-input>
  179. </el-form-item>
  180. <el-form-item>
  181. <el-button type="primary" @click="getFaData('search')">查询</el-button>
  182. <el-button @click="faReset">重置</el-button>
  183. </el-form-item>
  184. </el-form>
  185. <el-table
  186. v-loading="faLoading"
  187. element-loading-text="加载中"
  188. :data="faData"
  189. fit
  190. stripe
  191. border
  192. >
  193. <template slot="empty">
  194. <img src="@/assets/nopage.png" alt />
  195. <p>暂无数据</p>
  196. </template>
  197. <el-table-column type="index" label="序号" width="60"/>
  198. <el-table-column label="发票名称" prop="aa" />
  199. <el-table-column label="开票金额" prop="" />
  200. <el-table-column label="发票号码" prop="" />
  201. <el-table-column label="开票时间" prop="" />
  202. <el-table-column label="上传时间" prop="" />
  203. <el-table-column fixed="right" label="操作" width="100">
  204. <template slot-scope="scope">
  205. <el-button type="primary" plain @click="handleRow(scope.row)"
  206. >选择</el-button
  207. >
  208. </template>
  209. </el-table-column>
  210. </el-table>
  211. <!--分页-->
  212. <yl-pagination
  213. v-show="faTotal > 0"
  214. :total="faTotal"
  215. :page.sync="faForm.current"
  216. :limit.sync="faForm.size"
  217. @pagination="getFaData"
  218. />
  219. </el-dialog>
  220. <!-- 选择同行单 -->
  221. <el-dialog
  222. title="选择同行单"
  223. :visible.sync="dialogTong"
  224. width="55%">
  225. <el-form :model="tongForm" ref="tongform" :inline="true">
  226. <el-form-item label="发票信息" prop="aa">
  227. <el-input v-model="tongForm.aa" placeholder="请输入同行单名称"></el-input>
  228. </el-form-item>
  229. <el-form-item>
  230. <el-button type="primary" @click="getTongData('search')">查询</el-button>
  231. <el-button @click="TongReset">重置</el-button>
  232. </el-form-item>
  233. </el-form>
  234. <el-table
  235. v-loading="tongLoading"
  236. element-loading-text="加载中"
  237. :data="tongData"
  238. fit
  239. stripe
  240. border
  241. >
  242. <template slot="empty">
  243. <img src="@/assets/nopage.png" alt />
  244. <p>暂无数据</p>
  245. </template>
  246. <el-table-column type="index" label="序号" width="60"/>
  247. <el-table-column label="票据名称" prop="aa" />
  248. <el-table-column label="票据金额" prop="" />
  249. <el-table-column label="票据单号" prop="" />
  250. <el-table-column label="开票时间" prop="" />
  251. <el-table-column label="上传时间" prop="" />
  252. <el-table-column fixed="right" label="操作" width="100">
  253. <template slot-scope="scope">
  254. <el-button type="primary" plain @click="handleRowTong(scope.row)"
  255. >选择</el-button
  256. >
  257. </template>
  258. </el-table-column>
  259. </el-table>
  260. <!--分页-->
  261. <yl-pagination
  262. v-show="tongTotal > 0"
  263. :total="tongTotal"
  264. :page.sync="tongForm.current"
  265. :limit.sync="tongForm.size"
  266. @pagination="getTongData"
  267. />
  268. </el-dialog>
  269. <!-- PDF预览 -->
  270. <el-dialog
  271. title="PDF预览"
  272. class="dd"
  273. :visible.sync="dialogVisible"
  274. width="70%"
  275. center
  276. >
  277. <iframe :src="pdfSrc" frameborder="0" style="width: 100%; height: 100%"></iframe>
  278. </el-dialog>
  279. </div>
  280. </template>
  281. <script>
  282. import ylStep from "@/components/yl-step";
  283. import ylPagination from "@/components/yl-pagination";
  284. import mcsInfo from "@/views/components/mcs-info.vue";
  285. import ylUpload from "@/components/yl-upload";
  286. import { getOrdDetlList,finishDelvOrd } from "@/api/orderManage-sup/index";
  287. export default {
  288. components:{
  289. ylStep,ylPagination,ylUpload,mcsInfo
  290. },
  291. data() {
  292. return {
  293. pdfSrc: "",
  294. dialogVisible: false,
  295. endLoad: false,
  296. listForm: {
  297. delvOrdId:"",
  298. purcOrdId: "",
  299. detlCnt: "",
  300. qtySum: "",
  301. deptName:"",
  302. docmker: "",
  303. docmkDate: "",
  304. delvOrdStas: "",
  305. branchName:"",
  306. },
  307. stasOptions: [
  308. {value: 'A', lable: "未受理"},
  309. {value: 'B', lable: "已受理"},
  310. {value: 'R', lable: "被驳回"},
  311. {value: 'C', lable: "已出库"},
  312. {value: 'D', lable: "部分出库"},
  313. {value: 'Y', lable: "已入库"},
  314. {value: 'P', lable: "部分入库"}
  315. ],
  316. essdrugOptions: ["非基药","基药"],
  317. tableData: [],
  318. loading: false,
  319. // 选择发票
  320. dialogFa: false,
  321. faForm:{
  322. aa: "",
  323. current: 1,
  324. size: 10,
  325. },
  326. faLoading: false,
  327. faData: [],
  328. faTotal: 0,
  329. faIndex: "",
  330. // 选择同行单
  331. dialogTong: false,
  332. tongForm:{
  333. aa: "",
  334. current: 1,
  335. size: 10,
  336. },
  337. tongLoading: false,
  338. tongData: [],
  339. tongTotal: 0,
  340. tongIndex: "",
  341. code: "",
  342. }
  343. },
  344. created() {
  345. this.listForm.delvOrdId = this.$route.query.delvOrdId;
  346. this.listForm.purcOrdId = this.$route.query.purcOrdId;
  347. this.listForm.detlCnt = this.$route.query.detlCnt;
  348. this.listForm.qtySum = this.$route.query.qtySum;
  349. this.listForm.deptName = this.$route.query.deptName;
  350. this.listForm.docmker = this.$route.query.docmker;
  351. this.listForm.docmkDate = this.$route.query.docmkDate;
  352. this.listForm.delvOrdStas = this.$route.query.delvOrdStas;
  353. this.listForm.branchName = this.$route.query.branchName
  354. // this.stasOptions.forEach((i)=>{
  355. // if(i.value == this.$route.query.stas){
  356. // this.listForm.purcOrdStas = i.lable
  357. // }
  358. // })
  359. },
  360. mounted () {
  361. this.getData();
  362. },
  363. methods: {
  364. getData() {
  365. this.listLoading = true;
  366. let data = {
  367. delvOrdId: this.$route.query.delvOrdId,
  368. purcOrdId: this.$route.query.purcOrdId
  369. }
  370. getOrdDetlList(data).then((res) => {
  371. this.tableData = res.data;
  372. this.tableData.forEach((i)=>{
  373. i.essdrugType = this.essdrugOptions[i.essdrugType*1]
  374. })
  375. this.listLoading = false;
  376. this.computeCell(this.tableData);
  377. }).catch((err) => {
  378. this.listLoading = false;
  379. });
  380. },
  381. // 筛选合并项
  382. computeCell(tableData) {
  383. this.cellList = [];
  384. this.count = null;
  385. for (let i = 0; i < tableData.length; i++) {
  386. if (i == 0) {
  387. // 先设置第一项
  388. this.cellList.push(1); // 初为1,若下一项和此项相同,就往cellList数组中追加0
  389. this.count = 0;
  390. console.log("索引", 0, this.count);
  391. } else {
  392. // 判断当前项与上项的设备类别是否相同,因为是合并这一列的单元格
  393. if (tableData[i].materialId == tableData[i - 1].materialId) {
  394. this.cellList[this.count] += 1; // 增加计数
  395. this.cellList.push(0); // 相等就往cellList数组中追加0
  396. console.log("索引", i, this.count);
  397. } else {
  398. this.cellList.push(1); // 不等就往cellList数组中追加1
  399. this.count = i; // 将索引赋值为计数
  400. console.log("索引", i, this.count);
  401. }
  402. }
  403. }
  404. },
  405. // 合并列
  406. handleSpan({ row, column, rowIndex, columnIndex }){
  407. if (columnIndex === 1 || columnIndex === 2 || columnIndex === 3 || columnIndex === 4
  408. || columnIndex === 5|| columnIndex === 6|| columnIndex === 7|| columnIndex === 8 ||columnIndex === 9
  409. || columnIndex === 10 || columnIndex === 15 || columnIndex === 14) {
  410. // console.log("单元格数组,若下一项为0,则代表合并上一项", this.cellList);
  411. const rowCell = this.cellList[rowIndex];
  412. if (rowCell > 0) {
  413. const colCell = 1;
  414. // console.log(`动态竖向合并单元格, 第${colCell}列,竖向合并${rowCell}个单元格 `);
  415. return {
  416. rowspan: rowCell,
  417. colspan: colCell,
  418. };
  419. } else {
  420. // 清除原有的单元格,必须要加,否则就会出现单元格会被横着挤到后面了!!!
  421. // 本例中数据是写死的不会出现,数据若是动态后端获取的,就会出现了!!!
  422. return {
  423. rowspan: 0,
  424. colspan: 0,
  425. };
  426. }
  427. }
  428. },
  429. // 预览文件
  430. dataURLtoBlob(e) {
  431. let bstr = atob(e);
  432. let n = bstr.length;
  433. let u8arr = new Uint8Array(n);
  434. while (n--) {
  435. u8arr[n] = bstr.charCodeAt(n);
  436. } //确定解析格式
  437. let blob = new Blob([u8arr], { type: "application/pdf;chartset=UTF-8" });
  438. let url = window.URL.createObjectURL(blob);
  439. return url;
  440. },
  441. // 详情
  442. openPdf(row){
  443. // let file = {
  444. // id: row.fileId,
  445. // };
  446. // uploadCheck(file).then((res) => {
  447. // if (res.success == true) {
  448. // this.dialogVisible = true;
  449. // const a = this.dataURLtoBlob(res.data.fileContent);
  450. // this.pdfSrc = a;
  451. // }
  452. // });
  453. },
  454. // 获取发票信息
  455. getFaData(type) {
  456. if (type == "search") {
  457. this.faForm.current = 1;
  458. }
  459. this.faData = [{aa:"资质文件.pdf",bb:"1111"},{aa:"出库文件.pdf",bb:"2222"}];
  460. this.faTotal = 1
  461. // this.faLoading = true;
  462. },
  463. faReset(){
  464. this.$refs.faForm.resetFields();
  465. this.getFaData();
  466. },
  467. // 选择发票
  468. handleFa(e,row){
  469. this.faIndex = e;
  470. this.dialogFa = true;
  471. this.getFaData();
  472. this.code = "";
  473. this.code = row.id;
  474. },
  475. // 选择发票 确认选择
  476. handleRow(row){
  477. // this.tableData[this.faIndex].fa = row.aa;
  478. this.tableData.forEach((i)=>{
  479. if(i.id == this.code){
  480. i.invoFileId = row.bb;
  481. }
  482. })
  483. this.dialogFa = false;
  484. },
  485. // 获取同行单信息
  486. getTongData(type) {
  487. if (type == "search") {
  488. this.tongForm.current = 1;
  489. }
  490. this.tongData = [{aa:"资质文件.pdf",bb:"1111"},{aa:"出库文件.pdf",bb:"2222"}];
  491. this.tongTotal = 1
  492. // this.tongLoading = true;
  493. },
  494. tongReset(){
  495. this.$refs.tongForm.resetFields();
  496. this.getTongData();
  497. },
  498. // 选择同行单
  499. handleTong(e,row){
  500. this.tongIndex = e;
  501. this.dialogTong = true;
  502. this.getTongData();
  503. this.code = "";
  504. this.code = row.id;
  505. },
  506. // 选择同行单 确认选择
  507. handleRowTong(row){
  508. // this.tableData[this.tongIndex].tong = row.aa;
  509. this.tableData.forEach((i)=>{
  510. if(i.id == this.code){
  511. i.dyntFileId = row.bb;
  512. }
  513. })
  514. this.dialogTong = false;
  515. },
  516. // 结束订单
  517. handleOrderEnd(){
  518. console.log(this.tableData,'tanleData')
  519. // this.tableData.forEach((item) => {
  520. // if (!item.fa || !item.tong) {
  521. // this.$message({
  522. // message: "请选择发票和同行单",
  523. // type: "info",
  524. // });
  525. // throw new Error("请选中发票和同行单");
  526. // }
  527. // })
  528. this.$confirm("确认结束订单", "提示", {
  529. confirmButtonText: "确定",
  530. cancelButtonText: "取消",
  531. type: "warning"
  532. }).then(() => {
  533. let data = {
  534. delvOrdId: this.$route.query.delvOrdId,
  535. }
  536. this.endLoad = true;
  537. finishDelvOrd(data).then((res) => {
  538. this.endLoad = false;
  539. }).catch((err) => {
  540. this.endLoad = false;
  541. });
  542. })
  543. },
  544. // 返回
  545. handleBack() {
  546. this.$router.push({
  547. name: "purOrderDelivery",
  548. query:{spdId:this.$route.query.spdId,activeName:this.$route.query.activeName}
  549. });
  550. },
  551. },
  552. }
  553. </script>
  554. <style lang="scss" scoped>
  555. ::v-deep .el-table__body tr.hover-row>td{
  556. background-color: transparent !important;
  557. }
  558. ::v-deep .el-table {
  559. th.el-table__cell.is-leaf,
  560. td.el-table__cell {
  561. border-bottom: 1px solid #eee;
  562. }
  563. }
  564. </style>