廖井涛
2024-08-29 b4ecc2c68b386b53caf7f19b8366ec2332ef1e9f
Merge branch 'master' of http://bore.pub:10439/r/ERP_override
5个文件已修改
314 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue 230 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/ErpApplication.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/application.yml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue
@@ -5,33 +5,26 @@
import {ElMessage, ElMessageBox} from "element-plus";
import request from "@/utils/request"
import {useI18n} from "vue-i18n"
import {useRouter} from "vue-router";
import deepClone from "@/utils/deepClone";
import companyInfo from "@/stores/sd/companyInfo"
const { t } = useI18n()
const company = companyInfo()
let produceList = ref([])
let labelList = ref([])
let dataList = ref([])
let lastList = ref([])
let list = ref([])
// 纸张类型
const paperTypes = {
  'A3': {
    width: 420,
        height: 296.6
  '成品标签': {
    width: 110,
        height: 110
  },
  'A4': {
    width: 210,
        height: 296.6
  '小片标签': {
    width: 112,
        height: 45
  },
  'A5': {
    width: 210,
        height: 147.6
  },
  'B3': {
    width: 500,
        height: 352.6
  },
  'B4': {
    width: 250,
        height: 352.6
  },
  'B5': {
    width: 250,
        height: 175.6
  }
}
const autoPaper = ref({
  width:null,
@@ -48,15 +41,88 @@
})
//标签类型
let filteredOptions = []
const lableType = ref('1')
const lableTypeOptions = [
  {
    value: '1',
    label: t('processCard.finishedProductLabel'),
  },
  /*  {
      value: '2',
      label: t('processCard.halfProductLabel'),
    },*/
  {
    value: `${company.printLabel.labelValue}`,
    label: `${company.printLabel.labelType}`,
  },
  {
    value: `${company.printLabel.labelValue3}`,
    label: `${company.printLabel.labelType3}`,
  },
]
let hidePrintLabels = company.printLabel.hideButton;
if (hidePrintLabels == 'true') {
  filteredOptions = lableTypeOptions.filter((option, index) => index !== 2);
} else {
  filteredOptions = lableTypeOptions;
}
const data = ref({
  printList: []
})
let props = defineProps({
  list:null,//勾选的数据
  faceOrientation:null,//内外面
  type:null,//标签模板
  lableType:null//标签类型
})
const {currentRoute} = useRouter()
const route = currentRoute.value
let type = props.type
let lableTypes = props.lableType
data.value.printList = JSON.parse(props.list)
const TgaStyleSet = ref([
  {
    tid: '此面为室外面', title: '此面为室外面', data: '', type: 'text',
    options: {
      field: '',
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
  },
  {
    tid: '此面为室内面', title: '此面为室内面', data: '', type: 'text',
    options: {
      field: '',
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
  },
  {
    tid: 'orderId', title: '订单号', data: '', type: 'text',
    options: {
      field: 'orderId',
      testData: 'NG24070101',
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -68,7 +134,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -80,7 +145,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -92,7 +156,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -104,7 +167,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -116,7 +178,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -128,7 +189,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -140,7 +200,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -152,7 +211,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -164,19 +222,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
  },
  {
    tid: 'createTime', title: '下单日期', data: '', type: 'text',
    options: {
      field: 'createTime',
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -188,7 +233,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -200,7 +244,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -212,7 +255,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -224,7 +266,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -236,7 +277,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -248,7 +288,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -260,7 +299,17 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
  },
  {
    tid: 'remarks', title: '订单备注', data: '', type: 'text',
    options: {
      field: 'remarks',
      testData: '',
      height: 16,
      fontSize: 6.75,
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -272,7 +321,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -284,7 +332,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -296,7 +343,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -308,19 +354,17 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
  },
  {
    tid: 'filmNumber', title: '膜号', data: '', type: 'text',
    tid: 'filmNumber', title: '产品备注', data: '', type: 'text',
    options: {
      field: 'filmNumber',
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -332,7 +376,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -344,7 +387,6 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -356,7 +398,28 @@
      testData: '',
      height: 16,
      fontSize: 6.75,
      fontWeight: "700",
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
  },
  {
    tid: 'width', title: '宽', data: '', type: 'text',
    options: {
      field: 'width',
      testData: '',
      height: 16,
      fontSize: 6.75,
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
  },
  {
    tid: 'height', title: '高', data: '', type: 'text',
    options: {
      field: 'height',
      testData: '',
      height: 16,
      fontSize: 6.75,
      textAlign: "left",
      textContentVerticalAlign: "middle"
    }
@@ -452,7 +515,36 @@
}
const htmlPrint = () => {
  hiprintTemplate.value.print( [{orderId:'名称1'},{orderId:'名称12'}])
  type=tag.value.name
  if (type === null || type === '' || type === undefined) {
    ElMessage.warning(t('processCard.pleaseSelectCustomPrintLabelStyle'))
    return
  }
  request.post(`/processCard/getSelectPrintCustomLabel/${type}/${lableType.value}`, data.value).then((res) => {
    if (res.code == 200) {
      produceList.value = deepClone(res.data.title)
      list.value = deepClone(res.data.data)
      const data = produceList.value[0].value
      dataList = JSON.parse(`[${data}]`);
      labelList = dataList[0]
      console.log(labelList.printElements)
      for (let i = 0; i < list.value.length; i++) {
        let count = list.value[i].data.length
        for (let j = 0; j < count; j++) {
          for (let k = 0; k < list.value[i].data[j].quantity; k++) {
            lastList.value.push(list.value[i].data[j])
          }
        }
      }
    } else {
      ElMessage.warning(res.msg)
      router.push("/login")
    }
    hiprintTemplate.value.print(lastList.value)
  })
}
</script>
@@ -460,7 +552,7 @@
  <div style="height: 100%;width: 100%">
    <div style="height: 10%;width: 100%;float: left" @change="changePaperSize">
      <el-row>
        <el-col :span="8" >
        <el-col :span="5" >
          <el-button-group  >
            <el-button  v-for="(item,key) in paperTypes"  @click="changePaperSize(item,'list')"  >{{key}}</el-button>
            <el-popover placement="right" :width="250" trigger="click">
@@ -483,8 +575,8 @@
            </el-popover>
          </el-button-group>
        </el-col>
        <el-col :span="4">
            <el-select v-model="tag" @change="changeTag" placeholder="标签列表"  >
        <el-col :span="6">
            <el-select v-model="tag" @change="changeTag" placeholder="标签模板列表"  >
              <el-option
                  v-for="(tag,index) in tags"
                  :key="index"
@@ -492,6 +584,14 @@
                  :value="tag"
              />
            </el-select>
          <el-select v-model="lableType" :placeholder="lableTypeOptions[0].label" class="m-2" style="width: 140px">
            <el-option
                v-for="item in filteredOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
            />
          </el-select>
        </el-col>
        <el-col :span="1">
          <el-button type="primary" @click="save">保存</el-button>
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
@@ -19,9 +19,11 @@
import footSum from "@/hook/footSum"
import companyInfo from "@/stores/sd/companyInfo"
import {CircleCheck, Download, Printer} from "@element-plus/icons-vue/global";
import TagStyleDesigner from "@/components/pp/TagStyleDesigner.vue";
import useUserInfoStore from "@/stores/userInfo";
const company = companyInfo()
const userStore = useUserInfoStore()
const userId = userStore.user.userId
//语言获取
const {t} = useI18n()
@@ -33,7 +35,7 @@
const dialogTableVisibleCustomLabel = ref(false)
const printVisible = ref(false)
let selectRecords = ref(null)
let titleStyleVisible = ref(false)
const selectRecordsData = ref({
  printList: []
})
@@ -200,6 +202,10 @@
    titleSelectJson.value.dataType = res.data.type
    xGrid.value.reloadData(newDataCollection)
    gridOptions.loading = false
    if (userId!='admin'){
      gridOptions.toolbarConfig.buttons[5].visible=false
    }
    hideButton()
  } else {
    ElMessage.warning(res.msg)
@@ -332,6 +338,7 @@
      {code: 'printLabel', name: t('processCard.labelPrinting'), status: 'primary'},
      {code: 'printLabel2', name: t('processCard.labelPrinting2'), status: 'primary'},
      {code: 'sortTable', name: "排序汇总", status: 'primary'},
      // {code: 'printTest', name: "测试打印", status: 'primary'},
      // {code: 'printLike', name: "同配置打印", status: 'primary'},
    ],
    // import: false,
@@ -572,6 +579,32 @@
          dialogSortTable.value = true
          break
        }
        case 'printTest': {
          if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) {
            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
            return
          }
          // if (type === null || type === '' || type === undefined) {
          //   ElMessage.warning(t('processCard.pleaseSelectCustomPrintLabelStyle'))
          //   return
          // }
          let id = ""
          for (let i = 0; i < selectRecords.length; i++) {
            if (i + 1 === selectRecords.length) {
              id += selectRecords[i].id
            } else {
              id += selectRecords[i].id + "|"
            }
          }
            labelRow.value.list = JSON.stringify(selectRecords)
            labelRow.value.faceOrientation = faceOrientation
            labelRow.value.type = type
            labelRow.value.lableType = lableTypes
          titleStyleVisible.value = true
          break
        }
      }
    }
  },
@@ -786,7 +819,20 @@
      <select-sort-table id="child" :orderId="tableRow.orderId"/>
    </el-dialog>
    <el-dialog
        id="titleStyle"
        :title="$t('processCard.labelStyle')"
        style="width: 90%;height:93%;margin-top: 3vh "
        :close-on-click-modal="false"
        :close-on-press-escape="false"
        v-model="titleStyleVisible">
      <!--      <tag-style style="width: 100%;height: 100%"/>-->
      <tag-style-designer style="width: 100%;height: 100%"
                          :faceOrientation="labelRow.faceOrientation"
                          :lableType="labelRow.lableType"
                          :list="labelRow.list"
                          :type="labelRow.type"/>
    </el-dialog>
  </div>
</template>
@@ -820,4 +866,9 @@
  overflow-y: auto;
}
:deep(#titleStyle .el-dialog__body){
  height: 93%;
  width: 100%;
}
</style>
north-glass-erp/src/main/java/com/example/erp/ErpApplication.java
@@ -15,10 +15,10 @@
public class ErpApplication {
    public static void main(String[] args) {
        SpringApplication.run(ErpApplication.class, args);
        try {
        /*try {
            new NettyServer(12345).start();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        }*/
    }
}
north-glass-erp/src/main/resources/application.yml
@@ -3,6 +3,7 @@
  port: 8086
ip: localhost
port: 3306
spring:
@@ -12,27 +13,27 @@
      strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源.
      datasource:
        user_info:
          url: jdbc:mysql://${ip}:3306/erp_user_info?serverTimezone=GMT%2b8
          url: jdbc:mysql://${ip}:${port}/erp_user_info?serverTimezone=GMT%2b8
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
        sd:
          url: jdbc:mysql://${ip}:3306/sd?serverTimezone=GMT%2b8&allowMultiQueries=true
          url: jdbc:mysql://${ip}:${port}/sd?serverTimezone=GMT%2b8&allowMultiQueries=true
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
        mm:
          url: jdbc:mysql://${ip}:3306/mm?serverTimezone=GMT%2b8
          url: jdbc:mysql://${ip}:${port}/mm?serverTimezone=GMT%2b8
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
        pp:
          url: jdbc:mysql://${ip}:3306/pp?serverTimezone=GMT%2b8
          url: jdbc:mysql://${ip}:${port}/pp?serverTimezone=GMT%2b8
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
        log:
          url: jdbc:mysql://${ip}:3306/erp_log?serverTimezone=GMT%2b8
          url: jdbc:mysql://${ip}:${port}/erp_log?serverTimezone=GMT%2b8
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -195,15 +195,17 @@
               ogd.production_id,
               od.product_id,
               od.product_name,
               SUM(od.quantity)            as quantity,
               ROUND(SUM(od.quantity)-IFNULL(sum(fc.quantity)/count(fc.technology_number),0))            as quantity,
               SUM(od.compute_gross_area)  as compute_gross_area,
               round(sum(od.perimeter), 2) as perimeter
        from sd.order_detail as od
                 left join
             (select order_id, order_number, production_id, splitting_status
             (select order_id, order_number,technology_number, production_id, splitting_status
              from sd.order_glass_detail
              GROUP BY order_id, order_number) as ogd
             on od.order_id = ogd.order_id and od.order_number = ogd.order_number
                 left join flow_card as fc on fc.order_id = od.order_id and fc.order_number = od.order_number
            and fc.technology_number=ogd.technology_number
        where od.order_id = #{orderId}
          and ogd.splitting_status = 0
@@ -241,7 +243,7 @@
               od.quantity,
               od.compute_gross_area,
               p.total_thickness,
               od.quantity           as baiscQuantity,
               ROUND(od.quantity-IFNULL(sum(fc.quantity)/count(fc.technology_number),0))           as baiscQuantity,
               od.compute_gross_area as 'computeGrossArea',
               p.total_thickness     AS 'totalThickness',
               p.thickness,
@@ -266,6 +268,8 @@
                            FROM sd.order_detail
                            WHERE order_id = #{orderId}) as ods
                           on ods.order_id = od.order_id and ods.order_number = od.order_number
                 left join flow_card as fc on fc.order_id = od.order_id and fc.order_number = od.order_number
                           and fc.technology_number=ogd.technology_number
        where od.order_id = #{orderId}
          and ogd.production_id = #{productionId}
          and ogd.splitting_status = 0