print-foshan.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <div class="detail-container">
  3. <div class="print-page" v-for="(item, index) in showData" :key="index">
  4. <div class="print-title">
  5. <div class="title1">{{ company }}</div>
  6. <div class="title2">
  7. <div></div>
  8. <div>{{ item.type === 2 ? '销售退货单' : '销售发货单' }}</div>
  9. <div>{{ item.pickOrderWater }}</div>
  10. </div>
  11. </div>
  12. <div class="print-form-1">
  13. <el-row :gutter="0">
  14. <el-col :span="6" class="item">
  15. <div class="label">经销商编码:</div>
  16. <div class="value">{{ item.customerId }}</div>
  17. </el-col>
  18. <el-col :span="6" class="item">
  19. <div class="label">出库日期:</div>
  20. <div class="value">{{ nowDate }}</div>
  21. </el-col>
  22. <el-col :span="6" class="item">
  23. <div class="label">仓库:</div>
  24. <div class="value">{{ item.correspondName }}</div>
  25. </el-col>
  26. <el-col :span="6" class="item">
  27. <div class="label">信息密钥:</div>
  28. <div class="value">{{ item.informationKey }}</div>
  29. </el-col>
  30. <el-col :span="24" class="item">
  31. <div class="label">经销商:</div>
  32. <div class="value">{{ item.customerName }}</div>
  33. </el-col>
  34. </el-row>
  35. </div>
  36. <div class="print-table-1">
  37. <div class="head">
  38. <el-row :gutter="20">
  39. <el-col :span="4">发货单号/订单号</el-col>
  40. <el-col :span="3">销售类型</el-col>
  41. <el-col :span="3">文件编号</el-col>
  42. <el-col :span="8">规格型号</el-col>
  43. <el-col :span="3">单位</el-col>
  44. <el-col :span="3">数量</el-col>
  45. </el-row>
  46. </div>
  47. <div class="body">
  48. <div v-for="(item, index) in item.invoicePickBeans" :key="index">
  49. <el-row :gutter="20">
  50. <el-col :span="4">{{ item.invoiceId || '' }}</el-col>
  51. <el-col :span="3">{{ item.saleTypeName || '' }}</el-col>
  52. <el-col :span="3">{{ item.fileNo || '' }}</el-col>
  53. <el-col :span="8">{{ item.specification || '' }}</el-col>
  54. <el-col :span="3">{{ item.unit || '' }}</el-col>
  55. <el-col :span="3">{{ item.refundableQty || 0 }}</el-col>
  56. </el-row>
  57. <el-row :gutter="20">
  58. <el-col :span="4">{{ item.mainOrderId || '' }}</el-col>
  59. <el-col :span="2">发货日期</el-col>
  60. <el-col :span="4">{{ item.theTime || '' }}</el-col>
  61. <el-col :span="2">工程编号</el-col>
  62. <el-col :span="4">{{ item.refEnginRecordNo || '' }}</el-col>
  63. <el-col :span="2">备注</el-col>
  64. <el-col :span="6">{{ item.remark || '' }}</el-col>
  65. </el-row>
  66. </div>
  67. </div>
  68. <div class="foot">
  69. <el-row :gutter="20">
  70. <el-col :span="21">合计</el-col>
  71. <el-col :span="3">{{ item.total }}</el-col>
  72. </el-row>
  73. </div>
  74. </div>
  75. <div class="print-form-2">
  76. <el-row :gutter="30">
  77. <el-col :span="8" class="item">
  78. <div class="label">销售公司</div>
  79. <div class="value">
  80. <el-input readonly></el-input>
  81. </div>
  82. </el-col>
  83. <el-col :span="8" class="item">
  84. <div class="label">仓库</div>
  85. <div class="value">
  86. <el-input readonly></el-input>
  87. </div>
  88. </el-col>
  89. <el-col :span="8" class="item">
  90. <div class="label">经销商</div>
  91. <div class="value">
  92. <el-input readonly></el-input>
  93. </div>
  94. </el-col>
  95. </el-row>
  96. </div>
  97. </div>
  98. </div>
  99. </template>
  100. <script>
  101. export default {
  102. name: 'PrintFoshan',
  103. props: {
  104. detailData: {
  105. type: Object,
  106. default: null
  107. },
  108. company: {
  109. type: String,
  110. default: ''
  111. }
  112. },
  113. computed: {
  114. showData() {
  115. var showData = []
  116. if (this.detailData && this.detailData.invoicePickBeans) {
  117. for (var i = 0; i < this.detailData.invoicePickBeans.length; i += 2) {
  118. let obj = JSON.parse(JSON.stringify(this.detailData))
  119. obj.invoicePickBeans = this.detailData.invoicePickBeans.slice(i, i + 2)
  120. let num = 0
  121. obj.invoicePickBeans.forEach(item => {
  122. num = num + item.refundableQty
  123. })
  124. obj.total = num
  125. showData.push(obj)
  126. }
  127. }
  128. console.log(showData)
  129. return showData
  130. },
  131. nowDate() {
  132. var date = new Date()
  133. var seperator1 = '-'
  134. var year = date.getFullYear()
  135. var month = date.getMonth() + 1
  136. var strDate = date.getDate()
  137. if (month >= 1 && month <= 9) {
  138. month = '0' + month
  139. }
  140. if (strDate >= 0 && strDate <= 9) {
  141. strDate = '0' + strDate
  142. }
  143. var currentdate = year + seperator1 + month + seperator1 + strDate
  144. return currentdate
  145. }
  146. },
  147. methods: {}
  148. }
  149. </script>
  150. <style scoped lang="scss">
  151. .detail-container {
  152. width: 100%;
  153. height: 100%;
  154. }
  155. .print-page {
  156. margin-bottom: 50px;
  157. // min-height: 1020px;
  158. page-break-after: always;
  159. }
  160. .print-title {
  161. text-align: center;
  162. .title1 {
  163. font-size: 24px;
  164. margin-bottom: 18px;
  165. }
  166. .title2 {
  167. font-size: 18px;
  168. margin-bottom: 24px;
  169. display: flex;
  170. justify-content: space-between;
  171. align-items: center;
  172. div {
  173. width: 33.333%;
  174. }
  175. }
  176. }
  177. .print-form-1 {
  178. .item {
  179. display: flex;
  180. padding-right: 10px;
  181. .label {
  182. height: 40px;
  183. display: flex;
  184. align-items: center;
  185. box-sizing: border-box;
  186. font-size: 14px;
  187. color: #333333;
  188. flex-shrink: 0;
  189. }
  190. .value {
  191. flex: 1;
  192. height: 40px;
  193. display: flex;
  194. align-items: center;
  195. box-sizing: border-box;
  196. font-size: 14px;
  197. color: #333333;
  198. input {
  199. border: none;
  200. padding: 0;
  201. }
  202. }
  203. }
  204. }
  205. .print-table-1 {
  206. font-size: 14px;
  207. margin-top: 10px;
  208. margin-bottom: 10px;
  209. .el-row {
  210. margin-left: 0 !important;
  211. margin-right: 0 !important;
  212. border: 1px solid #ebeef5;
  213. border-right: none;
  214. }
  215. .el-col {
  216. padding-top: 14px;
  217. padding-bottom: 14px;
  218. border-right: 1px solid #ebeef5;
  219. }
  220. .head {
  221. color: #909399;
  222. font-weight: bold;
  223. .el-col {
  224. padding: 0;
  225. display: flex;
  226. height: 40px;
  227. align-items: center;
  228. }
  229. }
  230. .body {
  231. color: #333333;
  232. .el-row {
  233. border-top: none;
  234. }
  235. .el-col {
  236. padding: 0;
  237. display: flex;
  238. height: 40px;
  239. align-items: center;
  240. word-break: break-all;
  241. }
  242. }
  243. .foot {
  244. color: #333333;
  245. margin-top: 10px;
  246. // border-right: 1px solid #EBEEF5;
  247. .el-col {
  248. padding: 0;
  249. display: flex;
  250. height: 40px;
  251. align-items: center;
  252. word-break: break-all;
  253. }
  254. }
  255. }
  256. .print-form-2 {
  257. .item {
  258. display: flex;
  259. padding-right: 10px;
  260. .label {
  261. height: 40px;
  262. display: flex;
  263. align-items: center;
  264. box-sizing: border-box;
  265. font-size: 14px;
  266. color: #333333;
  267. flex-shrink: 0;
  268. }
  269. .value {
  270. flex: 1;
  271. height: 40px;
  272. display: flex;
  273. align-items: center;
  274. box-sizing: border-box;
  275. font-size: 14px;
  276. color: #333333;
  277. ::v-deep .el-input input {
  278. height: 30px;
  279. border: none;
  280. border-bottom: 1px solid #ebeef5;
  281. padding: 0 10px;
  282. }
  283. }
  284. }
  285. }
  286. </style>