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

stockOutOrderDetailPrint.vue 15KB

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