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

purchaseOrderPrint.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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="display:flex;justify-content: space-between;">
  19. <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
  20. 供应商:{{getSupplyName(supplier_id)}}
  21. </div>
  22. <div style="margin-bottom:1px;font-size: 18px;">
  23. 单据日期:{{rate_of_concession}}
  24. </div>
  25. <div style="margin-bottom:1px;font-size: 18px;">
  26. 单据编号:{{number}}
  27. </div>
  28. <div style="margin-bottom:1px;font-size: 18px;">
  29. 币别:RMB
  30. </div>
  31. </div>
  32. <div class="table_panel">
  33. <table class="table">
  34. <thead>
  35. <tr>
  36. <td style="line-height:18px;" width="80">序号</td>
  37. <td style="line-height:18px;" width="80">商品</td>
  38. <td style="line-height:18px;" width="80">单位</td>
  39. <td style="line-height:18px;" width="80">数量</td>
  40. <td style="line-height:18px;" width="80">购货单价</td>
  41. <td style="line-height:18px;" width="80">折扣率</td>
  42. <td style="line-height:18px;" width="80">折扣额</td>
  43. <td style="line-height:18px;" width="60">购物金额</td>
  44. <td style="line-height:18px;" width="80">仓库</td>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. <tr v-for='(item,index) in tableList' :key="index">
  49. <td style="line-height:18px;"><span>{{index+ 1}}</span></td>
  50. <td style="line-height:18px;"><span>{{item.supply_name}}</span></td>
  51. <td style="line-height:18px;"><span></span></td>
  52. <td style="line-height:18px;"><span>{{item.count}}</span></td>
  53. <td style="line-height:18px;"><span>{{item.price}}</span></td>
  54. <td style="line-height:18px;"><span></span></td>
  55. <td style="line-height:18px;"><span></span></td>
  56. <td style="line-height:18px;"><span></span></td>
  57. <td style="line-height:18px;"><span></span></td>
  58. </tr>
  59. <tr>
  60. <td>合计</td>
  61. <td colspan="12" style="text-align:right;"></td>
  62. </tr>
  63. </tbody>
  64. </table>
  65. <div style="margin-top:1px;">
  66. <div style="width:100px;">折扣额:</div><div style="width:100px;"></div>
  67. <div style="width:100px;">折扣金额:</div><div style="width:100px;"><span></span></div>
  68. <div style="width:100px;">本次付款:</div><div style="width:100px;"><span></span></div>
  69. <div style="width:100px;">本次欠款:</div><div style="width:100px;"></div>
  70. </div>
  71. <div style="margin-top:1px;">
  72. <div style="width:100px;">备注</div><div style="width:100px;"></div>
  73. </div>
  74. <div style="margin-top:1px;">
  75. <div style="width:100px;">制单人:</div><div style="width:100px;"></div>
  76. <div style="width:100px;">收货人签字:</div><div style="width:100px;"><span></span></div>
  77. <div style="width:100px;">供应商签字:</div><div style="width:100px;"><span></span></div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </template>
  85. <script>
  86. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  87. import { fetchAllAdminUsers } from "@/api/doctor";
  88. import {getPurchaseOrderDetail} from "@/api/supply"
  89. import print from 'print-js'
  90. const moment = require('moment')
  91. import { uParseTime } from '@/utils/tools'
  92. export default {
  93. components:{
  94. BreadCrumb
  95. },
  96. data(){
  97. return{
  98. crumbs: [
  99. { path: false, name: '库存管理' },
  100. { path: false, name: '耗材管理' },
  101. { path: false, name: '入库单打印' },
  102. ],
  103. isEdit: 0,
  104. checked: false,
  105. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  106. time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  107. orgName:'',
  108. orgId:'',
  109. adminUserOptions:[],
  110. tableList:[],
  111. number:"",
  112. id:"",
  113. supplier_id:"",
  114. rate_of_concession:"",
  115. discount_amount:"",
  116. supplyList:[],
  117. document_date:"",
  118. }
  119. },
  120. methods:{
  121. printAction: function() {
  122. 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; } }'
  123. printJS({
  124. printable: 'print_content',
  125. type: 'html',
  126. documentTitle: ' ',
  127. style: style,
  128. scanStyles: false
  129. })
  130. },
  131. getTime(val) {
  132. if(val < 0){
  133. return ""
  134. }
  135. if(val == ""){
  136. return ""
  137. }else {
  138. return uParseTime(val, '{y}-{m}-{d}')
  139. }
  140. },
  141. fetchAllAdminUsers() {
  142. fetchAllAdminUsers().then(response => {
  143. if (response.data.state == 1) {
  144. this.adminUserOptions = response.data.data.users
  145. }
  146. })
  147. },
  148. getXuserName(id) {
  149. if (id <= 0) {
  150. return "";
  151. }
  152. var name = "";
  153. if (
  154. this.adminUserOptions == null ||
  155. typeof this.adminUserOptions.length === "undefined"
  156. ) {
  157. return name;
  158. }
  159. var leng = this.adminUserOptions.length;
  160. if (leng == 0) {
  161. return name;
  162. }
  163. for (let index = 0; index < leng; index++) {
  164. if (this.adminUserOptions[index].id == id) {
  165. name = this.adminUserOptions[index].name;
  166. break;
  167. }
  168. }
  169. return name;
  170. },
  171. getPurchaseOrderDetail(){
  172. var id = this.$route.query.id
  173. getPurchaseOrderDetail(id).then(response=>{
  174. if(response.data.state == 1){
  175. var info = response.data.data.info
  176. this.is_check = info.is_check
  177. this.number = info.number
  178. this.id = info.id
  179. this.supplier_id = info.supplier_id
  180. this.rate_of_concession = info.rate_of_concession
  181. this.discount_amount = info.discount_amount
  182. this.document_date = info.document_date
  183. var orderInfo = response.data.data.orderInfo
  184. var supplyList = response.data.data.supplyList
  185. this.supplyList = supplyList
  186. for(let i=0;i<orderInfo.length;i++){
  187. orderInfo[i].supply_count = orderInfo[i].count
  188. orderInfo[i].supply_price = orderInfo[i].price
  189. orderInfo[i].supply_remake = orderInfo[i].remark
  190. orderInfo[i].type = orderInfo[i].is_source
  191. orderInfo[i].project_id = orderInfo[i].project_id
  192. }
  193. console.log("orderINFO23323232",orderInfo)
  194. this.tableList = orderInfo
  195. }
  196. })
  197. },
  198. getSupplyName(id){
  199. var name = ""
  200. for(let i=0;i<this.supplyList.length;i++){
  201. if(id == this.supplyList[i].id){
  202. name = this.supplyList[i].supplier_name
  203. }
  204. }
  205. return name
  206. },
  207. },
  208. created(){
  209. this.orgName = this.$store.getters.xt_user.org.org_name;
  210. this.orgId = this.$store.getters.xt_user.org.id;
  211. this.fetchAllAdminUsers()
  212. this.getPurchaseOrderDetail()
  213. }
  214. }
  215. </script>
  216. <style rel="stylesheet/scss" lang="scss" scoped>
  217. .print_main_content {
  218. background-color: white;
  219. max-width: 1500px;
  220. margin: 0 auto;
  221. padding: 0 0 20px 0;
  222. .order_title_panl {
  223. text-align: center;
  224. .main_title {
  225. font-size: 18px;
  226. line-height: 40px;
  227. font-weight: 500;
  228. }
  229. }
  230. .table_panel {
  231. .table {
  232. width: 100%;
  233. border: 1px solid;
  234. border-collapse: collapse;
  235. padding: 2px;
  236. thead {
  237. tr {
  238. td {
  239. border: 1px solid;
  240. text-align: center;
  241. font-size: 18px;
  242. padding: 1px 5px;
  243. }
  244. }
  245. }
  246. tbody {
  247. tr {
  248. td {
  249. border: 1px solid;
  250. text-align: center;
  251. font-size: 18px;
  252. padding: 10px 5px;
  253. white-space: pre-line;
  254. .proj {
  255. padding: 5px 0;
  256. text-align: left;
  257. .proj_title {
  258. font-size: 16px;
  259. font-weight: 500;
  260. line-height: 25px;
  261. }
  262. .proj_item {
  263. font-size: 15px;
  264. line-height: 20px;
  265. .zone_name {
  266. font-weight: 500;
  267. }
  268. }
  269. }
  270. }
  271. }
  272. }
  273. }
  274. }
  275. }
  276. </style>