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

stockInOrderDetailPrint.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  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 warehousingInfo" :key="index">
  14. <div class="order_title_panl">
  15. <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
  16. <span style="font-weight:500;font-size:18px;">耗材入库登记单</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.warehousing_order}}
  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 style="line-height:18px;" width="80">耗材<br>名称</td>
  31. <td style="line-height:18px;" width="80">注册证号/批准文号/备案凭证号</td>
  32. <td style="line-height:18px;" width="80">规格<br>型号</td>
  33. <td style="line-height:18px;" width="80">生产<br>厂商</td>
  34. <td style="line-height:18px;" width="80">单位</td>
  35. <td style="line-height:18px;" width="80">进货价</td>
  36. <td style="line-height:18px;" width="80">入库<br>数量</td>
  37. <td style="line-height:18px;" width="60">总价</td>
  38. <td style="line-height:18px;" width="80">批号</td>
  39. <td style="line-height:18px;" width="120">生产日期</td>
  40. <td style="line-height:18px;" width="120">有效日期</td>
  41. <td style="line-height:18px;" width="120">入库日期</td>
  42. <td style="line-height:18px;" width="60">质检<br>意见</td>
  43. <td style="line-height:18px;" width="60">验收<br>结论</td>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. <tr v-for='(item,index) in it.child' :key="index">
  48. <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
  49. <td style="line-height:18px;">{{ item.license_number }}</td>
  50. <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
  51. <td style="line-height:18px;">{{ getManufacturer(item.good_id) }}</td>
  52. <td style="line-height:18px;"><span v-if="item.good_id!=0">{{item.GoodInfo.packing_unit}}</span></td>
  53. <td style="line-height:18px;">{{item.price}}</td>
  54. <td style="line-height:18px;">{{item.warehousing_count}}</td>
  55. <td style="line-height:18px;">{{(item.warehousing_count*item.price).toFixed(2)}}</td>
  56. <td style="line-height:18px;">{{ item.number }}</td>
  57. <td style="line-height:18px;">{{ getTime(item.product_date) }}</td>
  58. <td style="line-height:18px;">{{ getTime(item.expiry_date) }}</td>
  59. <td style="line-height:18px;">{{ getTime(item.ctime) }}</td>
  60. <td style="line-height:18px;">正常<br>入库</td>
  61. <td style="line-height:18px;">合格</td>
  62. </tr>
  63. <tr>
  64. <td>合计</td>
  65. <td colspan="12" style="text-align:right;">{{getAllPice(it.id).toFixed(2)}}</td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. <div style="display:flex;margin-top:1px;float:right;">
  70. <div style="width:50px;">审批:</div><div style="width:100px;"></div>
  71. <div style="width:80px;" v-if='orgId != 10024'>药材主任:</div><div style="width:100px;"></div>
  72. <div style="width:50px;">会计:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
  73. <div style="width:50px;">审核:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
  74. <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(it.creater) }}</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 {
  85. GetAllConfig,
  86. getWarehouseInfoList,
  87. getGoodInfoList
  88. } from "@/api/stock";
  89. import { fetchAllAdminUsers } from "@/api/doctor";
  90. import print from 'print-js'
  91. const moment = require('moment')
  92. import { uParseTime } from '@/utils/tools'
  93. export default {
  94. components:{
  95. BreadCrumb
  96. },
  97. data(){
  98. return{
  99. crumbs: [
  100. { path: false, name: '库存管理' },
  101. { path: false, name: '耗材管理' },
  102. { path: false, name: '入库单打印' },
  103. ],
  104. isEdit: 0,
  105. checked: false,
  106. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  107. goodType: [],
  108. goodInfo: [],
  109. manufacturer: [],
  110. dealer: [],
  111. Warehouse: {
  112. loading: false,
  113. warehouseDate: [],
  114. tableCurrentIndex: ""
  115. },
  116. WarehouseInfo: {
  117. loading: false,
  118. warehouseInfoDate: [],
  119. warehouse: {}
  120. },
  121. time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  122. allPrice:0,
  123. page: 1,
  124. limit: 10000,
  125. keyword: "",
  126. is_use:"",
  127. good_kind:"",
  128. is_charge:"",
  129. list:[],
  130. orgName:'',
  131. orgId:'',
  132. adminUserOptions:[],
  133. warehousingInfo:[],
  134. warehousList:[]
  135. }
  136. },
  137. methods:{
  138. printAction: function() {
  139. 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: 14px; padding: 1px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 12px; 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; } }'
  140. printJS({
  141. printable: 'print_content',
  142. type: 'html',
  143. documentTitle: ' ',
  144. style: style,
  145. scanStyles: false
  146. })
  147. },
  148. getTime(val) {
  149. if(val < 0){
  150. return ""
  151. }
  152. if(val == ""){
  153. return ""
  154. }else {
  155. return uParseTime(val, '{y}-{m}-{d}')
  156. }
  157. },
  158. GetConfigInfo: function() {
  159. GetAllConfig().then(response => {
  160. if (response.data.state == 0) {
  161. this.$message.error(response.data.msg);
  162. return false;
  163. } else {
  164. this.manufacturer = response.data.data.manufacturer;
  165. this.dealer = response.data.data.dealer;
  166. this.goodInfo = response.data.data.goodInfo;
  167. this.goodType = response.data.data.goodType;
  168. for(let i=0;i<this.goodInfo.length;i++){
  169. this.goodInfo[i].manufacturer_name = ""
  170. }
  171. for(let i=0;i<this.goodInfo.length;i++){
  172. for(let j=0;j<this.manufacturer.length;j++){
  173. if(this.goodInfo[i].manufacturer == this.manufacturer[j].id){
  174. this.goodInfo[i].manufacturer_name = this.manufacturer[j].manufacturer_name
  175. }
  176. }
  177. }
  178. console.log("商品信息",this.goodInfo)
  179. }
  180. });
  181. },
  182. GetOrderDetail: function(order_id) {
  183. const params = {
  184. id: order_id
  185. };
  186. getWarehouseInfoList(params).then(response => {
  187. if (response.data.state == 0) {
  188. this.$message.error(response.data.msg);
  189. return false;
  190. } else {
  191. var info = response.data.data.info
  192. console.log("info2222",info)
  193. var warehousing = response.data.data.warehousing
  194. console.log("warehousing",warehousing)
  195. this.warehousList = info
  196. for(let i=0;i<warehousing.length;i++){
  197. warehousing[i].child = []
  198. for(let j=0;j<info.length;j++){
  199. if(warehousing[i].id == info[j].warehousing_id){
  200. warehousing[i].child.push(info[j])
  201. }
  202. }
  203. }
  204. this.warehousingInfo = warehousing
  205. }
  206. });
  207. },
  208. getSpecificationName: 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].specification_name;
  213. }
  214. }
  215. return name;
  216. },
  217. getTypeName: function(id) {
  218. let name = "";
  219. for (let i = 0; i < this.goodType.length; i++) {
  220. if (this.goodType[i].id == id) {
  221. name = this.goodType[i].type_name;
  222. }
  223. }
  224. return name;
  225. },
  226. getTypeNameOne:function(id){
  227. let name = "";
  228. for (let i = 0; i < this.goodInfo.length; i++) {
  229. if (this.goodInfo[i].id == id) {
  230. name = this.goodInfo[i].good_name;
  231. }
  232. }
  233. return name;
  234. },
  235. getList() {
  236. this.goodInfo.loading = true
  237. let params = {
  238. page: this.page,
  239. limit: this.limit,
  240. keyword: this.keywords,
  241. is_use:this.is_use,
  242. good_kind:this.good_kind,
  243. is_charge: this.is_charge,
  244. }
  245. getGoodInfoList(params).then(response => {
  246. if (response.data.state == 0) {
  247. this.$message.error(response.data.msg)
  248. return false
  249. } else {
  250. this.list = []
  251. for (let i = 0; i < response.data.data.list.length; i++) {
  252. this.list.push(response.data.data.list[i])
  253. }
  254. console.log("list22222",this.list)
  255. }
  256. })
  257. },
  258. getUnit(id){
  259. var name = ""
  260. for(let i=0;i<this.list.length;i++){
  261. if(id == this.list[i].id){
  262. name = this.list[i].good_unit
  263. }
  264. }
  265. return this.getGoodUnit(name)
  266. },
  267. getGoodUnit(id){
  268. for (let i = 0; i <this.$store.getters.good_unit.length; i++ ){
  269. if(id == this.$store.getters.good_unit[i].id){
  270. return this.$store.getters.good_unit[i].name
  271. }
  272. }
  273. return ""
  274. },
  275. // getManufacturer(id){
  276. // let name = ''
  277. // this.manufacturer.map(item => {
  278. // if(item.id == id){
  279. // name = item.manufacturer_name
  280. // }
  281. // })
  282. // return name
  283. // },
  284. getManufacturer(id){
  285. let name = ""
  286. for(let i=0;i<this.goodInfo.length;i++){
  287. if(id == this.goodInfo[i].id){
  288. name =this.goodInfo[i].manufacturer_name
  289. }
  290. }
  291. return name
  292. },
  293. fetchAllAdminUsers() {
  294. fetchAllAdminUsers().then(response => {
  295. console.log(response);
  296. if (response.data.state == 1) {
  297. this.adminUserOptions = response.data.data.users;
  298. var alen = this.adminUserOptions.length;
  299. for (let index = 0; index < alen; index++) {
  300. if (this.adminUserOptions[index].user_type == 2) {
  301. // this.doctorOptions.push(this.adminUserOptions[index]);
  302. }
  303. }
  304. }
  305. });
  306. },
  307. getXuserName(id) {
  308. if (id <= 0) {
  309. return "";
  310. }
  311. var name = "";
  312. if (
  313. this.adminUserOptions == null ||
  314. typeof this.adminUserOptions.length === "undefined"
  315. ) {
  316. return name;
  317. }
  318. var leng = this.adminUserOptions.length;
  319. if (leng == 0) {
  320. return name;
  321. }
  322. for (let index = 0; index < leng; index++) {
  323. if (this.adminUserOptions[index].id == id) {
  324. name = this.adminUserOptions[index].name;
  325. break;
  326. }
  327. }
  328. return name;
  329. },
  330. getAllPice(id){
  331. var total_price = 0
  332. for(let i=0;i<this.warehousList.length;i++){
  333. if(id == this.warehousList[i].warehousing_id){
  334. total_price += this.warehousList[i].warehousing_count * this.warehousList[i].price
  335. }
  336. }
  337. return total_price
  338. }
  339. },
  340. created(){
  341. this.orgName = this.$store.getters.xt_user.org.org_name;
  342. this.orgId = this.$store.getters.xt_user.org.id;
  343. const order_id = this.$route.query.id;
  344. this.fetchAllAdminUsers()
  345. this.GetConfigInfo();
  346. this.GetOrderDetail(order_id);
  347. this.getList()
  348. }
  349. }
  350. </script>
  351. <style rel="stylesheet/scss" lang="scss" scoped>
  352. .print_main_content {
  353. background-color: white;
  354. max-width: 1500px;
  355. margin: 0 auto;
  356. padding: 0 0 20px 0;
  357. .order_title_panl {
  358. text-align: center;
  359. .main_title {
  360. font-size: 18px;
  361. line-height: 40px;
  362. font-weight: 500;
  363. }
  364. }
  365. .table_panel {
  366. .table {
  367. width: 100%;
  368. border: 1px solid;
  369. border-collapse: collapse;
  370. padding: 2px;
  371. thead {
  372. tr {
  373. td {
  374. border: 1px solid;
  375. text-align: center;
  376. font-size: 18px;
  377. padding: 1px 5px;
  378. }
  379. }
  380. }
  381. tbody {
  382. tr {
  383. td {
  384. border: 1px solid;
  385. text-align: center;
  386. font-size: 18px;
  387. padding: 10px 5px;
  388. white-space: pre-line;
  389. .proj {
  390. padding: 5px 0;
  391. text-align: left;
  392. .proj_title {
  393. font-size: 16px;
  394. font-weight: 500;
  395. line-height: 25px;
  396. }
  397. .proj_item {
  398. font-size: 15px;
  399. line-height: 20px;
  400. .zone_name {
  401. font-weight: 500;
  402. }
  403. }
  404. }
  405. }
  406. }
  407. }
  408. }
  409. }
  410. }
  411. </style>