print-shaoguan.vue 8.8 KB

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