|
|
@@ -0,0 +1,379 @@
|
|
|
+<template>
|
|
|
+ <div class="bg">
|
|
|
+ <el-dialog
|
|
|
+ width="26cm"
|
|
|
+ height="12cm"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ title="领料单"
|
|
|
+ :visible.sync="scanVisible"
|
|
|
+ >
|
|
|
+ <!-- 表单是否显示 -->
|
|
|
+ <div style="height: 500px; width: 95%; margin: 0 auto">
|
|
|
+ <div ref="qrcode" id="box">
|
|
|
+ <vue-easy-print tableShow ref="easyPrint" :onePageRow="onePageRow">
|
|
|
+ <div
|
|
|
+ v-for="(item1, index1) in list"
|
|
|
+ :key="index1"
|
|
|
+ style="margin-bottom: 30px"
|
|
|
+ >
|
|
|
+ <div style="page-break-after: always">
|
|
|
+ <div class="word-title">
|
|
|
+ <h4>领料单</h4>
|
|
|
+ </div>
|
|
|
+ <div class="tagBox">
|
|
|
+ <div>
|
|
|
+ <div style="font-size: 10px">
|
|
|
+ 领料部门:<span style="margin-left: 10px">{{
|
|
|
+ item1.ling_liao_bu_men_|bumenfilters(bumenList)
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div
|
|
|
+ style="margin-left: 20px;margin-right: 5px;font-size: 10px;">
|
|
|
+ 领料单编号:<span style="margin-left: 10px">{{
|
|
|
+ item1.ling_liao_dan_bia
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ <div style="margin-left: 20px;margin-right: 5px;font-size: 10px;">
|
|
|
+ 领 料 日 期:<span style="margin-left: 10px">{{
|
|
|
+ item1.ling_liao_ri_qi_
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <table :border="1">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th style="width: 40px; line-height: 22px">序号</th>
|
|
|
+ <th style="font-weight: normal">物料编码</th>
|
|
|
+ <th style="font-weight: normal">物料名称</th>
|
|
|
+ <!-- <th>货号</th> -->
|
|
|
+ <th>批号</th>
|
|
|
+ <th>规格/特征</th>
|
|
|
+ <th>数量</th>
|
|
|
+ <th>单位</th>
|
|
|
+ <th>单价</th>
|
|
|
+ <th>金额</th>
|
|
|
+ <th>用途</th>
|
|
|
+ <th>备注</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <tr v-for="(item, index) in item1" :key="index">
|
|
|
+ <td style="width: 30px">{{ index + 1 }}</td>
|
|
|
+ <td style="width: 90px">
|
|
|
+ {{ item.wu_liao_bian_hao_ }}
|
|
|
+ </td>
|
|
|
+ <td style="width: 120px">
|
|
|
+ {{ item.wu_liao_ming_chen }}
|
|
|
+ </td>
|
|
|
+ <!-- <td style="width: 60px">{{ item.huo_hao_ }}</td> -->
|
|
|
+ <td style="width: 60px">{{ item.pi_hao_ }}</td>
|
|
|
+ <td style="width: 120px">
|
|
|
+ {{ item.gui_ge_xing_hao_ }}
|
|
|
+ </td>
|
|
|
+ <td style="width: 60px">{{ item.shu_liang_ }}</td>
|
|
|
+ <td style="width: 60px">{{ item.dan_wei_ }}</td>
|
|
|
+ <td style="width: 60px">{{ item.dan_jia_ }}</td>
|
|
|
+ <td style="width: 60px">{{ item.jin_e_ }}</td>
|
|
|
+ <td style="width: 80px">{{ item.yong_tu_ }}</td>
|
|
|
+ <td style="width: 120px">{{ item.bei_zhu_ }}</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ <tfoot :align="right"
|
|
|
+ valign="bottom"
|
|
|
+ style="text-align: right !important; height: 30px"
|
|
|
+ >
|
|
|
+ <tr>
|
|
|
+ <td colspan="13" style="text-align: right !important">
|
|
|
+ 合计:{{ item1.heji }}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tfoot>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <div class="bottom">
|
|
|
+ <div style="float: left">
|
|
|
+ 领用人/日期:
|
|
|
+ {{ item1.name1 }}/{{ item1.ling_liao_ri_qi_ }}
|
|
|
+ </div>
|
|
|
+ <div style="margin: 0 auto" v-show="false">
|
|
|
+ 审核人/日期 :
|
|
|
+ {{ item1.name2 }} /{{item1.time2}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 发放人/日期 :
|
|
|
+ {{ item1.name3 }}/{{ item1.time3 }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </vue-easy-print>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <!-- <el-button @click="dialogVisible = false">取 消</el-button> -->
|
|
|
+ <el-button type="primary" @click="printDemo">打印</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import VueBarcode from "vue-barcode";
|
|
|
+import vueEasyPrint from "vue-easy-print";
|
|
|
+import repostCurd from "@/business/platform/form/utils/custom/joinCURD.js";
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ VueBarcode,
|
|
|
+ vueEasyPrint,
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ obj: {
|
|
|
+ default: [],
|
|
|
+ type: Array,
|
|
|
+ },
|
|
|
+ onePageRow: {
|
|
|
+ type: Number,
|
|
|
+ default: 3,
|
|
|
+ },
|
|
|
+ blankLines: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ },
|
|
|
+ scanVisible: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ currentScan: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ onePageRow: 1,
|
|
|
+ value: "",
|
|
|
+ id: "",
|
|
|
+ list: [],
|
|
|
+ visible: true,
|
|
|
+ bumenList:[]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getInit();
|
|
|
+ this.bumenListRequest();
|
|
|
+ },
|
|
|
+ filters: {
|
|
|
+ name4: function (value) {
|
|
|
+ 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}' LIMIT 1) AND NODE_ID_ = 'Activity_0dbdxg7' ORDER BY CREATE_TIME_ DESC LIMIT 1)`;
|
|
|
+ repostCurd("sql", s3).then((res) => {
|
|
|
+ return res.variables.data[0].NAME_;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ bumenfilters: function (value, list) {
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ if (value == list[i].ID_) {
|
|
|
+ return list[i].NAME_;
|
|
|
+ } else if (i == list.length - 1) {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ obj() {
|
|
|
+ this.getInit();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ printDemo() {
|
|
|
+ this.$refs.easyPrint.print();
|
|
|
+ // this.$refs.easyPrint.window.print()
|
|
|
+ },
|
|
|
+ bumenListRequest(){ //部门列表
|
|
|
+ let sql = "select ID_,NAME_ FROM ibps_party_org ";
|
|
|
+ let this_ = this;
|
|
|
+ repostCurd("sql", sql).then((res) => {
|
|
|
+ return (this_.bumenList = res.variables.data);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getInit() {
|
|
|
+ var idStr = "";
|
|
|
+ this.obj.forEach((item) => {
|
|
|
+ idStr += item + ",";
|
|
|
+ });
|
|
|
+ idStr = idStr.substring(0, idStr.length - 1);
|
|
|
+ this.getLook(idStr);
|
|
|
+ },
|
|
|
+ addNumber(num1, num2) {
|
|
|
+ let a = parseFloat(num1);
|
|
|
+ let b = parseFloat(num2);
|
|
|
+ return a.toFixed("2") * 1 + b.toFixed("2") * 1;
|
|
|
+ },
|
|
|
+ riqi(value) {
|
|
|
+ let date = new Date(value);
|
|
|
+ let y = date.getFullYear(); //获取年份
|
|
|
+ let m = date.getMonth() + 1; //获取月份
|
|
|
+ m = m < 10 ? "0" + m : m; //月份不满10天显示前加0
|
|
|
+ let d = date.getDate(); //获取日期
|
|
|
+ d = d < 10 ? "0" + d : d; //日期不满10天显示前加0
|
|
|
+ return y + "-" + m + "-" + d;
|
|
|
+ },
|
|
|
+ toDecimal2(x) {
|
|
|
+ var f = parseFloat(x);
|
|
|
+ if (isNaN(f)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var f = Math.round(x * 100) / 100;
|
|
|
+ var s = f.toString();
|
|
|
+ var rs = s.indexOf(".");
|
|
|
+ if (rs < 0) {
|
|
|
+ rs = s.length;
|
|
|
+ s += ".";
|
|
|
+ }
|
|
|
+ while (s.length <= rs + 2) {
|
|
|
+ s += "0";
|
|
|
+ }
|
|
|
+ return s;
|
|
|
+ },
|
|
|
+ getLook(id) {
|
|
|
+ let this_ = this;
|
|
|
+ this.list = [];
|
|
|
+ let sql = `select * FROM t_bzwzlld WHERE FIND_IN_SET(id_,'${id}')`;
|
|
|
+ let zhubiao = [];
|
|
|
+ let name1, name2, name3;
|
|
|
+ let time1, time2, time3;
|
|
|
+ repostCurd("sql", sql).then((res) => {
|
|
|
+ zhubiao = res.variables.data;
|
|
|
+ zhubiao.forEach((item) => {
|
|
|
+ let sql1 = `select * FROM t_bzwzlldmx WHERE FIND_IN_SET(parent_id_,'${item.id_}')`;
|
|
|
+ let chushi = 0;
|
|
|
+ repostCurd("sql", sql1).then((res) => {
|
|
|
+ let data = res.variables.data;
|
|
|
+ if (!name1) {
|
|
|
+ let s1 = `select NAME_ FROM ibps_party_employee where id_ =( SELECT bian_zhi_ren_ FROM t_bzwzlld WHERE id_ = '${item.id_}')`; //领料人
|
|
|
+ repostCurd("sql", s1).then((res) => {
|
|
|
+ name1 = res.variables.data[0].NAME_;
|
|
|
+ data["name1"] = name1;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ 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_}' LIMIT 1) AND b.NODE_ID_ = 'Activity_0ttun9m' ORDER BY b.CREATE_TIME_ DESC LIMIT 1`;
|
|
|
+ repostCurd("sql", s2).then((res) => {
|
|
|
+ name2 = res.variables.data[0].NAME_;
|
|
|
+ time2 = res.variables.data[0].CREATE_TIME_;
|
|
|
+ data["name2"] = name2;
|
|
|
+ data["time2"] = time2;
|
|
|
+ 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_}' LIMIT 1) AND b.NODE_ID_ = 'Activity_1ydalp9' ORDER BY b.CREATE_TIME_ DESC LIMIT 1`;
|
|
|
+ repostCurd("sql", s3).then((res) => {
|
|
|
+ name3 = res.variables.data[0].NAME_;
|
|
|
+ time3 = res.variables.data[0].CREATE_TIME_;
|
|
|
+ data["name3"] = name3;
|
|
|
+ data["time3"] = time3;
|
|
|
+ data["ling_liao_chu_ku_"] = item.ling_liao_chu_ku_;
|
|
|
+ data["id_"] = item.id_;
|
|
|
+ data["ling_liao_bu_men_"] = item.ling_liao_bu_men_;
|
|
|
+ data["ling_liao_dan_bia"] = item.ling_liao_dan_bia;
|
|
|
+ data["ling_liao_ri_qi_"] = item.ling_liao_ri_qi_;
|
|
|
+ data["gong_ying_shang_"] = item.gong_ying_shang_ || 0;
|
|
|
+ data.forEach((it) => {
|
|
|
+ data["heji"] = this.addNumber(chushi, it.jin_e_);
|
|
|
+ chushi = data["heji"];
|
|
|
+ });
|
|
|
+
|
|
|
+ data["heji"] = this_.toDecimal2(data["heji"]);
|
|
|
+ this_.list.push(data);
|
|
|
+ chushi = 0;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.bottom {
|
|
|
+ margin-top: 15px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 12px;
|
|
|
+}
|
|
|
+.word-title {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+thead {
|
|
|
+ background: #f3f3f3;
|
|
|
+}
|
|
|
+.el-dialog__body {
|
|
|
+ color: #0d0e0f;
|
|
|
+ font-size: 10px !important;
|
|
|
+ word-break: none;
|
|
|
+}
|
|
|
+thead > tr > th {
|
|
|
+ font-size: 10px;
|
|
|
+ text-align: center;
|
|
|
+ font-weight: normal;
|
|
|
+ color: #01060c;
|
|
|
+}
|
|
|
+thead > tr > th > td {
|
|
|
+ font-size: 10px;
|
|
|
+ text-align: center;
|
|
|
+ font-weight: normal;
|
|
|
+ color: #01060c;
|
|
|
+}
|
|
|
+.logo {
|
|
|
+ position: absolute;
|
|
|
+ top: -32px;
|
|
|
+ left: 0;
|
|
|
+}
|
|
|
+.tagBox {
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ // border: 1px solid #000000;
|
|
|
+ padding: 5px;
|
|
|
+ display: flex;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.la {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.lh {
|
|
|
+ // line-height: auto;
|
|
|
+ font-size: 12px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+* {
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+}
|
|
|
+table {
|
|
|
+ border-collapse: collapse;
|
|
|
+ text-align: center;
|
|
|
+ border: 1px solid #01060c;
|
|
|
+}
|
|
|
+
|
|
|
+td {
|
|
|
+ width: 120px;
|
|
|
+ // height: 50px;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 10px;
|
|
|
+}
|
|
|
+.friday {
|
|
|
+ width: 100px;
|
|
|
+ height: 50px;
|
|
|
+}
|
|
|
+</style>
|