<template>
|
<view>
|
<view class="tabs" id="tabs">
|
<view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">基本信息</view>
|
<view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">其他信息</view>
|
<view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">制单信息</view>
|
<view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">附件信息</view>
|
</view>
|
<!-- 基本信息 -->
|
<template v-if="tabs == 0">
|
<view class="form" :style="{
|
height: 'auto',
|
overflow: 'auto'
|
}">
|
<view class="form-item">
|
<view class="title">源单类型:</view>
|
<zxz-uni-data-select class="right" :localdata="[{value: '3772', key: '工序流转卡'}]" dataKey="key"
|
dataValue="value" v-model="hform.HMainSourceBillType">
|
</zxz-uni-data-select>
|
</view>
|
<view class="form-item">
|
<view class="title">源单单号:</view>
|
<view class="right">
|
<input type="text" v-model="hform.HMainSourceBillNo" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">流转卡号:</view>
|
<view class="right">
|
<input type="text" v-model="hform.HProcExchBillNo" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">生产订单号:</view>
|
<view class="right">
|
<input v-model="hform.HICMOBillNo" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">工序号:</view>
|
<view class="right">
|
<input v-model="hform.HProcNo" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">物料代码:</view>
|
<view class="right">
|
<input v-model="hform.HMaterNumber" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">物料名称:</view>
|
<view class="right">
|
<input v-model="hform.HMaterName" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">规格型号:</view>
|
<view class="right">
|
<input v-model="hform.HMaterModel" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">工序:</view>
|
<view class="right">
|
<input v-model="hform.HProcName" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">单据号:</view>
|
<view class="righton">
|
<input disabled v-model="hform.HBillNo" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">单据日期:</view>
|
<view class="righton">
|
<input disabled v-model="hform.HDate" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">点检人:</view>
|
<zxz-uni-data-select class="right" :localdata="HEmpList" dataKey="HName" dataValue="HItemID"
|
v-model="hform.HEmpID">
|
</zxz-uni-data-select>
|
</view>
|
<view class="form-item">
|
<view class="title">生产资源:</view>
|
<view class="right">
|
<input v-model="hform.HSourceName" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">生产班组:</view>
|
<zxz-uni-data-select class="right" :localdata="HGroupList" dataKey="班组名称" dataValue="HItemID"
|
v-model="hform.HGroupID">
|
</zxz-uni-data-select>
|
</view>
|
<view class="form-item">
|
<view class="title">生产车间:</view>
|
<zxz-uni-data-select class="right" :localdata="HDeptList" dataKey="部门名称" dataValue="HItemID"
|
v-model="hform.HDeptID">
|
</zxz-uni-data-select>
|
</view>
|
<view class="form-item">
|
<view class="title">设备:</view>
|
<view class="righton">
|
<input v-model="hform.HEquipName" disabled />
|
</view>
|
</view>
|
</view>
|
</template>
|
<!-- 其他信息 -->
|
<template v-if="tabs == 1">
|
<view class="form" :style="{
|
height: 'auto',
|
overflow: 'auto'
|
}">
|
<view class="form-item">
|
<view class="title">组织:</view>
|
<view class="righton">
|
<input disabled v-model="hform.HStockOrgName" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">备注:</view>
|
<view class="right">
|
<textarea cols="30" rows="10" v-model="hform.HRemark"></textarea>
|
</view>
|
</view>
|
</view>
|
</template>
|
<!-- 其他信息 -->
|
<template v-if="tabs == 2">
|
<view class="form" :style="{
|
height: containerHeight + 'px',
|
overflow: 'auto'
|
}">
|
<view class="form-item">
|
<view class="title">创建人:</view>
|
<view class="righton">
|
<input v-model="hform.HMaker" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">创建日期:</view>
|
<view class="righton">
|
<input v-model="hform.HMakeDate" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">修改人:</view>
|
<view class="righton">
|
<input v-model="hform.HUpDater" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">修改日期:</view>
|
<view class="righton">
|
<input v-model="hform.HUpDateDate" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">审核人:</view>
|
<view class="righton">
|
<input v-model="hform.HChecker" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">审核时间:</view>
|
<view class="righton">
|
<input v-model="hform.HCheckDate" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">作废人:</view>
|
<view class="righton">
|
<input v-model="hform.HDeleteMan" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">作废日期:</view>
|
<view class="righton">
|
<input v-model="hform.HDeleteDate" />
|
</view>
|
</view>
|
</view>
|
|
</template>
|
<!-- 附件信息 -->
|
<template v-if="tabs == 3">
|
<view class="card-item-wrapper">
|
<view class="attachment-btns">
|
<button type="primary" size="mini" @tap="fileUpload">选择文件</button>
|
<view style="flex: 1;"></view>
|
</view>
|
<view v-for="(item, index) in attachmentInfo" :key="index">
|
<uni-card :title="item['fileName']" :thumbnail="item.filePath">
|
<view class="card-detail">
|
<view class="detail">
|
<text>大小:</text>{{item["size"]}}
|
</view>
|
<view class="detail">
|
<text>状态:</text>{{item["status"]}}
|
</view>
|
<view class="detail operation" v-if="item['status']!='上传成功'">
|
<text>操作:</text>
|
<button class="btn-a" size="mini" @tap.stop="uploadFile(index)">上传</button>
|
<button class="btn-b" size="mini" @tap.stop="delFile(index)">删除</button>
|
</view>
|
</view>
|
</uni-card>
|
</view>
|
</view>
|
</template>
|
|
<view class="tabs">
|
<view class="on">工艺参数</view>
|
</view>
|
<template>
|
<view class="form" :style="{
|
height: 400 + 'px',
|
overflow: 'auto'
|
}">
|
|
<view class="list" v-for="(item,index) in HTechParams" :key="index">
|
<uni-card style="margin: 10px;" @tap="modifyCheckValue(index, item)">
|
<view class="card-detail">
|
<view class="detail">
|
<text>序号:</text>{{index+1}}
|
</view>
|
|
<view class="detail">
|
<text>工艺参数大类:</text>{{item.HTechParamClassName}}
|
</view>
|
<view class="detail">
|
<text>工艺参数代码:</text>{{item.HTechParamNumber}}
|
</view>
|
<view class="detail">
|
<text>工艺参数名称:</text>{{item.HTechParamName}}
|
</view>
|
<view class="detail">
|
<text>工艺参数单位代码:</text>{{item.HTechParamUnitNumber}}
|
</view>
|
<view class="detail">
|
<text>工艺参数单位名称:</text>{{item.HTechParamUnitName}}
|
</view>
|
<view class="detail">
|
<text>工艺次序:</text>{{item.HSNO}}
|
</view>
|
<view class="detail">
|
<text>工艺参数值:</text>{{item.HVaule}}
|
</view>
|
<view class="detail">
|
<text>标准值:</text>{{item.HStd}}
|
</view>
|
<view class="detail">
|
<text>上限:</text>{{item.HMax}}
|
</view>
|
<view class="detail">
|
<text>下限:</text>{{item.HMin}}
|
</view>
|
<view class="detail">
|
<text>检测结果:</text>
|
<checkbox-group style="display: inline-block;"
|
@change="checkBoxResultChangeHandler(index, $event)">
|
<checkbox value="enabled" :checked="item.HResult == 'OK'" />
|
</checkbox-group>
|
</view>
|
<view class="detail">
|
<text>是否必录:</text>
|
<checkbox-group style="display: inline-block;"
|
@change="checkBoxChangeHandler(index, $event)">
|
<checkbox value="enabled" :checked="item.HIsRequired" />
|
</checkbox-group>
|
</view>
|
<view class="detail">
|
<text>备注:</text>{{item.HRemark}}
|
</view>
|
</view>
|
</uni-card>
|
</view>
|
<view class="over" v-if="HCheckFileList.length == 0">暂无数据</view>
|
</view>
|
</template>
|
<!-- 操作按钮 -->
|
<view class="buttons" id="buttons">
|
<button class="btn-a" size="mini" @tap="submit">提交</button>
|
<view style="flex: 1;"></view>
|
<button class="btn-a" size="mini" @tap="addNew">新增</button>
|
<button class="btn-c" size="mini" @tap="goBack">退出</button>
|
</view>
|
<xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload>
|
<BillSelectorPopupVue @update="billSelectHandler" ref="billSelector" :Type="'DJ'"></BillSelectorPopupVue>
|
|
<!-- 用于输入标准值 上限值 下限值的弹出层 -->
|
<uni-popup ref="inputPopup" :mask-click="false" >
|
<view class="inputPopup">
|
<view class="form-item">
|
<view class="title">标准值:</view>
|
<view class="right">
|
<input type="number" v-model="selectTechParamItem.item.HStd" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">上限值:</view>
|
<view class="right">
|
<input type="number" v-model="selectTechParamItem.item.HMax" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">下限值:</view>
|
<view class="right">
|
<input type="number" v-model="selectTechParamItem.item.HMin" />
|
</view>
|
</view>
|
<view style="display: flex; flex-direction: row;">
|
<button size="mini" plain="true" type="primary" @click="inputPopupClose(1)">确认</button>
|
<button size="mini" plain="true" type="warn" @click="inputPopupClose(0)">取消</button>
|
</view>
|
</view>
|
</uni-popup>
|
</view>
|
</template>
|
|
<script>
|
import dayjs from "dayjs";
|
import {
|
CommonUtils
|
} from "@/utils/common";
|
import {
|
MpaasScan
|
} from "@/utils/mpaasScan.js"
|
import {
|
getUserInfo
|
} from "../../../utils/auth";
|
import BillSelectorPopupVue from "../../../components/MJGL/BillSelectorPopup.vue";
|
export default {
|
name: 'sb_EquipDotCheckBill',
|
components: {
|
BillSelectorPopupVue
|
},
|
data() {
|
return {
|
tabs: 0,
|
HMainSourceBillType: "",
|
btnTop: 0,
|
tabsBottom: 0,
|
HModName: "SB_EquipICMOTechParamBillEdit",
|
HBillType: '3919',
|
operationType: 1,
|
uploadOptions: {},
|
|
selectTechParamItem: {
|
index: -1,
|
item: {
|
HStd: 0,
|
HMax: 0,
|
HMin: 0
|
}
|
},
|
|
HTechParams: [], // 工艺参数
|
|
HDeptList: [],
|
HShiftsList: [],
|
HCheckFileList: [],
|
HEmpList: [], // 职员列表
|
HGroupList: [], // 生产班组列表
|
attachmentInfo: [],
|
|
hform: {
|
"HBillNo": "",
|
"HInterID": 0,
|
"HDate": dayjs(new Date()).format("YYYY-MM-DD"),
|
"HStockOrgID": uni.getStorageSync("OrganizationID"),
|
"HStockOrgName": uni.getStorageSync("Organization"),
|
"HMainSourceBillType": "3772",
|
"HMainSourceInterID": 0,
|
"HMainSourceEntryID": 0,
|
"HMainSourceBillNo": "",
|
"HProcExchBillNo": "",
|
"HProcExchInterID": 0,
|
"HProcExchEntryID": 0,
|
"HICMOBillNo": "",
|
"HICMOInterID": 0,
|
"HICMOEntryID": 0,
|
"HProcNo": "",
|
"HMaterNumber": "",
|
"HMaterID": 0,
|
"HMaterName": "",
|
"HMaterModel": "",
|
"HProcName": "",
|
"HProcID": 0,
|
"HEmpName": "",
|
"HEmpID": getUserInfo()["HEmpID"],
|
"HSourceName": "",
|
"HSourceID": 0,
|
"HGroupName": "",
|
"HGroupID": getUserInfo()["HGroupID"],
|
"HDeptName": "",
|
"HDeptID": getUserInfo()["HDeptID"],
|
"HEquipName": "",
|
"HEquipID": 0,
|
"HRemark": "",
|
"HMaker": getUserInfo()["Czymc"],
|
"HChecker": "",
|
"HCloseMan": "",
|
"HMakeDate": dayjs(new Date()).format("YYYY-MM-DD"),
|
"HCheckDate": "",
|
"HCloseDate": "",
|
"HUpDater": "",
|
"HDeleteMan": "",
|
"HUpDateDate": "",
|
"HDeleteDate": ""
|
}
|
};
|
},
|
computed: {
|
containerHeight: {
|
get() {
|
return this.btnTop - this.tabsBottom - 5
|
}
|
},
|
calcHLastResult: {
|
get() {
|
if (this.HCheckFileList.length == 0) {
|
return 'OK'
|
} else {
|
let okCount = this.HCheckFileList.reduce((acc, item) => {
|
if (item.HDotCheckResult) {
|
return acc + 1
|
}
|
return acc
|
}, 0)
|
if (okCount == this.HCheckFileList.length) {
|
return 'OK'
|
}
|
return 'NG'
|
}
|
}
|
}
|
|
},
|
methods: {
|
modifyCheckValue(index, item) {
|
console.log('item: ', item, 'index: ', index);
|
this.selectTechParamItem = {
|
index,
|
item: JSON.parse(JSON.stringify(item))
|
}
|
|
this.$refs.inputPopup.open()
|
},
|
billSelectHandler(billData) {
|
console.log('billData: ', billData);
|
let data = billData.retVal[this.hform.HEquipID]
|
this.get_DocCheckItem2(data.hmainid)
|
},
|
|
toCheckFile() {
|
if (this.hform.HEquipID == 0) {
|
return CommonUtils.showTips({
|
message: '不能选择点检规程,请先扫描设备条码!!!'
|
})
|
}
|
this.$refs['billSelector'].showPopup(this.hform.HEquipID)
|
},
|
addNew() {
|
uni.redirectTo({
|
url: './Sb_EquipDotCheckBill?operationType=1'
|
})
|
},
|
goBack() {
|
uni.navigateBack()
|
},
|
checkBoxChangeHandler(index, e) {
|
let cr = e.detail.value
|
if (cr.length == 0) {
|
this.HTechParams[index]["HIsRequired"] = false
|
} else {
|
this.HTechParams[index]["HIsRequired"] = true
|
}
|
},
|
checkBoxResultChangeHandler(index, e) {
|
let cr = e.detail.value
|
if (cr.length == 0) {
|
this.HTechParams[index]["HResult"] = 'NG'
|
} else {
|
this.HTechParams[index]["HResult"] = 'OK'
|
}
|
},
|
uploadFile(index) {
|
console.log('filePath: ', this.attachmentInfo[index].filePath);
|
// 通过临时路径读取文件
|
uni.uploadFile({
|
url: CommonUtils.getServerUrl() + "/Sb_EquipDotCheckBill/UploadFile",
|
filePath: this.attachmentInfo[index].filePath,
|
name: 'file',
|
formData: {
|
HBillNo: this.hform.HBillNo,
|
HRemark: "",
|
HUserName: getUserInfo()["Czymc"]
|
},
|
success: (uploadRes) => {
|
CommonUtils.showTips({
|
message: "上传成功"
|
})
|
this.attachmentInfo[index].status = "上传成功"
|
},
|
fail: (err) => {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `上传失败: ${err}`
|
})
|
}
|
})
|
},
|
delFile(index) {
|
console.log('attachmentInfo: ', this.attachmentInfo[index]);
|
uni.showModal({
|
title: '提示',
|
content: '确认要删除 " ' + this.attachmentInfo[index].fileName + ' " 删除后将不可恢复!',
|
success: (res) => {
|
if (res.confirm) {
|
this.attachmentInfo.splice(index, 1)
|
}
|
},
|
})
|
|
},
|
handleUploadCallback(res) { // 文件上传回调
|
console.log('file: ', res);
|
let fileInfo = res.data[0]
|
this.attachmentInfo.push({
|
fileName: fileInfo.name,
|
size: fileInfo.size,
|
status: '等待上传',
|
filePath: fileInfo.tempFilePath
|
})
|
},
|
// 上传文件
|
fileUpload() {
|
this.$refs.XeUpload.upload('file', {});
|
},
|
//获取班次数据
|
async getShiftList() {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/Gy_ShiftsController/Get_Gy_WorkShiftList',
|
data: {
|
sWhere: ` and 禁用标记 = '' and ISNULL(审核人,'') != '' and 使用组织名称 = '${uni.getStorageSync("Organization")}'`,
|
HMaker: getUserInfo()["Czymc"],
|
},
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
this.HShiftsList = data
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: Message
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: err
|
})
|
}
|
},
|
//获取班组数据
|
async getGroupList() {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/Gy_Group/list',
|
data: {
|
sWhere: ` and 禁用标记 != 'Y' and 审核人!='' and HUSEORGID = '1'`,
|
user: getUserInfo()["Czymc"],
|
},
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
this.HGroupList = data
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: Message
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: err
|
})
|
}
|
},
|
//获取使用部门数据
|
async getHDeptList() {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/Gy_Department/list',
|
data: {
|
sWhere: ` AND HUSEORGID = ${uni.getStorageSync('OrganizationID')} `,
|
user: uni.getStorageSync('HUserName'),
|
Organization: uni.getStorageSync('Organization')
|
}
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
this.HDeptList = data
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: Message
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: err
|
})
|
}
|
},
|
toScanCode() {
|
MpaasScan.scanCode(cb => {
|
this.hform.HBarCode = cb
|
this.GetMessageByBarCode(cb)
|
})
|
},
|
inputPopupClose(type) {
|
if(type == 1) {
|
// 确认
|
let index = this.selectTechParamItem.index
|
let item = this.selectTechParamItem.item
|
|
this.HTechParams[index] = item
|
}
|
this.selectTechParamItem = {
|
index: -1,
|
item: {
|
HStd: 0,
|
HMax: 0,
|
HMin: 0
|
}
|
},
|
this.$refs.inputPopup.close()
|
},
|
async GetMessageByBarCode(HBarCode) {
|
try {
|
let res = await CommonUtils.doRequest2Sync({
|
url: "/Gy_EquipFileBill/txtHBarCode_KeyDown",
|
data: {
|
HBarCode: HBarCode,
|
user: getUserInfo()["Czymc"]
|
},
|
})
|
|
|
if (!res) {
|
return
|
}
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
|
if (count == 1) {
|
console.log('data: ', data);
|
this.hform.HEquipID = data[0].HInterID
|
this.hform.HBarName = data[0].设备名称
|
this.hform.HBarSpec = data[0].设备规格
|
this.hform.HBarModel = data[0].设备型号
|
this.hform.HQty = 1
|
|
// 获取检验规程
|
this.GetItemByEquipFile()
|
} else {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: Message
|
})
|
}
|
|
} catch (err) {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: err
|
})
|
}
|
},
|
// 获取保养规程
|
async get_DocCheckItem2(HDotCheckRuleInterID) {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: "/Web/GetDotCheckRuleItemByDotCheckRuleID",
|
data: {
|
"HDotCheckRuleInterID": HDotCheckRuleInterID
|
},
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
console.log('data: ', data);
|
this.hform.HEquipDotCheckRuleInterID = data[0].HInterID
|
this.hform.HEquipDotCheckRuleInterNo = data[0].HBillNo
|
this.hform.HPlanNo = data[0].点检计划单
|
this.hform.HPlanInterID = (data[0].点检计划ID == null ? 0 : data[0].点检计划ID) == "" ? 0 : data[0]
|
.点检计划ID
|
this.hform.HPlanEntryID = (data[0].点检计划子ID == null ? 0 : data[0].点检计划子ID) == "" ? 0 : data[
|
0].点检计划子ID
|
|
this.HCheckFileList = Array.from(data).map(item => {
|
return {
|
"HDotCheckItemID": item.HDotCheckItemID,
|
"HDotCheckCode": item.点检项目代码,
|
"HDotCheckItem": item.点检项目,
|
"HDotCheckPart": item.点检部位,
|
"HClaim": item.具体要求,
|
"HManagerID": item.负责人ID,
|
"HManagerCode": item.负责人代码,
|
"HManagerName": item.负责人名称,
|
"HSourceInterID": item.点检计划ID == null ? 0 : item.点检计划ID,
|
"HSourceEntryID": item.点检计划子ID == null ? 0 : item.点检计划子ID,
|
"HSourceBillNo": item.点检计划单,
|
"HDotCheckItemClassID": 0,
|
"HDotCheckItemClassName": "",
|
"HDotCheckItemMethodID": 0,
|
"HDotCheckItemMethodName": "",
|
//"HDotCheckResult": item.默认结论 == 1 ? true : false
|
"HDotCheckResult": item.默认点检结果 == 'OK' ? true : false
|
}
|
})
|
|
this.enableEdit = false
|
this.$refs["billSelector"].exit()
|
|
} else {
|
CommonUtils.showTips({
|
message: Message
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
message: err
|
})
|
}
|
},
|
async GetItemByEquipFile() {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: "/Web/GetItemByEquipFile",
|
data: {
|
"EquipProjectID": this.hform.HEquipID,
|
"Type": "DJ",
|
"HDate": this.hform.HBeginDate
|
}
|
})
|
|
let {
|
data,
|
Message,
|
count
|
} = res.data
|
if (count == 1) {
|
this.hform.HEquipDotCheckRuleInterID = data[0].点检规程ID
|
this.hform.HEquipDotCheckRuleInterNo = data[0].点检规程单号
|
this.hform.HPlanNo = data[0].点检计划单
|
this.hform.HPlanInterID = (data[0].点检计划ID == null ? 0 : data[0].点检计划ID) == "" ? 0 : data[0]
|
.点检计划ID
|
this.hform.HPlanEntryID = (data[0].点检计划子ID == null ? 0 : data[0].点检计划子ID) == "" ? 0 : data[
|
0].点检计划子ID
|
|
this.HCheckFileList = Array.from(data).map(item => {
|
return {
|
"HDotCheckItemID": item.HDotCheckItemID,
|
"HDotCheckCode": item.点检项目代码,
|
"HDotCheckItem": item.点检项目名称,
|
"HDotCheckPart": item.点检部位,
|
"HClaim": item.具体要求,
|
"HManagerID": item.负责人ID,
|
"HManagerCode": item.负责人代码,
|
"HManagerName": item.负责人名称,
|
"HSourceInterID": item.点检计划ID == null ? 0 : item.点检计划ID,
|
"HSourceEntryID": item.点检计划子ID == null ? 0 : item.点检计划子ID,
|
"HSourceBillNo": item.点检计划单,
|
"HDotCheckItemClassID": 0,
|
"HDotCheckItemClassName": "",
|
"HDotCheckItemMethodID": 0,
|
"HDotCheckItemMethodName": "",
|
"HDotCheckResult": item.默认点检结果 == 'OK' ? true : false
|
}
|
})
|
this.tabs = 1
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `获取点检规程错误: ${Message}`
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `获取点检规程错误: ${err}`
|
})
|
}
|
},
|
radioChange({
|
detail: {
|
value
|
}
|
}) {
|
this.HLastResult = value
|
},
|
async getMaxNum() {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: "/Web/GetMAXNum",
|
data: {
|
"HBillType": this.HBillType
|
}
|
})
|
|
let {
|
count,
|
data,
|
Message
|
} = res.data
|
console.log('data: ', data);
|
this.hform.HInterID = data[0]["HInterID"]
|
this.hform.HBillNo = data[0]["HBillNo"]
|
} catch (err) {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: "获取单据信息异常: " + err
|
})
|
}
|
},
|
async set_CheckBill(HInterID, num) {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/SB_EquipICMOTechParamBillController/GetSB_EquipICMOTechParamBill_Check_Json',
|
data: {
|
"HInterID": HInterID,
|
"Type": num,
|
"HMaker": getUserInfo()["Czymc"]
|
}
|
})
|
let {
|
count
|
} = res.data
|
if (count == 1) {
|
return true
|
} else {
|
return false
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `审核失败: ${err}`
|
})
|
return false
|
}
|
},
|
async submit() {
|
try {
|
if (this.hform.HProcNo == '') {
|
this.hform.HProcNo = 0
|
}
|
let oMain = JSON.stringify(this.hform);
|
let sSubStr = JSON.stringify(this.HTechParams);
|
let operationType = this.operationType
|
if (operationType == 5) {
|
operationType = 1
|
}
|
let sMainSub = oMain + ';' + sSubStr + ';' + operationType + ';' + getUserInfo()["Czymc"];
|
let res = await CommonUtils.doRequest2Sync({
|
url: "/SB_EquipICMOTechParamBillController/GetSB_EquipICMOTechParamBill_Save_Json",
|
data: {
|
"sMainSub": sMainSub
|
},
|
method: "POST"
|
})
|
|
if (!res) {
|
return
|
}
|
|
let {
|
count,
|
Message,
|
data,
|
HInterID,
|
Verify
|
} = res.data
|
if (count == 1) {
|
|
if (Verify) {
|
await this.set_CheckBill(HInterID, 1); //审核
|
}
|
|
uni.showModal({
|
title: '提示',
|
content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
uni.redirectTo({
|
url: '/pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill?operationType=1'
|
})
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
setTimeout(() => {
|
uni.navigateBack();
|
}, 50)
|
}
|
}
|
});
|
} else {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: "提交单据失败: " + Message
|
})
|
}
|
|
|
} catch (err) {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: "提交单据失败: " + err
|
})
|
}
|
},
|
async loadBillMain(HInterID, HEntryID) {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: "/LEMS/MES_IF_EquipICMOTechParamList_Json",
|
data: {
|
hinterid: HInterID,
|
HEntryID,
|
HEntryID,
|
user: getUserInfo()["Czymc"]
|
}
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
|
if (count == 1) {
|
|
Object.assign(this.hform, {
|
"HMaterID": data[0].HMaterID,
|
"HMaterNumber": data[0].产品代码,
|
"HMaterName": data[0].产品名称,
|
"HMaterModel": data[0].规格型号,
|
"HProcID": data[0].HProcID,
|
"HProcName": data[0].工序名称,
|
"HProcNo": data[0].工序号,
|
//"HGroupID": data[0].HGroupID == undefined ? 0 : data[0].HGroupID,
|
//"HGroupName": data[0].班组,
|
"HDeptID": data[0].HDeptID == undefined ? 0 : data[0].HDeptID,
|
"HDeptName": data[0].加工车间,
|
|
"HSourceID": data[0].HSourceID,
|
"HSourceName": data[0].生产资源,
|
|
"HEquipID": data[0].HEquipID,
|
"HEquipName": data[0].设备名称,
|
|
"HICMOInterID": data[0].hicmointerid,
|
"HICMOEntryID": data[0].HICMOEntryID,
|
"HICMOBillNo": data[0].任务单号,
|
|
"HProcExchInterID": data[0].hmainid,
|
"HProcExchEntryID": data[0].HEntryID,
|
"HProcExchBillNo": data[0].单据号,
|
|
"HMainSourceInterID": data[0].hmainid,
|
"HMainSourceEntryID": data[0].HEntryID,
|
"HMainSourceBillNo": data[0].单据号,
|
"HMainSourceBillType": data[0].单据类型,
|
})
|
|
this.HTechParams = data.map(item => {
|
return {
|
"HTechParamClassID": item["HTechParamClassID"] == null ? 0 : item[
|
"HTechParamClassID"],
|
"HTechParamClassName": item["工艺参数大类名称"],
|
"HTechParamID": item["HTechParamID"] == null ? 0 : item[
|
"HTechParamID"
|
],
|
"HTechParamNumber": item["工艺参数代码"],
|
"HTechParamName": item["工艺参数名称"],
|
"HTechParamUnitID": item["HTechParamUnitID"] == null ? 0 : item[
|
"HTechParamUnitID"],
|
"HTechParamUnitNumber": item["工艺参数单位代码"],
|
"HTechParamUnitName": item["工艺参数单位名称"],
|
"HSNO": item["工艺次序"] == null ? 0 : item["工艺次序"],
|
"HTechParamIDStd": item["HTechParamIDStd"] == null ? 0 : item[
|
"HTechParamIDStd"],
|
"HTechParamIDStdName": item["对应设定值工艺参数"],
|
"HResultStd": "",
|
"HVaule": item["数采值"],
|
"HStd": item["标准值"],
|
"HMax": item["上限值"],
|
"HMin": item["下限值"],
|
"HRemark": item["采集来源"],
|
"HResult": (item["数采值"] <= item["上限值"] && item["数采值"] >= item["下限值"]) ?
|
"OK" : "NG",
|
"HIsRequired": item["HIsRequired"]
|
}
|
})
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `获取源单信息失败: ${Message}`
|
})
|
}
|
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `获取源单信息失败: ${err}`
|
})
|
}
|
},
|
async getEmpList() {
|
try {
|
let sWhere = " where 1=1 "
|
if (this.hform.HDeptName && uni.getStorageSync("Organization") == '宁波市华舟包装有限公司') {
|
sWhere += ` and HDeptName = '${this.hform.HDeptName}'`
|
}
|
let res = await CommonUtils.doRequest2Async({
|
url: '/PublicPageMethod/UserList',
|
data: {
|
sWhere: sWhere,
|
}
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
this.HEmpList = data
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: Message
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: err
|
})
|
}
|
},
|
},
|
onLoad(e) {
|
console.log('e: ', e);
|
if (!e.operationType) {
|
this.operationType = 1
|
} else {
|
this.operationType = e.operationType
|
}
|
|
if (this.operationType == 1) {
|
// 新增
|
this.getMaxNum()
|
} else if (this.operationType == 2) {
|
// 复制
|
} else if (this.operationType == 3) {
|
// 编辑
|
|
} else if (this.operationType == 4) {
|
// 浏览
|
|
} else if (this.operationType == 5) {
|
// 报工平台下推
|
this.getMaxNum()
|
let {
|
hinterid,
|
hsubid
|
} = e
|
this.loadBillMain(hinterid, hsubid)
|
}
|
|
this.getHDeptList()
|
// this.getShiftList()
|
this.getGroupList()
|
this.getEmpList()
|
},
|
onReady() {
|
const query = uni.createSelectorQuery().in(this)
|
query.select("#buttons")
|
.boundingClientRect()
|
.select("#tabs")
|
.boundingClientRect()
|
.exec(res => {
|
this.btnTop = Math.floor(res[0].top)
|
this.tabsBottom = Math.ceil(res[1].bottom)
|
})
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import "@/pages/MJGL/style/MJBillStyle.scss";
|
|
.inputPopup {
|
background-color: #fff;
|
padding: 20rpx;
|
}
|
</style>
|