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

stockOutOrderDetailPrint.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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. </tr>
  31. </thead>
  32. <tbody>
  33. <tr v-for='(item,index) in warehousingOutInfo.warehousingOutData' :key="index">
  34. <td><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
  35. <td><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
  36. <td><span v-if="item.good_id!=0">{{getUnit(item.good_id)}}</span></td>
  37. <td>{{item.price}}</td>
  38. <td>{{getOutStockCount(item.good_id) + getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id)}}</td>
  39. <td>{{((getOutStockCount(item.good_id) +getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id))*item.price).toFixed(2)}}</td>
  40. </tr>
  41. <tr>
  42. <td>合计</td>
  43. <td colspan="4"></td>
  44. <td>{{allPrice.toFixed(2)}}</td>
  45. </tr>
  46. </tbody>
  47. </table>
  48. <div style="display:flex;margin-top:20px;float:right;">
  49. <div style="width:50px;">审批:</div><div style="width:100px;"></div>
  50. <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
  51. <div style="width:50px;">会计:</div><div style="width:100px;"></div>
  52. <div style="width:50px;">审核:</div><div style="width:100px;"></div>
  53. <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  63. import { GetAllConfig,getWarehouseOutInfo,GetOutStockTotalCount,getGoodInfoList } from "@/api/stock";
  64. import print from 'print-js'
  65. const moment = require('moment')
  66. export default {
  67. components:{
  68. BreadCrumb
  69. },
  70. data(){
  71. return{
  72. crumbs: [
  73. { path: false, name: '库存管理' },
  74. { path: false, name: '耗材管理' },
  75. { path: false, name: '入库单打印' },
  76. ],
  77. isEdit: 0,
  78. checked: false,
  79. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  80. goodType: [],
  81. goodInfo: [],
  82. manufacturer: [],
  83. dealer: [],
  84. warehousingOutInfo: {
  85. loading: false,
  86. warehousingOutData: [],
  87. info: {}
  88. },
  89. stockCount:[],
  90. time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  91. allPrice:0,
  92. page: 1,
  93. limit: 10000,
  94. keyword: "",
  95. is_use:"",
  96. good_kind:"",
  97. is_charge:"",
  98. list:[],
  99. wareoutList:[],
  100. }
  101. },
  102. methods:{
  103. printAction: function() {
  104. 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; } }'
  105. printJS({
  106. printable: 'print_content',
  107. type: 'html',
  108. documentTitle: ' ',
  109. style: style,
  110. scanStyles: false
  111. })
  112. },
  113. GetConfigInfo() {
  114. GetAllConfig().then(response => {
  115. if (response.data.state == 0) {
  116. this.$message.error(response.data.msg)
  117. return false
  118. } else {
  119. this.manufacturer = response.data.data.manufacturer
  120. this.dealer = response.data.data.dealer
  121. this.goodInfo = response.data.data.goodInfo
  122. this.goodType = response.data.data.goodType
  123. }
  124. })
  125. },
  126. GetOrderDetail: function(order_id) {
  127. const params = {
  128. 'id': order_id
  129. }
  130. getWarehouseOutInfo(params).then(response => {
  131. if (response.data.state == 0) {
  132. this.$message.error(response.data.msg)
  133. return false
  134. } else {
  135. for (let i = 0; i < response.data.data.list.length; i++) {
  136. this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
  137. }
  138. this.warehousingOutInfo.info = response.data.data.info
  139. console.log("数据源头9999999999",this.warehousingOutInfo.warehousingOutData)
  140. var total_price = 0
  141. for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
  142. total_price += this.getOutStockCount(this.warehousingOutInfo.warehousingOutData[i].good_id)*this.warehousingOutInfo.warehousingOutData[i].price
  143. }
  144. this.allPrice = total_price
  145. var wareoutList = response.data.data.wareoutList
  146. console.log("出库数据",wareoutList)
  147. this.wareoutList = wareoutList
  148. }
  149. })
  150. },
  151. GetTotalCount(time){
  152. var params = {
  153. warehouse_out_time:time
  154. }
  155. GetOutStockTotalCount(params).then(response=>{
  156. if(response.data.state == 1){
  157. var stockCount = response.data.data.stockCount
  158. console.log("stockCount",stockCount)
  159. this.stockCount = stockCount
  160. }
  161. })
  162. },
  163. getSpecificationName: function(id) {
  164. let name = ''
  165. for (let i = 0; i < this.goodInfo.length; i++) {
  166. if (this.goodInfo[i].id == id) {
  167. name = this.goodInfo[i].specification_name
  168. }
  169. }
  170. return name
  171. },
  172. getTypeName: function(id) {
  173. let name = ''
  174. for (let i = 0; i < this.goodType.length; i++) {
  175. if (this.goodType[i].id == id) {
  176. name = this.goodType[i].type_name
  177. }
  178. }
  179. return name
  180. },
  181. getTypeNameOne: function(id) {
  182. let name = ''
  183. for (let i = 0; i < this.goodInfo.length; i++) {
  184. if (this.goodInfo[i].id == id) {
  185. name = this.goodInfo[i].good_name
  186. }
  187. }
  188. return name
  189. },
  190. getOutStockCount(id){
  191. var count = 0
  192. for(let i=0;i<this.stockCount.length;i++){
  193. if(id == this.stockCount[i].good_id){
  194. count = this.stockCount[i].count
  195. }
  196. }
  197. return count
  198. },
  199. getList() {
  200. this.goodInfo.loading = true
  201. let params = {
  202. page: this.page,
  203. limit: this.limit,
  204. keyword: this.keywords,
  205. is_use:this.is_use,
  206. good_kind:this.good_kind,
  207. is_charge: this.is_charge,
  208. }
  209. getGoodInfoList(params).then(response => {
  210. if (response.data.state == 0) {
  211. this.$message.error(response.data.msg)
  212. return false
  213. } else {
  214. this.list = []
  215. for (let i = 0; i < response.data.data.list.length; i++) {
  216. this.list.push(response.data.data.list[i])
  217. }
  218. console.log("list22222",this.list)
  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.wareoutList.length;i++){
  242. if(warehouse_out_id == this.wareoutList[i].warehouse_out_id && good_id == this.wareoutList[i].good_id){
  243. count = this.wareoutList[i].count
  244. }
  245. }
  246. return count
  247. }
  248. },
  249. created(){
  250. const order_id = this.$route.query.id;
  251. const warehouse_out_time = this.$route.query.warehouse_out_time
  252. this.GetConfigInfo()
  253. this.GetOrderDetail(order_id)
  254. this.GetTotalCount(warehouse_out_time)
  255. this.getList()
  256. }
  257. }
  258. </script>
  259. <style rel="stylesheet/scss" lang="scss" scoped>
  260. .print_main_content {
  261. background-color: white;
  262. max-width: 1500px;
  263. margin: 0 auto;
  264. padding: 0 0 20px 0;
  265. .order_title_panl {
  266. text-align: center;
  267. .main_title {
  268. font-size: 18px;
  269. line-height: 40px;
  270. font-weight: 500;
  271. }
  272. }
  273. .table_panel {
  274. .table {
  275. width: 100%;
  276. border: 1px solid;
  277. border-collapse: collapse;
  278. padding: 2px;
  279. thead {
  280. tr {
  281. td {
  282. border: 1px solid;
  283. text-align: center;
  284. font-size: 18px;
  285. padding: 15px 5px;
  286. }
  287. }
  288. }
  289. tbody {
  290. tr {
  291. td {
  292. border: 1px solid;
  293. text-align: center;
  294. font-size: 18px;
  295. padding: 10px 5px;
  296. white-space: pre-line;
  297. .proj {
  298. padding: 5px 0;
  299. text-align: left;
  300. .proj_title {
  301. font-size: 16px;
  302. font-weight: 500;
  303. line-height: 25px;
  304. }
  305. .proj_item {
  306. font-size: 15px;
  307. line-height: 20px;
  308. .zone_name {
  309. font-weight: 500;
  310. }
  311. }
  312. }
  313. }
  314. }
  315. }
  316. }
  317. }
  318. }
  319. </style>