Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

stockOutOrderDetailPrint.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-row style="float:right;">
  6. <el-col :span="24">
  7. <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
  8. </el-col>
  9. </el-row>
  10. </div>
  11. <div class="app-container" style="background-color: white;">
  12. <div id="print_content">
  13. <div class="print_main_content">
  14. <div class="order_title_panl">
  15. <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
  16. <span class="main_title">耗材出库登记单</span>
  17. </div>
  18. <div style="display:flex;justify-content: space-between;">
  19. <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
  20. <!-- 单据编号:{{warehousingOutInfo.info.warehouse_out_order_number}} -->
  21. 单据编号: {{tableList[0].warehouse_out_order_number}}
  22. </div>
  23. <div style="text-align:right;margin-bottom:1px;font-size: 18px;">
  24. 打印日期:{{time_now}}
  25. </div>
  26. </div>
  27. <div class="table_panel">
  28. <table class="table">
  29. <thead>
  30. <tr>
  31. <td width="80">耗材名称</td>
  32. <td width="80">规格型号</td>
  33. <td width="80">单位</td>
  34. <td width="80">出货数量</td>
  35. <td width="80">出库价格</td>
  36. <td width="80">总价</td>
  37. <td width="80">批号</td>
  38. <td width="80">生产日期</td>
  39. <td width="80">有效日期</td>
  40. </tr>
  41. </thead>
  42. <tbody>
  43. <tr v-for='(item,index) in tableList' :key="index">
  44. <td><span v-if="item.good_id != 0">{{item.good_name}}</span></td>
  45. <td><span v-if="item.good_id != 0">{{item.specification_name}}</span></td>
  46. <td><span v-if="item.good_id!=0">{{item.packing_unit}}</span></td>
  47. <td>{{getOutStockCount(item.good_id) + getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id)}}</td>
  48. <td>{{item.price}}</td>
  49. <td>{{((getOutStockCount(item.good_id) +getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id))*item.price).toFixed(2)}}</td>
  50. <td>{{getNumber(item.good_id)}}</td>
  51. <td>{{getProductDate(item.good_id)}}</td>
  52. <td>{{getExpiryDate(item.good_id)}}</td>
  53. </tr>
  54. <tr>
  55. <td>合计</td>
  56. <td colspan="7"></td>
  57. <td>{{allPrice.toFixed(2)}}</td>
  58. </tr>
  59. </tbody>
  60. </table>
  61. <div v-if="orgId != 10024" style="display:flex;margin-top:1px;float:right;">
  62. <div style="width:50px;">审批:</div><div style="width:100px;"></div>
  63. <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
  64. <div style="width:50px;">会计:</div><div style="width:100px;"></div>
  65. <div style="width:50px;">审核:</div><div style="width:100px;"></div>
  66. <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
  67. </div>
  68. <div v-if="orgId == 10024" style="display:flex;margin-top:1px;float:right;">
  69. <div style="width:50px;">科室:</div><div style="width:60px;"></div>
  70. <div style="width:70px;">领料人:</div><div style="width:60px;"></div>
  71. <div style="width:80px;">审批:</div><div style="width:100px;">肖庆娥</div>
  72. <div style="width:50px;">会计:</div><div style="width:100px;">徐立琼</div>
  73. <div style="width:50px;">审核:</div><div style="width:100px;">徐立琼</div>
  74. <div style="width:70px;">制单人:</div><div style="width:100px;">徐立琼</div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </template>
  82. <script>
  83. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  84. import { GetAllConfig,getWarehouseOutInfo,GetOutStockTotalCount,getGoodInfoList,getWarehouseOrderInfoList,getOrderDetailByOrderId } from "@/api/stock";
  85. import print from 'print-js'
  86. const moment = require('moment');
  87. import { uParseTime } from '@/utils/tools'
  88. export default {
  89. components:{
  90. BreadCrumb
  91. },
  92. data(){
  93. return{
  94. crumbs: [
  95. { path: false, name: '库存管理' },
  96. { path: false, name: '耗材管理' },
  97. { path: false, name: '入库单打印' },
  98. ],
  99. isEdit: 0,
  100. checked: false,
  101. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  102. goodType: [],
  103. goodInfo: [],
  104. manufacturer: [],
  105. dealer: [],
  106. warehousingOutInfo: {
  107. loading: false,
  108. warehousingOutData: [],
  109. info: {}
  110. },
  111. stockCount:[],
  112. time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  113. allPrice:0,
  114. page: 1,
  115. limit: 10000,
  116. keyword: "",
  117. is_use:"",
  118. good_kind:"",
  119. is_charge:"",
  120. list:[],
  121. wareoutList:[],
  122. orgId:'',
  123. orgName:'',
  124. orderInList:[],
  125. tableList:[]
  126. }
  127. },
  128. methods:{
  129. printAction: function() {
  130. const style = '@media print { .print_main_content { background-color: white; width:960px; margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }';
  131. printJS({
  132. printable: 'print_content',
  133. type: 'html',
  134. documentTitle: ' ',
  135. style: style,
  136. scanStyles: false
  137. })
  138. },
  139. GetConfigInfo() {
  140. GetAllConfig().then(response => {
  141. if (response.data.state == 0) {
  142. this.$message.error(response.data.msg);
  143. return false
  144. } else {
  145. this.manufacturer = response.data.data.manufacturer;
  146. this.dealer = response.data.data.dealer;
  147. this.goodInfo = response.data.data.goodInfo;
  148. this.goodType = response.data.data.goodType
  149. }
  150. })
  151. },
  152. GetOrderDetail: function(order_id) {
  153. const params = {
  154. 'id': order_id
  155. };
  156. getWarehouseOutInfo(params).then(response => {
  157. if (response.data.state == 0) {
  158. this.$message.error(response.data.msg);
  159. return false
  160. } else {
  161. for (let i = 0; i < response.data.data.list.length; i++) {
  162. this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
  163. }
  164. this.warehousingOutInfo.info = response.data.data.info;
  165. console.log("数据源头9999999999",this.warehousingOutInfo.warehousingOutData);
  166. var total_price = 0;
  167. for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
  168. total_price += this.warehousingOutInfo.warehousingOutData[i].total_price
  169. }
  170. console.log('this.allPrice',this.allPrice)
  171. this.allPrice = total_price;
  172. var wareoutList = response.data.data.wareoutList;
  173. console.log("出库数据",wareoutList);
  174. this.wareoutList = wareoutList
  175. }
  176. })
  177. },
  178. GetTotalCount(time){
  179. var params = {
  180. warehouse_out_time:time
  181. };
  182. GetOutStockTotalCount(params).then(response=>{
  183. if(response.data.state == 1){
  184. var stockCount = response.data.data.stockCount;
  185. console.log("stockCount",stockCount);
  186. this.stockCount = stockCount
  187. }
  188. })
  189. },
  190. getSpecificationName: function(id) {
  191. let name = '';
  192. for (let i = 0; i < this.goodInfo.length; i++) {
  193. if (this.goodInfo[i].id == id) {
  194. name = this.goodInfo[i].specification_name
  195. }
  196. }
  197. return name
  198. },
  199. getTypeName: function(id) {
  200. let name = '';
  201. for (let i = 0; i < this.goodType.length; i++) {
  202. if (this.goodType[i].id == id) {
  203. name = this.goodType[i].type_name
  204. }
  205. }
  206. return name
  207. },
  208. getTypeNameOne: function(id) {
  209. let name = '';
  210. for (let i = 0; i < this.goodInfo.length; i++) {
  211. if (this.goodInfo[i].id == id) {
  212. name = this.goodInfo[i].good_name
  213. }
  214. }
  215. return name
  216. },
  217. getOutStockCount(id){
  218. var count = 0;
  219. for(let i=0;i<this.stockCount.length;i++){
  220. if(id == this.stockCount[i].good_id){
  221. count = this.stockCount[i].count
  222. }
  223. }
  224. return count
  225. },
  226. getList() {
  227. this.goodInfo.loading = true;
  228. let params = {
  229. page: this.page,
  230. limit: this.limit,
  231. keyword: this.keywords,
  232. is_use:this.is_use,
  233. good_kind:this.good_kind,
  234. is_charge: this.is_charge,
  235. };
  236. getGoodInfoList(params).then(response => {
  237. if (response.data.state == 0) {
  238. this.$message.error(response.data.msg);
  239. return false
  240. } else {
  241. this.list = [];
  242. for (let i = 0; i < response.data.data.list.length; i++) {
  243. this.list.push(response.data.data.list[i])
  244. }
  245. }
  246. })
  247. },
  248. getUnit(id){
  249. var name = "";
  250. for(let i=0;i<this.list.length;i++){
  251. if(id == this.list[i].id){
  252. name = this.list[i].good_unit
  253. }
  254. }
  255. return this.getGoodUnit(name)
  256. },
  257. getGoodUnit(id){
  258. for (let i = 0; i <this.$store.getters.good_unit.length; i++ ){
  259. if(id == this.$store.getters.good_unit[i].id){
  260. return this.$store.getters.good_unit[i].name
  261. }
  262. }
  263. return ""
  264. },
  265. getWarehouseOutInfoCount(warehouse_out_id,good_id){
  266. var count = 0;
  267. for(let i=0;i<this.wareoutList.length;i++){
  268. if(warehouse_out_id == this.wareoutList[i].warehouse_out_id && good_id == this.wareoutList[i].good_id){
  269. count = this.wareoutList[i].count
  270. }
  271. }
  272. return count
  273. },
  274. getWarehouseOrderInfoList(){
  275. getWarehouseOrderInfoList().then(response=>{
  276. if(response.data.state == 1){
  277. var list = response.data.data.list
  278. console.log("入库单详情",list)
  279. this.orderInList = list
  280. }
  281. })
  282. },
  283. getNumber(id){
  284. var name = ""
  285. for(let i=0;i<this.orderInList.length;i++){
  286. if(id == this.orderInList[i].good_id){
  287. name = this.orderInList[i].number
  288. }
  289. }
  290. return name
  291. },
  292. getProductDate(id){
  293. var product_date = ""
  294. for(let i=0;i<this.orderInList.length;i++){
  295. if(id == this.orderInList[i].good_id){
  296. product_date = this.orderInList[i].product_date
  297. }
  298. }
  299. return this.getTime(product_date)
  300. },
  301. getExpiryDate(id){
  302. var expiry_date = ""
  303. for(let i=0;i<this.orderInList.length;i++){
  304. if(id == this.orderInList[i].good_id){
  305. expiry_date = this.orderInList[i].expiry_date
  306. }
  307. }
  308. return this.getTime(expiry_date)
  309. },
  310. getTime(val) {
  311. if(val < 0){
  312. return ""
  313. }
  314. if(val == ""){
  315. return ""
  316. }else {
  317. return uParseTime(val, '{y}-{m}-{d}')
  318. }
  319. },
  320. GetOrderDetailOne(id){
  321. const params = {
  322. 'id': id
  323. }
  324. getOrderDetailByOrderId(params).then(response=>{
  325. if(response.data.state == 1){
  326. var list = response.data.data.list
  327. console.log("详情打印222222",list)
  328. var total_price = 0
  329. for(let i=0;i<list.length;i++){
  330. total_price += response.data.data.list[i].price * response.data.data.list[i].count
  331. this.tableList.push(list[i])
  332. }
  333. this.allPrice = total_price
  334. }
  335. })
  336. },
  337. },
  338. created(){
  339. this.orgName = this.$store.getters.xt_user.org.org_name;
  340. this.orgId = this.$store.getters.xt_user.org.id;
  341. const order_id = this.$route.query.id;
  342. const warehouse_out_time = this.$route.query.warehouse_out_time;
  343. this.GetConfigInfo();
  344. // this.GetOrderDetail(order_id);
  345. this.GetTotalCount(warehouse_out_time);
  346. this.GetOrderDetailOne(order_id)
  347. this.getList()
  348. //获取所有入库单
  349. this.getWarehouseOrderInfoList()
  350. }
  351. }
  352. </script>
  353. <style rel="stylesheet/scss" lang="scss" scoped>
  354. .print_main_content {
  355. background-color: white;
  356. max-width: 1500px;
  357. margin: 0 auto;
  358. padding: 0 0 20px 0;
  359. .order_title_panl {
  360. text-align: center;
  361. .main_title {
  362. font-size: 18px;
  363. line-height: 40px;
  364. font-weight: 500;
  365. }
  366. }
  367. .table_panel {
  368. .table {
  369. width: 100%;
  370. border: 1px solid;
  371. border-collapse: collapse;
  372. padding: 2px;
  373. thead {
  374. tr {
  375. td {
  376. border: 1px solid;
  377. text-align: center;
  378. font-size: 18px;
  379. padding: 15px 5px;
  380. }
  381. }
  382. }
  383. tbody {
  384. tr {
  385. td {
  386. border: 1px solid;
  387. text-align: center;
  388. font-size: 18px;
  389. padding: 10px 5px;
  390. white-space: pre-line;
  391. .proj {
  392. padding: 5px 0;
  393. text-align: left;
  394. .proj_title {
  395. font-size: 16px;
  396. font-weight: 500;
  397. line-height: 25px;
  398. }
  399. .proj_item {
  400. font-size: 15px;
  401. line-height: 20px;
  402. .zone_name {
  403. font-weight: 500;
  404. }
  405. }
  406. }
  407. }
  408. }
  409. }
  410. }
  411. }
  412. }
  413. </style>