|
|
@@ -14,7 +14,19 @@
|
|
|
<tr>
|
|
|
<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>
|
|
|
- </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">
|
|
|
<td><span>纸张名称</span></td>
|
|
|
<td>
|
|
|
@@ -145,7 +157,9 @@
|
|
|
liucheng_num:1,
|
|
|
remark:'',
|
|
|
x_offset:0,
|
|
|
- y_offset:0
|
|
|
+ y_offset:0,
|
|
|
+ yjdh: '',
|
|
|
+ yjmc: '',
|
|
|
})
|
|
|
const department = ref()
|
|
|
const dan = ref(true)
|
|
|
@@ -154,6 +168,7 @@
|
|
|
const data = ref()
|
|
|
const peijian = ref(0)
|
|
|
const gyData = ref([])
|
|
|
+ const selectedYj = ref([])
|
|
|
const selectedPaper = ref([])
|
|
|
const selectedPeijian = ref([])
|
|
|
const datas = ref([])
|
|
|
@@ -488,7 +503,7 @@
|
|
|
"coordinateSync": false,
|
|
|
"widthHeightSync": false,
|
|
|
"fontSize": 12,
|
|
|
- "textAlign": "center",
|
|
|
+ "textAlign": "left",
|
|
|
"textContentVerticalAlign": "middle",
|
|
|
"lineHeight": 15,
|
|
|
"qrCodeLevel": 0,
|
|
|
@@ -4014,48 +4029,48 @@
|
|
|
hiprint.init()
|
|
|
const hiprintTemplate = new hiprint.PrintTemplate({ template: jsondata1 })
|
|
|
|
|
|
- const propertyChange = () => {
|
|
|
- if(workData.value.Gd_gdbh.length<7){
|
|
|
- console.log("没到七位")
|
|
|
- shuang.value=false
|
|
|
- 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;
|
|
|
- }else{
|
|
|
- console.log("到了七位")
|
|
|
- console.log(workData.value.Gd_gdbh)
|
|
|
+const propertyChange = () => {
|
|
|
+ if(workData.value.Gd_gdbh.length<7){
|
|
|
+ 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;
|
|
|
+ }else{
|
|
|
const getDocument = async() => {
|
|
|
//1.1获取工单基本数据
|
|
|
const getDocumentDatas = await getDocumentData({order:workData.value.Gd_gdbh})
|
|
|
console.log(getDocumentDatas)
|
|
|
- //1.2获取历史工艺信息
|
|
|
- const getHistorys = await getHistory({order:workData.value.Gd_gdbh,peijian:''})
|
|
|
- console.log(getHistorys)
|
|
|
- update.value = getHistorys.data.update
|
|
|
- if(getHistorys.data.data){
|
|
|
- gyData.value = getHistorys.data.data.map((item)=>({
|
|
|
- gy:item
|
|
|
- }))
|
|
|
- }
|
|
|
-
|
|
|
- console.log(getHistorys.data)
|
|
|
-
|
|
|
- if (getDocumentDatas.code === 0) {
|
|
|
+ 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.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
|
|
|
|
|
|
@@ -4064,28 +4079,38 @@
|
|
|
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.length){
|
|
|
+ }
|
|
|
+
|
|
|
+ selectedYj.value=getDocumentDatas.data.yjData
|
|
|
+
|
|
|
+ workData.value.num=getDocumentDatas.data.paper[0].bom_计划用量;
|
|
|
+
|
|
|
+ if(getDocumentDatas.data.peijian!=undefined){
|
|
|
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 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
|
|
|
+ console.log(getHistorys.data.data)
|
|
|
+ if(getHistorys.data.data){
|
|
|
+ console.log(111)
|
|
|
+ console.log(getHistorys.data.data)
|
|
|
+ gyData.value = getHistorys.data.data.map((item)=>({
|
|
|
+ gy:item
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
//点击增加工艺按钮
|
|
|
const addInput = () => {
|
|
|
@@ -4094,7 +4119,11 @@
|
|
|
const sendClick = () => {
|
|
|
saveDocument()
|
|
|
}
|
|
|
- const saveDocument = async() => {
|
|
|
+ const saveDocument = async() => {
|
|
|
+ if(workData.value.yjmc=== ''){
|
|
|
+ ElMessage({type: 'warning',message: '请选择印件名称'})
|
|
|
+ return false;
|
|
|
+ }
|
|
|
datas.value=[]
|
|
|
gyData.value.map((item)=>{
|
|
|
if(item.gy==''){
|
|
|
@@ -4104,7 +4133,7 @@
|
|
|
})
|
|
|
// datas.value = gyData.value.map((item)=>(item.gy))
|
|
|
data.value= datas.value.join(",")
|
|
|
- const saveDocumentDatas = await saveDocumentData({order:workData.value.Gd_gdbh,data:`${data.value},`,peijian:peijian.value})
|
|
|
+ const saveDocumentDatas = await saveDocumentData({order:workData.value.Gd_gdbh,data:`${data.value},`,yjdh:workData.value.yjdh})
|
|
|
if (saveDocumentDatas.code === 0) {
|
|
|
getDocument()
|
|
|
}
|
|
|
@@ -4119,23 +4148,11 @@
|
|
|
tldx:workData.value.tldx,
|
|
|
remark:workData.value.remark,
|
|
|
string:data.value,
|
|
|
- num:workData.value.num
|
|
|
+ num:workData.value.num,
|
|
|
+ yjmc:workData.value.yjmc,
|
|
|
+
|
|
|
})
|
|
|
if (getDocumentInfos.code === 0) {
|
|
|
- // const printdata = {
|
|
|
- // "scpch": "123456",
|
|
|
- // "xsddh": "123456",
|
|
|
- // "mbh": "123456",
|
|
|
- // "lcdh": "123456",
|
|
|
- // "gdsm": "123456",
|
|
|
- // "cpmc": "111",
|
|
|
- // "ztzs": "222",
|
|
|
- // "gjh": "333",
|
|
|
- // 'table': getDocumentInfos.data.gy_data.map(item=>({
|
|
|
- // gxmc:item
|
|
|
- // }))
|
|
|
- // }
|
|
|
- // hiprintTemplate.print(printdata);
|
|
|
|
|
|
console.log(workData)
|
|
|
const data = getDocumentInfos.data
|
|
|
@@ -4151,69 +4168,29 @@
|
|
|
((i) => {
|
|
|
const printdata = {
|
|
|
"scpch": getDocumentInfos.data[0].Gd_gdbh,
|
|
|
- "xsddh": getDocumentInfos.data[0].销售订单号.split(' ')[1],
|
|
|
+ "xsddh": getDocumentInfos.data[0].销售订单号,
|
|
|
+ // "sm1": getDocumentInfos.data[0].version,
|
|
|
"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].technique_sequence,
|
|
|
+ "gdsm": getDocumentInfos.data[0].version,
|
|
|
"cpmc": getDocumentInfos.data[0].Gd_cpmc,
|
|
|
"ztzs": workData.value.num,
|
|
|
'table': getDocumentInfos.data.gy_data.map(item => ({
|
|
|
gxmc: item
|
|
|
}))
|
|
|
};
|
|
|
-
|
|
|
hiprintTemplate.print2(printdata);
|
|
|
// hiprintTemplate.toPdf(printdata,'流程单');
|
|
|
})(i);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // for (let i = workData.value.start_liucheng; i <= workData.value.liucheng_total; i++) {
|
|
|
- // const printdata = {
|
|
|
- // "scpch": getDocumentInfos.data[0].Gd_gdbh,
|
|
|
- // "xsddh": getDocumentInfos.data[0].销售订单号.split(' ')[1],
|
|
|
- // "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].technique_sequence,
|
|
|
- // "cpmc": getDocumentInfos.data[0].Gd_cpmc,
|
|
|
- // "ztzs": workData.value.num,
|
|
|
- // // "gjh": getDocumentInfos.data[0].version,
|
|
|
- // 'table': getDocumentInfos.data.gy_data.map(item=>({
|
|
|
- // gxmc:item
|
|
|
- // }))
|
|
|
- // }
|
|
|
- //
|
|
|
- // // hiprintTemplate.print(printdata);
|
|
|
- // hiprintTemplate.print2(printdata);
|
|
|
- // // hiprintTemplate.toPdf(printdata,'流程单');
|
|
|
- // }
|
|
|
-
|
|
|
- // const printdata = {
|
|
|
- // "scpch": "123456",
|
|
|
- // "xsddh": "123456",
|
|
|
- // "mbh": "123456",
|
|
|
- // "lcdh": "123456",
|
|
|
- // "gdsm": "123456",
|
|
|
- // "cpmc": "111",
|
|
|
- // "ztzs": "222",
|
|
|
- // "gjh": "333",
|
|
|
- // 'table': getDocumentInfos.data.gy_data.map(item=>({
|
|
|
- // gxmc:item
|
|
|
- // }))
|
|
|
- // }
|
|
|
- // hiprintTemplate.print(printdata);
|
|
|
-
|
|
|
- // hiprintTemplate.print(printdata);
|
|
|
- // console.log(getDocumentInfos.data)
|
|
|
}
|
|
|
}
|
|
|
const selectpPaper = (event) => {
|
|
|
workData.value.num=event.target.value
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
const selectPeijian = async(event) => {
|
|
|
peijian.value=event.target.value
|