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