lingliaodan.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <template>
  2. <div class="bg">
  3. <el-dialog
  4. width="26cm"
  5. height="12cm"
  6. :modal-append-to-body="false"
  7. title="领料单"
  8. :visible.sync="scanVisible"
  9. >
  10. <!-- 表单是否显示 -->
  11. <div style="height: 500px; width: 95%; margin: 0 auto" >
  12. <div ref="qrcode" id="box">
  13. <vue-easy-print tableShow ref="easyPrint" :onePageRow="onePageRow">
  14. <div
  15. v-for="(item1, index1) in list"
  16. :key="index1"
  17. style="margin-bottom: 30px"
  18. >
  19. <div style="page-break-after: always">
  20. <div class="word-title">
  21. <h4>领料单</h4>
  22. </div>
  23. <div class="tagBox">
  24. <div>
  25. <div style="font-size: 10px">
  26. 领料部门:<span style="margin-left: 10px">{{
  27. item1[0].bu_men_ming_cheng
  28. }}</span>
  29. </div>
  30. </div>
  31. <div>
  32. <div
  33. style="
  34. margin-left: 20px;
  35. margin-right: 5px;
  36. font-size: 10px;
  37. "
  38. >
  39. 领料单编号:<span style="margin-left: 10px">{{
  40. item1.ling_liao_chu_ku_
  41. }}</span>
  42. </div>
  43. <div
  44. style="
  45. margin-left: 20px;
  46. margin-right: 5px;
  47. font-size: 10px;
  48. "
  49. >
  50. 领料日期:<span style="margin-left: 10px">{{
  51. item1.ling_liao_ri_qi_
  52. }}</span>
  53. </div>
  54. </div>
  55. </div>
  56. <div>
  57. <table border="1">
  58. <thead>
  59. <tr>
  60. <th style="width: 40px">序号</th>
  61. <th style="font-weight: normal">物料编码</th>
  62. <th style="font-weight: normal">物料名称</th>
  63. <th>货号</th>
  64. <th>批号</th>
  65. <th>规格/特征量值</th>
  66. <th>数量</th>
  67. <th>单位</th>
  68. <th>单价</th>
  69. <th>金额</th>
  70. <th>用途</th>
  71. <th>备注</th>
  72. </tr>
  73. </thead>
  74. <tbody>
  75. <tr v-for="(item, index) in item1" :key="index">
  76. <td style="width: 30px">{{ index + 1 }}</td>
  77. <td style="width: 90px">
  78. {{ item.wu_liao_bian_hao_ }}
  79. </td>
  80. <td style="width: 120px">
  81. {{ item.wu_liao_ming_chen }}
  82. </td>
  83. <td style="width: 60px">{{ item.huo_hao_ }}</td>
  84. <td style="width: 60px">{{ item.pi_hao_ }}</td>
  85. <td style="width: 120px">
  86. {{ item.gui_ge_xing_hao_ }}
  87. </td>
  88. <td style="width: 60px">{{ item.shu_liang_ }}</td>
  89. <td style="width: 60px">{{ item.dan_wei_ }}</td>
  90. <td style="width: 60px">{{ item.dan_jia_ }}</td>
  91. <td style="width: 60px">{{ item.jin_e_ }}</td>
  92. <td style="width: 80px">{{ item.yong_tu_ }}</td>
  93. <td style="width: 120px">{{ item.beizhu }}</td>
  94. </tr>
  95. </tbody>
  96. <tfoot
  97. align="right"
  98. valign="bottom"
  99. style="text-align: right !important; height: 30px"
  100. >
  101. <tr>
  102. <td colspan="13" style="text-align: right !important">
  103. 合计:{{ item1.heji }}
  104. </td>
  105. </tr>
  106. </tfoot>
  107. </table>
  108. </div>
  109. <div class="bottom">
  110. <div></div>
  111. <div style="float:left">
  112. 领用人/日期:{{ item1.name1 }}/{{ item1.ling_liao_ri_qi_ }}
  113. </div>
  114. <div style="margin: 0 auto;">
  115. 审核人(部门负责人)/日期 :{{ item1.name2 }} /{{
  116. item1.time2
  117. }}
  118. </div>
  119. <div>
  120. 发放人(仓库员)/日期 :{{ item1.name3 }}/{{ item1.time3 }}
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </vue-easy-print>
  126. </div>
  127. </div>
  128. <span slot="footer" class="dialog-footer">
  129. <!-- <el-button @click="dialogVisible = false">取 消</el-button> -->
  130. <el-button type="primary" @click="printDemo">打印</el-button>
  131. </span>
  132. </el-dialog>
  133. </div>
  134. </template>
  135. <script>
  136. import VueBarcode from "vue-barcode";
  137. import vueEasyPrint from "vue-easy-print";
  138. import repostCurd from "@/business/platform/form/utils/custom/joinCURD.js";
  139. import { Loading } from 'element-ui';
  140. import { toFixed } from "@/views/platform/form/formPrint/utils";
  141. export default {
  142. components: {
  143. VueBarcode,
  144. vueEasyPrint,
  145. },
  146. props: {
  147. obj: {
  148. default: [],
  149. type: Array,
  150. },
  151. onePageRow: {
  152. type: Number,
  153. default: 3,
  154. },
  155. blankLines: {
  156. type: Boolean,
  157. default: true,
  158. },
  159. scanVisible: {
  160. type: Boolean,
  161. default: false,
  162. },
  163. currentScan: {
  164. type: Boolean,
  165. default: false,
  166. },
  167. },
  168. data() {
  169. return {
  170. onePageRow: 1,
  171. value: "",
  172. id: "",
  173. list: [],
  174. visible: true,
  175. };
  176. },
  177. created() {
  178. this.getInit();
  179. },
  180. filters: {
  181. name4: function (value) {
  182. let s3 = `select NAME_,CREATE_TIME_ FROM ibps_party_employee where id_ =( select CREATE_BY_ FROM ibps_bpm_oper_log WHERE PROC_INST_ID_ = ( SELECT PROC_INST_ID_ FROM ibps_bpm_bus_rel WHERE BUSINESSKEY_ = '${value}' ) AND NODE_ID_ = 'Activity_0dbdxg7' ORDER BY CREATE_TIME_ DESC LIMIT 1)`;
  183. repostCurd("sql", s3).then((res) => {
  184. return res.variables.data[0].NAME_;
  185. });
  186. },
  187. },
  188. methods: {
  189. printDemo() {
  190. this.$refs.easyPrint.print();
  191. // this.$refs.easyPrint.window.print()
  192. },
  193. getInit() {
  194. var idStr = "";
  195. this.obj.forEach((item) => {
  196. idStr += item + ",";
  197. });
  198. idStr = idStr.substring(0, idStr.length - 1);
  199. this.getLook(idStr);
  200. },
  201. addNumber(num1, num2) {
  202. let a = parseFloat(num1);
  203. let b = parseFloat(num2);
  204. return a.toFixed("2") * 1 + b.toFixed("2") * 1;
  205. },
  206. riqi(value) {
  207. let date = new Date(value);
  208. let y = date.getFullYear(); //获取年份
  209. let m = date.getMonth() + 1; //获取月份
  210. m = m < 10 ? "0" + m : m; //月份不满10天显示前加0
  211. let d = date.getDate(); //获取日期
  212. d = d < 10 ? "0" + d : d; //日期不满10天显示前加0
  213. return y + "-" + m + "-" + d;
  214. },
  215. getLook(id) {
  216. let this_ = this;
  217. let sql = `select * FROM t_crkjlb WHERE FIND_IN_SET(id_,'${id}')`;
  218. let zhubiao = [];
  219. let name1, name2, name3;
  220. let time1, time2, time3;
  221. repostCurd("sql", sql).then((res) => {
  222. zhubiao = res.variables.data;
  223. zhubiao.forEach((item) => {
  224. let sql1 = `select * FROM t_crkjlx WHERE FIND_IN_SET(parent_id_,'${item.id_}')`;
  225. let chushi = 0;
  226. repostCurd("sql", sql1).then((res) => {
  227. let data = res.variables.data;
  228. if (!name1) {
  229. let s1 = `select NAME_ FROM ibps_party_employee where id_ =( SELECT cao_zuo_ren_ FROM t_crkjlb WHERE id_ = '${item.id_}')`;
  230. repostCurd("sql", s1).then((res) => {
  231. name1 = res.variables.data[0].NAME_;
  232. data["name1"] = name1;
  233. });
  234. }
  235. let s2 = `select a.NAME_,DATE_FORMAT(b.CREATE_TIME_,'%Y年%m月%d日') AS CREATE_TIME_ FROM ibps_party_employee as a join ibps_bpm_oper_log as b on a.ID_ = b.CREATE_BY_ where b.PROC_INST_ID_ = ( SELECT PROC_INST_ID_ FROM ibps_bpm_bus_rel WHERE BUSINESSKEY_ = '${item.id_}') AND b.NODE_ID_ = 'Activity_0t9dfi3' ORDER BY b.CREATE_TIME_ DESC LIMIT 1`
  236. repostCurd("sql", s2).then((res) => {
  237. name2 = res.variables.data[0].NAME_;
  238. time2 = res.variables.data[0].CREATE_TIME_;
  239. data["name2"] = name2;
  240. data["time2"] = time2;
  241. let s3 = `select a.NAME_,DATE_FORMAT(b.CREATE_TIME_,'%Y年%m月%d日') AS CREATE_TIME_ FROM ibps_party_employee as a join ibps_bpm_oper_log as b on a.ID_ = b.CREATE_BY_ where b.PROC_INST_ID_ = ( SELECT PROC_INST_ID_ FROM ibps_bpm_bus_rel WHERE BUSINESSKEY_ = '${item.id_}') AND b.NODE_ID_ = 'Activity_0dbdxg7' ORDER BY b.CREATE_TIME_ DESC LIMIT 1`;
  242. repostCurd("sql", s3).then((res) => {
  243. name3 = res.variables.data[0].NAME_;
  244. time3 = res.variables.data[0].CREATE_TIME_;
  245. data["name3"] = name3;
  246. data["time3"] = time3;
  247. data["ling_liao_chu_ku_"] = item.ling_liao_chu_ku_;
  248. data["id_"] = item.id_;
  249. data["ling_liao_bu_men_"] = item.ling_liao_bu_men_;
  250. data["ling_liao_ri_qi_"] = item.ling_liao_ri_qi_;
  251. data["gong_ying_shang_"] = item.gong_ying_shang_ || 0;
  252. data.forEach((it) => {
  253. data["heji"] = this.addNumber(chushi, it.jin_e_);
  254. chushi = data["heji"];
  255. });
  256. this_.list.push(data);
  257. console.log(this_.list)
  258. });
  259. });
  260. });
  261. });
  262. });
  263. },
  264. },
  265. };
  266. </script>
  267. <style lang="scss" scoped>
  268. .bottom {
  269. margin-top: 15px;
  270. display: flex;
  271. justify-content: space-between;
  272. align-items: center;
  273. font-size: 12px;
  274. }
  275. .word-title {
  276. display: flex;
  277. justify-content: center;
  278. }
  279. thead {
  280. background: #f3f3f3;
  281. }
  282. .el-dialog__body {
  283. color: #0d0e0f;
  284. font-size: 10px !important;
  285. word-break: none;
  286. }
  287. thead > tr > th {
  288. font-size: 10px;
  289. text-align: center;
  290. font-weight: normal;
  291. color: #01060c;
  292. }
  293. thead > tr > th > td {
  294. font-size: 10px;
  295. text-align: center;
  296. font-weight: normal;
  297. color: #01060c;
  298. }
  299. .logo {
  300. position: absolute;
  301. top: -32px;
  302. left: 0;
  303. }
  304. .tagBox {
  305. position: relative;
  306. width: 100%;
  307. // border: 1px solid #000000;
  308. padding: 5px;
  309. display: flex;
  310. display: flex;
  311. justify-content: space-between;
  312. background-color: #fff;
  313. }
  314. .la {
  315. display: flex;
  316. align-items: center;
  317. }
  318. .lh {
  319. // line-height: auto;
  320. font-size: 12px;
  321. display: flex;
  322. align-items: center;
  323. }
  324. * {
  325. margin: 0;
  326. padding: 0;
  327. }
  328. table {
  329. border-collapse: collapse;
  330. text-align: center;
  331. border: 1px solid #01060c;
  332. }
  333. td {
  334. width: 120px;
  335. // height: 50px;
  336. text-align: center;
  337. font-size: 10px;
  338. }
  339. .friday {
  340. width: 100px;
  341. height: 50px;
  342. }
  343. </style>