Browse Source

流程单打印修改

liuhairui 1 year ago
parent
commit
ca75215e50
1 changed files with 62 additions and 53 deletions
  1. 62 53
      src/view/job/processSheet/processSheet.vue

+ 62 - 53
src/view/job/processSheet/processSheet.vue

@@ -158,7 +158,20 @@
 	const datas = ref([])
 	const propertyChange = () => {
 		if(workData.value.Gd_gdbh.length!==7){
-			workData.value = []
+			workData.value = {
+        maobao:'',
+        mabao:'',
+        peijian:'',
+        tldx:3000,
+        num:'',
+        liucheng_total:'',
+        version:'',
+        start_liucheng:1,
+        liucheng_num:1,
+        remark:'',
+        x_offset:0,
+        y_offset:0
+      }
 			shuang.value=false
 			selectedPaper.value=[]
 			selectedPeijian.value=[]
@@ -171,48 +184,47 @@
 			department.value=null
 			department.value=null
 			return false;
-		}
-		const getDocument = async() => {
-		  const getDocumentDatas = await getDocumentData({order:workData.value.Gd_gdbh})
-		  if (getDocumentDatas.code === 0) {
-			  workData.value.version=getDocumentDatas.data.paper[0].产品版本号;
-			  workData.value.peijian=getDocumentDatas.data.paper;
-			  console.log(selectedPaper.value)
-			  if(getDocumentDatas.data.num>1){
-				  dan.value=false
-				  shuang.value=true
-				  console.log(getDocumentDatas.data.paper.length)
-				  selectedPaper.value=getDocumentDatas.data.paper
-				  selectedPeijian.value=getDocumentDatas.data.peijian
-
-			  }else{
-				  dan.value=true
-				  shuang.value=false
-				  selectedPaper.value=getDocumentDatas.data.paper
-				  workData.value.product=getDocumentDatas.data.paper[0].bom_物料名称;
-			  }
-			  workData.value.num=getDocumentDatas.data.paper[0].bom_计划用量;
-			  if(getDocumentDatas.data.peijian){
-          peijian.value=getDocumentDatas.data.peijian[0]['id']
-				  const getHistory = async() => {
-				    const getDocumentHistorys = await getDocumentHistory({
-						order:workData.value.Gd_gdbh,
-						peijian:getDocumentDatas.data.peijian[0]['id']})
-				    if (getDocumentHistorys.code === 0) {
-							department.value=getDocumentHistorys.data.department
-							update.value=getDocumentHistorys.data.update
-							gyData.value=getDocumentHistorys.data.data.map((item)=>({
-								gy:item
-							}))
-				    }
-				  }
-				  getHistory()
-			  }
-
-		  }
-		}
-		getDocument()
+		}else{
+      const getDocument = async() => {
+        const getDocumentDatas = await getDocumentData({order:workData.value.Gd_gdbh})
+        if (getDocumentDatas.code === 0) {
+          workData.value.version=getDocumentDatas.data.paper[0].产品版本号;
+          workData.value.peijian=getDocumentDatas.data.paper;
+          console.log(selectedPaper.value)
+          if(getDocumentDatas.data.num>1){
+            dan.value=false
+            shuang.value=true
+            console.log(getDocumentDatas.data.paper.length)
+            selectedPaper.value=getDocumentDatas.data.paper
+            selectedPeijian.value=getDocumentDatas.data.peijian
 
+          }else{
+            dan.value=true
+            shuang.value=false
+            selectedPaper.value=getDocumentDatas.data.paper
+            workData.value.product=getDocumentDatas.data.paper[0].bom_物料名称;
+          }
+          workData.value.num=getDocumentDatas.data.paper[0].bom_计划用量;
+          if(getDocumentDatas.data.peijian){
+            peijian.value=getDocumentDatas.data.peijian[0]['id']
+            const getHistory = async() => {
+              const getDocumentHistorys = await getDocumentHistory({
+                order:workData.value.Gd_gdbh,
+                peijian:getDocumentDatas.data.peijian[0]['id']})
+              if (getDocumentHistorys.code === 0) {
+                department.value=getDocumentHistorys.data.department
+                update.value=getDocumentHistorys.data.update
+                gyData.value=getDocumentHistorys.data.data.map((item)=>({
+                  gy:item
+                }))
+              }
+            }
+            getHistory()
+          }
+        }
+      }
+      getDocument()
+    }
 	}
 	const addInput = () => {
 	 gyData.value.push({gy:''})
@@ -247,13 +259,13 @@
       for (let i = 0; i < Object.keys(data).length - 4; i++) {
         const printdata  = {
           "scpch": getDocumentInfos.data[i].Gd_gdbh,
-          "xsddh": "123456",
-          "mbh": "123456",
-          "lcdh": "123456",
-          "gdsm": "123456",
-          "cpmc":  "111",
-          "ztzs":  "222",
-          "gjh":  "333",
+          "xsddh": getDocumentInfos.data[i].销售订单号.split(' ')[1],
+          "mbh": getDocumentInfos.data[i].mabao,
+          "lcdh": getDocumentInfos.data[i].liucheng_num,
+          "gdsm": workData.value.remark,
+          "cpmc":  getDocumentInfos.data[i].Gd_cpmc,
+          "ztzs":  workData.value.num,
+          "gjh":  getDocumentInfos.data[i].version,
           'table': getDocumentInfos.data.gy_data.map(item=>({
             gxmc:item
           }))
@@ -407,7 +419,7 @@
               "top": 61,
               "height": 36,
               "width": 100,
-              "title": "生产批次号",
+              "title": "",
               "coordinateSync": false,
               "widthHeightSync": false,
               "fontSize": 12,
@@ -726,10 +738,7 @@
               "title": "产品名称",
               "coordinateSync": false,
               "widthHeightSync": false,
-              "fontSize": 12,
-              "textAlign": "center",
               "textContentVerticalAlign": "middle",
-              "lineHeight": 15,
               "borderLeft": "solid",
               "borderTop": "solid",
               "borderRight": "solid",