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

stockInOrderDetailPrint.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  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. <span class="main_title">耗材入库登记单</span>
  16. </div>
  17. <div style="text-align:right;margin-bottom:20px;font-size: 18px;">
  18. 打印时间:{{time_now}}
  19. </div>
  20. <div class="table_panel">
  21. <table class="table">
  22. <thead>
  23. <tr>
  24. <td width="80">耗材名称</td>
  25. <td width="80">注册证号/批准文号/备案凭证号</td>
  26. <td width="80">规格型号</td>
  27. <td width="80">生产厂商</td>
  28. <td width="80">单位</td>
  29. <td width="80">进货价</td>
  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. </tr>
  38. </thead>
  39. <tbody>
  40. <tr v-for='(item,index) in WarehouseInfo.warehouseInfoDate' :key="index">
  41. <td><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
  42. <td></td>
  43. <td><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
  44. <td>{{ getManufacturer(item.manufacturer) }}</td>
  45. <td><span v-if="item.good_id!=0">{{getUnit(item.good_id)}}</span></td>
  46. <td>{{item.price}}</td>
  47. <td>{{item.warehousing_count}}</td>
  48. <td>{{(item.warehousing_count*item.price).toFixed(2)}}</td>
  49. <td>{{ item.number }}</td>
  50. <td>{{ item.product_date | parseTime("{y}-{m}-{d}") }}</td>
  51. <td>{{ item.expiry_date | parseTime("{y}-{m}-{d}") }}</td>
  52. <td></td>
  53. <td></td>
  54. </tr>
  55. <tr>
  56. <td>合计</td>
  57. <td colspan="11"></td>
  58. <td>{{allPrice.toFixed(2)}}</td>
  59. </tr>
  60. </tbody>
  61. </table>
  62. <div style="display:flex;margin-top:20px;float:right;">
  63. <div style="width:50px;">审批:</div><div style="width:100px;"></div>
  64. <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
  65. <div style="width:50px;">会计:</div><div style="width:100px;"></div>
  66. <div style="width:50px;">审核:</div><div style="width:100px;"></div>
  67. <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </template>
  75. <script>
  76. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  77. import {
  78. GetAllConfig,
  79. getWarehouseInfoList,
  80. getGoodInfoList
  81. } from "@/api/stock";
  82. import print from 'print-js'
  83. const moment = require('moment')
  84. export default {
  85. components:{
  86. BreadCrumb
  87. },
  88. data(){
  89. return{
  90. crumbs: [
  91. { path: false, name: '库存管理' },
  92. { path: false, name: '耗材管理' },
  93. { path: false, name: '入库单打印' },
  94. ],
  95. isEdit: 0,
  96. checked: false,
  97. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  98. goodType: [],
  99. goodInfo: [],
  100. manufacturer: [],
  101. dealer: [],
  102. Warehouse: {
  103. loading: false,
  104. warehouseDate: [],
  105. tableCurrentIndex: ""
  106. },
  107. WarehouseInfo: {
  108. loading: false,
  109. warehouseInfoDate: [],
  110. warehouse: {}
  111. },
  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. }
  122. },
  123. methods:{
  124. printAction: function() {
  125. 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; } }'
  126. printJS({
  127. printable: 'print_content',
  128. type: 'html',
  129. documentTitle: ' ',
  130. style: style,
  131. scanStyles: false
  132. })
  133. },
  134. GetConfigInfo: function() {
  135. GetAllConfig().then(response => {
  136. if (response.data.state == 0) {
  137. this.$message.error(response.data.msg);
  138. return false;
  139. } else {
  140. this.manufacturer = response.data.data.manufacturer;
  141. this.dealer = response.data.data.dealer;
  142. this.goodInfo = response.data.data.goodInfo;
  143. this.goodType = response.data.data.goodType;
  144. }
  145. });
  146. },
  147. GetOrderDetail: function(order_id) {
  148. const params = {
  149. id: order_id
  150. };
  151. getWarehouseInfoList(params).then(response => {
  152. if (response.data.state == 0) {
  153. this.$message.error(response.data.msg);
  154. return false;
  155. } else {
  156. var obj = ""
  157. for (let i = 0; i < response.data.data.info.length; i++) {
  158. this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
  159. }
  160. this.WarehouseInfo.warehouse = response.data.data.warehousing;
  161. var total_price = 0
  162. for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
  163. total_price += this.WarehouseInfo.warehouseInfoDate[i].warehousing_count * this.WarehouseInfo.warehouseInfoDate[i].price
  164. }
  165. this.allPrice = total_price
  166. console.log("total_price",total_price)
  167. console.log("数据222222222",this.WarehouseInfo.warehouseInfoDate)
  168. }
  169. });
  170. },
  171. getSpecificationName: function(id) {
  172. let name = "";
  173. for (let i = 0; i < this.goodInfo.length; i++) {
  174. if (this.goodInfo[i].id == id) {
  175. name = this.goodInfo[i].specification_name;
  176. }
  177. }
  178. return name;
  179. },
  180. getTypeName: function(id) {
  181. let name = "";
  182. for (let i = 0; i < this.goodType.length; i++) {
  183. if (this.goodType[i].id == id) {
  184. name = this.goodType[i].type_name;
  185. }
  186. }
  187. return name;
  188. },
  189. getTypeNameOne:function(id){
  190. let name = "";
  191. for (let i = 0; i < this.goodInfo.length; i++) {
  192. if (this.goodInfo[i].id == id) {
  193. name = this.goodInfo[i].good_name;
  194. }
  195. }
  196. return name;
  197. },
  198. getList() {
  199. this.goodInfo.loading = true
  200. let params = {
  201. page: this.page,
  202. limit: this.limit,
  203. keyword: this.keywords,
  204. is_use:this.is_use,
  205. good_kind:this.good_kind,
  206. is_charge: this.is_charge,
  207. }
  208. getGoodInfoList(params).then(response => {
  209. if (response.data.state == 0) {
  210. this.$message.error(response.data.msg)
  211. return false
  212. } else {
  213. this.list = []
  214. for (let i = 0; i < response.data.data.list.length; i++) {
  215. this.list.push(response.data.data.list[i])
  216. }
  217. console.log("list22222",this.list)
  218. }
  219. })
  220. },
  221. getUnit(id){
  222. var name = ""
  223. for(let i=0;i<this.list.length;i++){
  224. if(id == this.list[i].id){
  225. name = this.list[i].good_unit
  226. }
  227. }
  228. return this.getGoodUnit(name)
  229. },
  230. getGoodUnit(id){
  231. for (let i = 0; i <this.$store.getters.good_unit.length; i++ ){
  232. if(id == this.$store.getters.good_unit[i].id){
  233. return this.$store.getters.good_unit[i].name
  234. }
  235. }
  236. return ""
  237. },
  238. getManufacturer(id){
  239. let name = ''
  240. this.manufacturer.map(item => {
  241. if(item.id == id){
  242. name = item.manufacturer_name
  243. }
  244. })
  245. return name
  246. }
  247. },
  248. created(){
  249. const order_id = this.$route.query.id;
  250. this.GetConfigInfo();
  251. this.GetOrderDetail(order_id);
  252. this.getList()
  253. }
  254. }
  255. </script>
  256. <style rel="stylesheet/scss" lang="scss" scoped>
  257. .print_main_content {
  258. background-color: white;
  259. max-width: 1500px;
  260. margin: 0 auto;
  261. padding: 0 0 20px 0;
  262. .order_title_panl {
  263. text-align: center;
  264. .main_title {
  265. font-size: 18px;
  266. line-height: 40px;
  267. font-weight: 500;
  268. }
  269. }
  270. .table_panel {
  271. .table {
  272. width: 100%;
  273. border: 1px solid;
  274. border-collapse: collapse;
  275. padding: 2px;
  276. thead {
  277. tr {
  278. td {
  279. border: 1px solid;
  280. text-align: center;
  281. font-size: 18px;
  282. padding: 15px 5px;
  283. }
  284. }
  285. }
  286. tbody {
  287. tr {
  288. td {
  289. border: 1px solid;
  290. text-align: center;
  291. font-size: 18px;
  292. padding: 10px 5px;
  293. white-space: pre-line;
  294. .proj {
  295. padding: 5px 0;
  296. text-align: left;
  297. .proj_title {
  298. font-size: 16px;
  299. font-weight: 500;
  300. line-height: 25px;
  301. }
  302. .proj_item {
  303. font-size: 15px;
  304. line-height: 20px;
  305. .zone_name {
  306. font-weight: 500;
  307. }
  308. }
  309. }
  310. }
  311. }
  312. }
  313. }
  314. }
  315. }
  316. </style>