print-common.vue 8.2 KB

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