|
@@ -14,18 +14,18 @@
|
|
|
<tr>
|
|
<tr>
|
|
|
<td><span>生产批次号</span></td>
|
|
<td><span>生产批次号</span></td>
|
|
|
<td><input name="Gd_gdbh" type="text" v-model="workData.Gd_gdbh" @input="propertyChange" class="required" style="width: 380px;height: 30px;"></td>
|
|
<td><input name="Gd_gdbh" type="text" v-model="workData.Gd_gdbh" @input="propertyChange" class="required" style="width: 380px;height: 30px;"></td>
|
|
|
- </tr>
|
|
|
|
|
-
|
|
|
|
|
- <tr>
|
|
|
|
|
- <td><span>印件名称</span></td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <select @change="selectpYj" v-model="workData.yjdh" style="width: 380px;height: 30px;">
|
|
|
|
|
- <option v-for="option in selectedYj" :value="option.yj_Yjdh">
|
|
|
|
|
- {{ option.yj_Yjno }} - {{ option.yj_yjmc }}
|
|
|
|
|
- </option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
|
|
+ </tr>
|
|
|
|
|
+
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td><span>印件名称</span></td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <select @change="selectpYj" v-model="workData.yjdh" style="width: 380px;height: 30px;">
|
|
|
|
|
+ <option v-for="option in selectedYj" :value="option.yj_Yjdh">
|
|
|
|
|
+ {{ option.yj_Yjno }} - {{ option.yj_yjmc }}
|
|
|
|
|
+ </option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
|
|
|
<tr v-if="dan">
|
|
<tr v-if="dan">
|
|
|
<td><span>纸张名称</span></td>
|
|
<td><span>纸张名称</span></td>
|
|
@@ -157,8 +157,8 @@
|
|
|
liucheng_num:1,
|
|
liucheng_num:1,
|
|
|
remark:'',
|
|
remark:'',
|
|
|
x_offset:0,
|
|
x_offset:0,
|
|
|
- y_offset:0,
|
|
|
|
|
- yjdh: '',
|
|
|
|
|
|
|
+ y_offset:0,
|
|
|
|
|
+ yjdh: '',
|
|
|
yjmc: '',
|
|
yjmc: '',
|
|
|
})
|
|
})
|
|
|
const department = ref()
|
|
const department = ref()
|
|
@@ -4049,21 +4049,21 @@ const propertyChange = () => {
|
|
|
//1.1获取工单基本数据
|
|
//1.1获取工单基本数据
|
|
|
const getDocumentDatas = await getDocumentData({order:workData.value.Gd_gdbh})
|
|
const getDocumentDatas = await getDocumentData({order:workData.value.Gd_gdbh})
|
|
|
console.log(getDocumentDatas)
|
|
console.log(getDocumentDatas)
|
|
|
- if (getDocumentDatas.code === 0) {
|
|
|
|
|
- if(!getDocumentDatas.data){
|
|
|
|
|
- shuang.value=false
|
|
|
|
|
- selectedYj.value=[]
|
|
|
|
|
- selectedPaper.value=[]
|
|
|
|
|
- selectedPeijian.value=[]
|
|
|
|
|
- gyData.value=[]
|
|
|
|
|
- workData.value.tldx=3000
|
|
|
|
|
- workData.value.start_liucheng=1
|
|
|
|
|
- workData.value.liucheng_num=1
|
|
|
|
|
- workData.value.x_offset=0
|
|
|
|
|
- workData.value.y_offset=0
|
|
|
|
|
- department.value=null
|
|
|
|
|
- department.value=null
|
|
|
|
|
- return false;
|
|
|
|
|
|
|
+ if (getDocumentDatas.code === 0) {
|
|
|
|
|
+ if(!getDocumentDatas.data){
|
|
|
|
|
+ shuang.value=false
|
|
|
|
|
+ selectedYj.value=[]
|
|
|
|
|
+ selectedPaper.value=[]
|
|
|
|
|
+ selectedPeijian.value=[]
|
|
|
|
|
+ gyData.value=[]
|
|
|
|
|
+ workData.value.tldx=3000
|
|
|
|
|
+ workData.value.start_liucheng=1
|
|
|
|
|
+ workData.value.liucheng_num=1
|
|
|
|
|
+ workData.value.x_offset=0
|
|
|
|
|
+ workData.value.y_offset=0
|
|
|
|
|
+ department.value=null
|
|
|
|
|
+ department.value=null
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
workData.value.version=getDocumentDatas.data.paper[0].产品版本号;
|
|
workData.value.version=getDocumentDatas.data.paper[0].产品版本号;
|
|
|
workData.value.peijian=getDocumentDatas.data.paper;
|
|
workData.value.peijian=getDocumentDatas.data.paper;
|
|
@@ -4079,11 +4079,11 @@ const propertyChange = () => {
|
|
|
shuang.value=false
|
|
shuang.value=false
|
|
|
selectedPaper.value=getDocumentDatas.data.paper
|
|
selectedPaper.value=getDocumentDatas.data.paper
|
|
|
workData.value.product=getDocumentDatas.data.paper[0].bom_物料名称;
|
|
workData.value.product=getDocumentDatas.data.paper[0].bom_物料名称;
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- selectedYj.value=getDocumentDatas.data.yjData
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ selectedYj.value=getDocumentDatas.data.yjData
|
|
|
|
|
|
|
|
- workData.value.num=getDocumentDatas.data.paper[0].bom_计划用量;
|
|
|
|
|
|
|
+ workData.value.num=getDocumentDatas.data.paper[0].bom_计划用量;
|
|
|
|
|
|
|
|
if(getDocumentDatas.data.peijian!=undefined){
|
|
if(getDocumentDatas.data.peijian!=undefined){
|
|
|
peijian.value=getDocumentDatas.data.peijian[0]['id']
|
|
peijian.value=getDocumentDatas.data.peijian[0]['id']
|
|
@@ -4092,24 +4092,24 @@ const propertyChange = () => {
|
|
|
}
|
|
}
|
|
|
getDocument()
|
|
getDocument()
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
-const selectpYj = (event) => {
|
|
|
|
|
- workData.value.yjmc = selectedYj.value.find(option => option.yj_Yjdh === workData.value.yjdh).yj_yjmc;
|
|
|
|
|
-
|
|
|
|
|
- getHistory({order:workData.value.Gd_gdbh, yjdh:workData.value.yjdh}).then(getHistorys =>{
|
|
|
|
|
- if (getHistorys.code == 0) {
|
|
|
|
|
- update.value = getHistorys.data.update
|
|
|
|
|
- department.value=getHistorys.data.department
|
|
|
|
|
- if(getHistorys.data.data){
|
|
|
|
|
- gyData.value = getHistorys.data.data.map((item)=>({
|
|
|
|
|
- gy:item
|
|
|
|
|
- }))
|
|
|
|
|
- }else{
|
|
|
|
|
- gyData.value = []
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
|
|
+}
|
|
|
|
|
+const selectpYj = (event) => {
|
|
|
|
|
+ workData.value.yjmc = selectedYj.value.find(option => option.yj_Yjdh === workData.value.yjdh).yj_yjmc;
|
|
|
|
|
+
|
|
|
|
|
+ getHistory({order:workData.value.Gd_gdbh, yjdh:workData.value.yjdh}).then(getHistorys =>{
|
|
|
|
|
+ if (getHistorys.code == 0) {
|
|
|
|
|
+ update.value = getHistorys.data.update
|
|
|
|
|
+ department.value=getHistorys.data.department
|
|
|
|
|
+ if(getHistorys.data.data){
|
|
|
|
|
+ gyData.value = getHistorys.data.data.map((item)=>({
|
|
|
|
|
+ gy:item
|
|
|
|
|
+ }))
|
|
|
|
|
+ }else{
|
|
|
|
|
+ gyData.value = []
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
//点击增加工艺按钮
|
|
//点击增加工艺按钮
|
|
|
const addInput = () => {
|
|
const addInput = () => {
|
|
@@ -4118,10 +4118,10 @@ const selectpYj = (event) => {
|
|
|
const sendClick = () => {
|
|
const sendClick = () => {
|
|
|
saveDocument()
|
|
saveDocument()
|
|
|
}
|
|
}
|
|
|
- const saveDocument = async() => {
|
|
|
|
|
- if(workData.value.yjmc=== ''){
|
|
|
|
|
- ElMessage({type: 'warning',message: '请选择印件名称'})
|
|
|
|
|
- return false;
|
|
|
|
|
|
|
+ const saveDocument = async() => {
|
|
|
|
|
+ if(workData.value.yjmc=== ''){
|
|
|
|
|
+ ElMessage({type: 'warning',message: '请选择印件名称'})
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
datas.value=[]
|
|
datas.value=[]
|
|
|
gyData.value.map((item)=>{
|
|
gyData.value.map((item)=>{
|
|
@@ -4138,7 +4138,6 @@ const selectpYj = (event) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
const getDocument = async() => {
|
|
const getDocument = async() => {
|
|
|
- console.log(321321)
|
|
|
|
|
const getDocumentInfos = await getDocumentInfo({
|
|
const getDocumentInfos = await getDocumentInfo({
|
|
|
order:workData.value.Gd_gdbh,
|
|
order:workData.value.Gd_gdbh,
|
|
|
mabao:workData.value.mabao,
|
|
mabao:workData.value.mabao,
|
|
@@ -4147,8 +4146,8 @@ const selectpYj = (event) => {
|
|
|
tldx:workData.value.tldx,
|
|
tldx:workData.value.tldx,
|
|
|
remark:workData.value.remark,
|
|
remark:workData.value.remark,
|
|
|
string:data.value,
|
|
string:data.value,
|
|
|
- num:workData.value.num,
|
|
|
|
|
- yjmc:workData.value.yjmc,
|
|
|
|
|
|
|
+ num:workData.value.num,
|
|
|
|
|
+ yjmc:workData.value.yjmc,
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
if (getDocumentInfos.code === 0) {
|
|
if (getDocumentInfos.code === 0) {
|
|
@@ -4438,7 +4437,7 @@ const selectpYj = (event) => {
|
|
|
"title": "销售订单号",
|
|
"title": "销售订单号",
|
|
|
"coordinateSync": false,
|
|
"coordinateSync": false,
|
|
|
"widthHeightSync": false,
|
|
"widthHeightSync": false,
|
|
|
- "fontSize": 12,
|
|
|
|
|
|
|
+ "fontSize": 24,
|
|
|
"textAlign": "center",
|
|
"textAlign": "center",
|
|
|
"textContentVerticalAlign": "middle",
|
|
"textContentVerticalAlign": "middle",
|
|
|
"lineHeight": 15,
|
|
"lineHeight": 15,
|
|
@@ -5384,31 +5383,37 @@ const selectpYj = (event) => {
|
|
|
// hiprint.init()
|
|
// hiprint.init()
|
|
|
const hiprintTemplate = new hiprint.PrintTemplate({ template: jsondata1 })
|
|
const hiprintTemplate = new hiprint.PrintTemplate({ template: jsondata1 })
|
|
|
|
|
|
|
|
|
|
+ console.log("打印前",workData.value.start_liucheng)//这个是1
|
|
|
|
|
+ console.log("打印前",workData.value.liucheng_total)//这个是2 就是打印两次
|
|
|
for (let i = workData.value.start_liucheng; i <= workData.value.liucheng_total; i++) {
|
|
for (let i = workData.value.start_liucheng; i <= workData.value.liucheng_total; i++) {
|
|
|
- ((i) => {
|
|
|
|
|
- const printdata = {
|
|
|
|
|
- "scpch": getDocumentInfos.data[0].Gd_gdbh,
|
|
|
|
|
- "xsddh": getDocumentInfos.data[0].销售订单号,
|
|
|
|
|
- "mbh": getDocumentInfos.data[0].mabao,
|
|
|
|
|
- "lcdh": `${workData.value.liucheng_total}-${i}`,
|
|
|
|
|
- "qrcode": `${getDocumentInfos.data[0].Gd_gdbh}-${workData.value.liucheng_total}-${i}`,
|
|
|
|
|
- "gdsm": getDocumentInfos.data[0].version,
|
|
|
|
|
- "cpmc": getDocumentInfos.data[0].Gd_cpmc,
|
|
|
|
|
- "ztzs": workData.value.num,
|
|
|
|
|
- 'table': getDocumentInfos.data.gy_data.map(item => ({
|
|
|
|
|
- gxmc: item
|
|
|
|
|
- }))
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ (function(currentIndex) {
|
|
|
|
|
+ // 创建一个基于当前索引的延迟
|
|
|
|
|
+ const delay = (currentIndex - 1) * 3600; // 毫秒
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ const printdata = {
|
|
|
|
|
+ "scpch": getDocumentInfos.data[0].Gd_gdbh,
|
|
|
|
|
+ "xsddh": getDocumentInfos.data[0].销售订单号,
|
|
|
|
|
+ "mbh": getDocumentInfos.data[0].mabao,
|
|
|
|
|
+ "lcdh": `${workData.value.liucheng_total}-${i}`,
|
|
|
|
|
+ "qrcode": `${getDocumentInfos.data[0].Gd_gdbh}-${workData.value.liucheng_total}-${currentIndex}`,
|
|
|
|
|
+ "gdsm": getDocumentInfos.data[0].version,
|
|
|
|
|
+ "cpmc": getDocumentInfos.data[0].Gd_cpmc,
|
|
|
|
|
+ "ztzs": workData.value.num,
|
|
|
|
|
+ 'table': getDocumentInfos.data.gy_data.map(item => ({
|
|
|
|
|
+ gxmc: item // 注意这里可能有问题,因为item没有被正确使用,你可能需要item的某个属性
|
|
|
|
|
+ }))
|
|
|
|
|
+ };
|
|
|
hiprintTemplate.print2(printdata);
|
|
hiprintTemplate.print2(printdata);
|
|
|
- // hiprintTemplate.toPdf(printdata,'流程单');
|
|
|
|
|
- })(i);
|
|
|
|
|
|
|
+ // hiprintTemplate.toPdf(printdata,'流程单'); // 如果需要,可以取消注释这行代码
|
|
|
|
|
+ }, delay);
|
|
|
|
|
+ })(i); // 立即执行函数,传入当前的i值作为currentIndex
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
const selectpPaper = (event) => {
|
|
const selectpPaper = (event) => {
|
|
|
workData.value.num=event.target.value
|
|
workData.value.num=event.target.value
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
const selectPeijian = async(event) => {
|
|
const selectPeijian = async(event) => {
|