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

stockInOrderDetailPrint.vue 15KB

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