print-guangzhou.vue 9.5 KB

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