print-foshan.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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>销售发货单</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. }
  150. </script>
  151. <style scoped lang="scss">
  152. .detail-container {
  153. width: 100%;
  154. height: 100%;
  155. }
  156. .print-page {
  157. margin-bottom: 50px;
  158. // min-height: 1020px;
  159. page-break-after: always;
  160. }
  161. .print-title {
  162. text-align: center;
  163. .title1 {
  164. font-size: 24px;
  165. margin-bottom: 18px;
  166. }
  167. .title2 {
  168. font-size: 18px;
  169. margin-bottom: 24px;
  170. display: flex;
  171. justify-content: space-between;
  172. align-items: center;
  173. div {
  174. width: 33.333%;
  175. }
  176. }
  177. }
  178. .print-form-1 {
  179. .item {
  180. display: flex;
  181. padding-right: 10px;
  182. .label {
  183. height: 40px;
  184. display: flex;
  185. align-items: center;
  186. box-sizing: border-box;
  187. font-size: 14px;
  188. color: #333333;
  189. flex-shrink: 0;
  190. }
  191. .value {
  192. flex: 1;
  193. height: 40px;
  194. display: flex;
  195. align-items: center;
  196. box-sizing: border-box;
  197. font-size: 14px;
  198. color: #333333;
  199. input {
  200. border: none;
  201. padding: 0;
  202. }
  203. }
  204. }
  205. }
  206. .print-table-1 {
  207. font-size: 14px;
  208. margin-top: 10px;
  209. margin-bottom: 10px;
  210. .el-row {
  211. margin-left: 0 !important;
  212. margin-right: 0 !important;
  213. border: 1px solid #EBEEF5;
  214. border-right: none;
  215. }
  216. .el-col {
  217. padding-top: 14px;
  218. padding-bottom: 14px;
  219. border-right: 1px solid #EBEEF5;
  220. }
  221. .head {
  222. color: #909399;
  223. font-weight: bold;
  224. .el-col {
  225. padding: 0;
  226. display: flex;
  227. height: 40px;
  228. align-items: center;
  229. }
  230. }
  231. .body {
  232. color: #333333;
  233. .el-row {
  234. border-top: none;
  235. }
  236. .el-col {
  237. padding: 0;
  238. display: flex;
  239. height: 40px;
  240. align-items: center;
  241. word-break: break-all;
  242. }
  243. }
  244. .foot {
  245. color: #333333;
  246. margin-top: 10px;
  247. // border-right: 1px solid #EBEEF5;
  248. .el-col {
  249. padding: 0;
  250. display: flex;
  251. height: 40px;
  252. align-items: center;
  253. word-break: break-all;
  254. }
  255. }
  256. }
  257. .print-form-2 {
  258. .item {
  259. display: flex;
  260. padding-right: 10px;
  261. .label {
  262. height: 40px;
  263. display: flex;
  264. align-items: center;
  265. box-sizing: border-box;
  266. font-size: 14px;
  267. color: #333333;
  268. flex-shrink: 0;
  269. }
  270. .value {
  271. flex: 1;
  272. height: 40px;
  273. display: flex;
  274. align-items: center;
  275. box-sizing: border-box;
  276. font-size: 14px;
  277. color: #333333;
  278. ::v-deep .el-input input {
  279. height: 30px;
  280. border: none;
  281. border-bottom: 1px solid #EBEEF5;
  282. padding: 0 10px;
  283. }
  284. }
  285. }
  286. }
  287. </style>