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

stockOutOrderDetailPrint.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  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 class="main_title">耗材出库登记单</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. 单据编号:{{warehousingOutInfo.info.warehouse_out_order_number}}
  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 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. <td width="80">生产日期</td>
  38. <td width="80">有效日期</td>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. <tr v-for='(item,index) in warehousingOutInfo.warehousingOutData' :key="index">
  43. <td><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
  44. <td><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
  45. <td><span v-if="item.good_id!=0">{{getUnit(item.good_id)}}</span></td>
  46. <td>{{getOutStockCount(item.good_id) + getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id)}}</td>
  47. <td>{{item.price}}</td>
  48. <td>{{((getOutStockCount(item.good_id) +getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id))*item.price).toFixed(2)}}</td>
  49. <td>{{getNumber(item.good_id)}}</td>
  50. <td>{{getProductDate(item.good_id)}}</td>
  51. <td>{{getExpiryDate(item.good_id)}}</td>
  52. </tr>
  53. <tr>
  54. <td>合计</td>
  55. <td colspan="7"></td>
  56. <td>{{allPrice.toFixed(2)}}</td>
  57. </tr>
  58. </tbody>
  59. </table>
  60. <div v-if="orgId != 10024" style="display:flex;margin-top:1px;float:right;">
  61. <div style="width:50px;">审批:</div><div style="width:100px;"></div>
  62. <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
  63. <div style="width:50px;">会计:</div><div style="width:100px;"></div>
  64. <div style="width:50px;">审核:</div><div style="width:100px;"></div>
  65. <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
  66. </div>
  67. <div v-if="orgId == 10024" style="display:flex;margin-top:1px;float:right;">
  68. <div style="width:50px;">科室:</div><div style="width:60px;"></div>
  69. <div style="width:70px;">领料人:</div><div style="width:60px;"></div>
  70. <div style="width:80px;">审批:</div><div style="width:100px;">肖庆娥</div>
  71. <div style="width:50px;">会计:</div><div style="width:100px;">徐立琼</div>
  72. <div style="width:50px;">审核:</div><div style="width:100px;">徐立琼</div>
  73. <div style="width:70px;">制单人:</div><div style="width:100px;">徐立琼</div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </template>
  81. <script>
  82. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  83. import { GetAllConfig,getWarehouseOutInfo,GetOutStockTotalCount,getGoodInfoList,getWarehouseOrderInfoList } from "@/api/stock";
  84. import print from 'print-js'
  85. const moment = require('moment');
  86. import { uParseTime } from '@/utils/tools'
  87. export default {
  88. components:{
  89. BreadCrumb
  90. },
  91. data(){
  92. return{
  93. crumbs: [
  94. { path: false, name: '库存管理' },
  95. { path: false, name: '耗材管理' },
  96. { path: false, name: '入库单打印' },
  97. ],
  98. isEdit: 0,
  99. checked: false,
  100. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  101. goodType: [],
  102. goodInfo: [],
  103. manufacturer: [],
  104. dealer: [],
  105. warehousingOutInfo: {
  106. loading: false,
  107. warehousingOutData: [],
  108. info: {}
  109. },
  110. stockCount:[],
  111. time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  112. allPrice:0,
  113. page: 1,
  114. limit: 10000,
  115. keyword: "",
  116. is_use:"",
  117. good_kind:"",
  118. is_charge:"",
  119. list:[],
  120. wareoutList:[],
  121. orgId:'',
  122. orgName:'',
  123. orderInList:[]
  124. }
  125. },
  126. methods:{
  127. printAction: function() {
  128. 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; } }';
  129. printJS({
  130. printable: 'print_content',
  131. type: 'html',
  132. documentTitle: ' ',
  133. style: style,
  134. scanStyles: false
  135. })
  136. },
  137. GetConfigInfo() {
  138. GetAllConfig().then(response => {
  139. if (response.data.state == 0) {
  140. this.$message.error(response.data.msg);
  141. return false
  142. } else {
  143. this.manufacturer = response.data.data.manufacturer;
  144. this.dealer = response.data.data.dealer;
  145. this.goodInfo = response.data.data.goodInfo;
  146. this.goodType = response.data.data.goodType
  147. }
  148. })
  149. },
  150. GetOrderDetail: function(order_id) {
  151. const params = {
  152. 'id': order_id
  153. };
  154. getWarehouseOutInfo(params).then(response => {
  155. if (response.data.state == 0) {
  156. this.$message.error(response.data.msg);
  157. return false
  158. } else {
  159. for (let i = 0; i < response.data.data.list.length; i++) {
  160. this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
  161. }
  162. this.warehousingOutInfo.info = response.data.data.info;
  163. console.log("数据源头9999999999",this.warehousingOutInfo.warehousingOutData);
  164. var total_price = 0;
  165. for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
  166. total_price += this.warehousingOutInfo.warehousingOutData[i].total_price
  167. }
  168. console.log('this.allPrice',this.allPrice)
  169. this.allPrice = total_price;
  170. var wareoutList = response.data.data.wareoutList;
  171. console.log("出库数据",wareoutList);
  172. this.wareoutList = wareoutList
  173. }
  174. })
  175. },
  176. GetTotalCount(time){
  177. var params = {
  178. warehouse_out_time:time
  179. };
  180. GetOutStockTotalCount(params).then(response=>{
  181. if(response.data.state == 1){
  182. var stockCount = response.data.data.stockCount;
  183. console.log("stockCount",stockCount);
  184. this.stockCount = stockCount
  185. }
  186. })
  187. },
  188. getSpecificationName: function(id) {
  189. let name = '';
  190. for (let i = 0; i < this.goodInfo.length; i++) {
  191. if (this.goodInfo[i].id == id) {
  192. name = this.goodInfo[i].specification_name
  193. }
  194. }
  195. return name
  196. },
  197. getTypeName: function(id) {
  198. let name = '';
  199. for (let i = 0; i < this.goodType.length; i++) {
  200. if (this.goodType[i].id == id) {
  201. name = this.goodType[i].type_name
  202. }
  203. }
  204. return name
  205. },
  206. getTypeNameOne: function(id) {
  207. let name = '';
  208. for (let i = 0; i < this.goodInfo.length; i++) {
  209. if (this.goodInfo[i].id == id) {
  210. name = this.goodInfo[i].good_name
  211. }
  212. }
  213. return name
  214. },
  215. getOutStockCount(id){
  216. var count = 0;
  217. for(let i=0;i<this.stockCount.length;i++){
  218. if(id == this.stockCount[i].good_id){
  219. count = this.stockCount[i].count
  220. }
  221. }
  222. return count
  223. },
  224. getList() {
  225. this.goodInfo.loading = true;
  226. let params = {
  227. page: this.page,
  228. limit: this.limit,
  229. keyword: this.keywords,
  230. is_use:this.is_use,
  231. good_kind:this.good_kind,
  232. is_charge: this.is_charge,
  233. };
  234. getGoodInfoList(params).then(response => {
  235. if (response.data.state == 0) {
  236. this.$message.error(response.data.msg);
  237. return false
  238. } else {
  239. this.list = [];
  240. for (let i = 0; i < response.data.data.list.length; i++) {
  241. this.list.push(response.data.data.list[i])
  242. }
  243. console.log("list22222",this.list)
  244. }
  245. })
  246. },
  247. getUnit(id){
  248. var name = "";
  249. for(let i=0;i<this.list.length;i++){
  250. if(id == this.list[i].id){
  251. name = this.list[i].good_unit
  252. }
  253. }
  254. return this.getGoodUnit(name)
  255. },
  256. getGoodUnit(id){
  257. for (let i = 0; i <this.$store.getters.good_unit.length; i++ ){
  258. if(id == this.$store.getters.good_unit[i].id){
  259. return this.$store.getters.good_unit[i].name
  260. }
  261. }
  262. return ""
  263. },
  264. getWarehouseOutInfoCount(warehouse_out_id,good_id){
  265. var count = 0;
  266. for(let i=0;i<this.wareoutList.length;i++){
  267. if(warehouse_out_id == this.wareoutList[i].warehouse_out_id && good_id == this.wareoutList[i].good_id){
  268. count = this.wareoutList[i].count
  269. }
  270. }
  271. return count
  272. },
  273. getWarehouseOrderInfoList(){
  274. getWarehouseOrderInfoList().then(response=>{
  275. if(response.data.state == 1){
  276. var list = response.data.data.list
  277. console.log("入库单详情",list)
  278. this.orderInList = list
  279. }
  280. })
  281. },
  282. getNumber(id){
  283. var name = ""
  284. for(let i=0;i<this.orderInList.length;i++){
  285. if(id == this.orderInList[i].good_id){
  286. name = this.orderInList[i].number
  287. }
  288. }
  289. return name
  290. },
  291. getProductDate(id){
  292. var product_date = ""
  293. for(let i=0;i<this.orderInList.length;i++){
  294. if(id == this.orderInList[i].good_id){
  295. product_date = this.orderInList[i].product_date
  296. }
  297. }
  298. return this.getTime(product_date)
  299. },
  300. getExpiryDate(id){
  301. var expiry_date = ""
  302. for(let i=0;i<this.orderInList.length;i++){
  303. if(id == this.orderInList[i].good_id){
  304. expiry_date = this.orderInList[i].expiry_date
  305. }
  306. }
  307. return this.getTime(expiry_date)
  308. },
  309. getTime(val) {
  310. if(val < 0){
  311. return ""
  312. }
  313. if(val == ""){
  314. return ""
  315. }else {
  316. return uParseTime(val, '{y}-{m}-{d}')
  317. }
  318. },
  319. },
  320. created(){
  321. this.orgName = this.$store.getters.xt_user.org.org_name;
  322. this.orgId = this.$store.getters.xt_user.org.id;
  323. const order_id = this.$route.query.id;
  324. const warehouse_out_time = this.$route.query.warehouse_out_time;
  325. this.GetConfigInfo();
  326. this.GetOrderDetail(order_id);
  327. this.GetTotalCount(warehouse_out_time);
  328. this.getList()
  329. //获取所有入库单
  330. this.getWarehouseOrderInfoList()
  331. }
  332. }
  333. </script>
  334. <style rel="stylesheet/scss" lang="scss" scoped>
  335. .print_main_content {
  336. background-color: white;
  337. max-width: 1500px;
  338. margin: 0 auto;
  339. padding: 0 0 20px 0;
  340. .order_title_panl {
  341. text-align: center;
  342. .main_title {
  343. font-size: 18px;
  344. line-height: 40px;
  345. font-weight: 500;
  346. }
  347. }
  348. .table_panel {
  349. .table {
  350. width: 100%;
  351. border: 1px solid;
  352. border-collapse: collapse;
  353. padding: 2px;
  354. thead {
  355. tr {
  356. td {
  357. border: 1px solid;
  358. text-align: center;
  359. font-size: 18px;
  360. padding: 15px 5px;
  361. }
  362. }
  363. }
  364. tbody {
  365. tr {
  366. td {
  367. border: 1px solid;
  368. text-align: center;
  369. font-size: 18px;
  370. padding: 10px 5px;
  371. white-space: pre-line;
  372. .proj {
  373. padding: 5px 0;
  374. text-align: left;
  375. .proj_title {
  376. font-size: 16px;
  377. font-weight: 500;
  378. line-height: 25px;
  379. }
  380. .proj_item {
  381. font-size: 15px;
  382. line-height: 20px;
  383. .zone_name {
  384. font-weight: 500;
  385. }
  386. }
  387. }
  388. }
  389. }
  390. }
  391. }
  392. }
  393. }
  394. </style>