alreadyDetail.vue 25 KB

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