<template>
|
<view>
|
<!-- 页签区域 -->
|
<view class="tabs" id="tabs">
|
<view class="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>
|
</view>
|
<!-- 基本信息 -->
|
<template v-if="tabs == 0">
|
<view class="form" :style="{height: containerHeight + 'px',overflow: 'auto' }">
|
<view class="form-item">
|
<view class="title">单据号:</view>
|
<view class="righton">
|
<input name="HBillNo" disabled v-model="hform.HBillNo" placeholder="请输入单据号" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">单据日期:</view>
|
<view class="righton">
|
<input name="HDate" disabled v-model="hform.HDate" placeholder="请选择" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">验收内容:</view>
|
<view class="right">
|
<input name="HCheckNote" v-model="hform.HCheckNote" placeholder="请输入验收内容" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">验收结果:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHCheckResult" placeholder="请选择验收结果" v-model="hform.HCheckResult"
|
@input="HCheckResultChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">验收时间:</view>
|
<view class="righton">
|
<input name="HHCheckDate" disabled v-model="hform.HHCheckDate" placeholder="请选择" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">主题:</view>
|
<view class="righton">
|
<input name="HContext" disabled v-model="hform.HContext" placeholder="请输入主题" />
|
</view>
|
</view>
|
<view class="form-item" style="align-items: flex-start;">
|
<view class="title"><text>*</text>详细内容:</view>
|
<view class="righton" style="min-height: 150rpx;">
|
<textarea name="HDescription" v-model="hform.HDescription" auto-height maxlength="-1"
|
placeholder="请输入详细内容" disabled ></textarea>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">异常类型:</view>
|
<view class="righton">
|
<uni-combox :candidates="arrayHErrMsgBackTypeName" placeholder="请选择"
|
v-model="hform.HErrMsgBackTypeName" @input="HErrMsgBackTypeNameChange" disabled ></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">发送部门:</view>
|
<view class="righton">
|
<uni-combox :candidates="arrayHDeptName" placeholder="请选择部门" v-model="hform.HDeptName"
|
@input="HDeptNameChange" disabled ></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">发送人:</view>
|
<view class="righton">
|
<uni-combox :candidates="arrayHEmpName" placeholder="请选择发送人" v-model="hform.HSendMan"
|
@input="HSendManChange" disabled ></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title"><text>*</text>接收人:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHEmpName" placeholder="请选择接收人" v-model="hform.HReceiveMan"
|
@input="HReceiveManChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title"><text>*</text>验收人:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHEmpName" placeholder="请选择验收人" v-model="hform.HCheckEmpName"
|
@input="HCheckEmpManChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">相关设备:</view>
|
<view class="righton">
|
<uni-combox :candidates="arrayHEquipName" placeholder="请选择设备" v-model="hform.HEquipName"
|
@input="HEquipNameChange" disabled ></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">相关模具:</view>
|
<view class="righton">
|
<uni-combox :candidates="arrayHMouldName" placeholder="请选择模具" v-model="hform.HMouldName"
|
@input="HMouldIDNameChange" disabled ></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">产品名称:</view>
|
<view class="righton">
|
<input name="HMaterName" disabled v-model="hform.HMaterName" placeholder="请输入产品名称" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">规格型号:</view>
|
<view class="righton">
|
<input name="HMaterModel" disabled v-model="hform.HMaterModel" placeholder="请输入规格型号" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">备注:</view>
|
<view class="right" style="min-height: 150rpx;">
|
<input name="HRemark" v-model="hform.HRemark" placeholder="" />
|
</view>
|
</view>
|
</view>
|
</template>
|
<!-- 其他信息 -->
|
<template v-if="tabs == 1">
|
<view class="form">
|
<view class="form-item">
|
<view class="title">接收部门:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHDeptName" placeholder="请选择部门" v-model="hform.HReceiveName"
|
@input="HRecceiveChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">抄送人:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHEmpName" placeholder="请选择抄送人" v-model="hform.HCopyMan"
|
@input="HCopyManChange" multiple></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">紧急程度:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHLevel" placeholder="请选择紧急程度" v-model="hform.HLevel"
|
@input="HLevelChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">单据类型:</view>
|
<view class="righton">
|
<input name="HBillTypeName" disabled v-model="hform.HBillTypeName" placeholder="请输入单据类型" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">单据号码:</view>
|
<view class="righton">
|
<input name="HPlanBillNo" disabled v-model="hform.HPlanBillNo" placeholder="请输入单据号码" />
|
</view>
|
</view>
|
</view>
|
</template>
|
<!-- 制单信息 -->
|
<template v-if="tabs == 2">
|
<view class="form">
|
<view class="form-item">
|
<view class="title">制单人:</view>
|
<view class="righton">
|
<input v-model="hform.HMaker" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">制单日期:</view>
|
<view class="righton">
|
<input name="HMakeDate" disabled v-model="hform.HMakeDate" placeholder="" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">修改人:</view>
|
<view class="righton">
|
<input v-model="hform.HUpDater" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">修改日期:</view>
|
<view class="righton">
|
<input name="HUpDateDate" disabled v-model="hform.HUpDateDate" placeholder="" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">审核人:</view>
|
<view class="righton">
|
<input v-model="hform.HChecker" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">审核日期:</view>
|
<view class="righton">
|
<input name="HCheckDate" disabled v-model="hform.HCheckDate" placeholder="" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">作废人:</view>
|
<view class="righton">
|
<input v-model="hform.HDeleteMan" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">作废日期:</view>
|
<view class="righton">
|
<input name="HDeleteDate" disabled v-model="hform.HDeleteDate" placeholder="" />
|
</view>
|
</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>
|
</view>
|
</template>
|
<script>
|
import dayjs from "dayjs";
|
import {
|
CommonUtils
|
} from "@/utils/common";
|
import getDateTime from '@/utils/getdateTime.js';
|
import {
|
getUserInfo
|
} from "../../../../utils/auth";
|
export default {
|
data() {
|
return {
|
tabs: 0,
|
tabsBottom: 0,
|
userInfo: getUserInfo(),
|
serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
|
OperationType: 1,
|
refSav: "",
|
|
arrayHLevel: ['普通', '紧急'],
|
arrayHCheckResult: ['完成', '未完成'],
|
|
// 人员相关数组
|
arrayHEmpName: [], // 接收人 发送人 验收人 责任人 抄送人 QE责任人
|
HEmpNameList: [],
|
|
|
// 其他数组
|
arrayHDeptName: [], // 接收、发送部门
|
HDeptNameList: [],
|
arrayHErrMsgBackTypeName: [], // 异常反馈类型
|
HErrMsgBackTypeNameList: [],
|
arrayHEquipName: [], //设备
|
HEquipNameList: [],
|
arrayHMouldName: [], //模具
|
HMouldNameList: [],
|
|
isEdit: false,
|
|
hform: {
|
HBillNo: '',
|
HInterID: '',
|
HDate: getDateTime.dateTimeStr('y-m-d h:i:s'),
|
HHCheckDate: getDateTime.dateTimeStr('y-m-d h:i:s'),
|
HCheckNote: '',
|
HContext: '',
|
HDescription: '',
|
HRemark: '',
|
|
HErrMsgBackTypeName: '',
|
HErrMsgBackTypeID: '0',
|
HDeptName: getUserInfo().HDeptName,
|
HDeptID: getUserInfo().HDeptID,
|
HReceiveName: getUserInfo().HDeptName,
|
HReceiveID: getUserInfo().HDeptID,
|
|
HSendMan: getUserInfo().Czymc, //发送人
|
HReceiveMan: getUserInfo().HEmpName, //接收人
|
HCheckEmpName: getUserInfo().HEmpName, //验收人
|
HCheckEmpID: getUserInfo().HEmpID,
|
HCopyMan: '', //抄送人
|
|
HCheckResult: '完成',
|
HLevel: '普通',
|
HBillTypeName: '',
|
HPlanBillNo: '',
|
HMaterNumber: '',
|
HMaterName: '',
|
HMaterModel: '',
|
|
// 新添加的字段
|
|
|
HEquipName: '', // 设备
|
HEquipID: '0', // 设备ID
|
HMouldName: '', // 模具
|
HMouldID: '0', // 模具ID
|
|
HMainSourceBillNo: '',
|
HMainSourceInterID: '0',
|
HMainSourceEntryID: '0',
|
HMainSourceBillType: '',
|
|
HErrMsgBackBillNo: '',
|
HErrMsgBackInterID: '0',
|
HErrMsgBackEntryID: '0',
|
|
HMaker: getUserInfo().Czymc,
|
HMakeDate: getDateTime.dateTimeStr('y-m-d h:i:s'),
|
HUpDater: '',
|
HUpDateDate: '',
|
HChecker: '',
|
HCheckDate: '',
|
HDeleteMan: '', // 作废人
|
HDeleteDate: '', // 作废日期
|
}
|
}
|
},
|
onLoad(e) {
|
this.getListData()
|
if (!e.OperationType) {
|
this.OperationType = 1
|
} else {
|
this.OperationType = e.OperationType
|
}
|
|
// 新增:获取路由参数
|
this.linterid = e.linterid || ''
|
this.HEntryID = e.HEntryID || '0'
|
this.HSouceBillType = e.HSouceBillType || ''
|
|
if (this.OperationType == 1) {
|
// 新增
|
this.getMaxNum()
|
} else if (this.OperationType == 2) {
|
// 有源单
|
this.getMaxNum()
|
// 获取源单数据并赋值
|
this.getSourceData(this.linterid, this.HEntryID, this.HSouceBillType)
|
} else if (this.OperationType == 3) {
|
// 编辑
|
this.getEditData(e.hmainid)
|
} else if (this.OperationType == 4) {
|
// 浏览
|
}
|
},
|
computed: {
|
containerHeight: {
|
get() {
|
return this.btnTop - this.tabsBottom - 5
|
}
|
}
|
},
|
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)
|
})
|
},
|
methods: {
|
//选择发送部门
|
HDeptNameChange(e) {
|
for (var i = 0; i < this.HDeptNameList.length; i++) {
|
if (this.HDeptNameList[i].部门名称 == e) {
|
this.hform.HDeptID = this.HDeptNameList[i].HItemID;
|
break;
|
}
|
}
|
},
|
//选择接收部门
|
HRecceiveChange(e) {
|
for (var i = 0; i < this.HDeptNameList.length; i++) {
|
if (this.HDeptNameList[i].部门名称 == e) {
|
this.hform.HReceiveID = this.HDeptNameList[i].HItemID;
|
break;
|
}
|
}
|
},
|
//选择异常反馈类型
|
HErrMsgBackTypeNameChange(e) {
|
for (var i = 0; i < this.HErrMsgBackTypeNameList.length; i++) {
|
if (this.HErrMsgBackTypeNameList[i].异常反馈类型名称 == e) {
|
this.hform.HErrMsgBackTypeName = this.HErrMsgBackTypeNameList[i].异常反馈类型名称;
|
this.hform.HErrMsgBackTypeID = this.HErrMsgBackTypeNameList[i].HItemID;
|
break;
|
}
|
}
|
},
|
//选择发送人
|
HSendManChange(e) {
|
for (var i = 0; i < this.HEmpNameList.length; i++) {
|
if (this.HEmpNameList[i].HName == e) {
|
|
}
|
}
|
},
|
//选择接收人
|
HReceiveManChange(e) {
|
for (var i = 0; i < this.HEmpNameList.length; i++) {
|
if (this.HEmpNameList[i].HName == e) {
|
|
}
|
}
|
},
|
//选择验收人
|
HCheckEmpChange(e) {
|
for (var i = 0; i < this.HEmpNameList.length; i++) {
|
if (this.HEmpNameList[i].HName == e) {
|
this.hform.HCheckEmpID = this.HEmpNameList[i].HItemID
|
}
|
}
|
},
|
//选择抄送人
|
HCopyManChange(e) {
|
for (var i = 0; i < this.HEmpNameList.length; i++) {
|
if (this.HEmpNameList[i].HName == e) {
|
|
}
|
}
|
},
|
//选择设备
|
HEquipNameChange(e) {
|
for (var i = 0; i < this.HEquipNameList.length; i++) {
|
if (this.HEquipNameList[i].HName == e) {
|
this.hform.HEquipName = this.HEquipNameList[i].HName;
|
this.hform.HEquipID = this.HEquipNameList[i].HInterID;
|
break;
|
}
|
}
|
},
|
//选择模具
|
HMouldIDNameChange(e) {
|
for (var i = 0; i < this.HMouldNameList.length; i++) {
|
if (this.HMouldNameList[i].HName == e) {
|
this.hform.HMouldName = this.HMouldNameList[i].HName;
|
this.hform.HMouldID = this.HMouldNameList[i].HInterID;
|
break;
|
}
|
}
|
},
|
// 静态下拉框选择方法
|
HLevelChange(e) {
|
this.hform.HLevel = e;
|
},
|
//新增按钮事件
|
addNew() {
|
uni.showModal({
|
title: '提示',
|
content: '新增后页面数据将消失,确定要新增吗?',
|
success: (res) => {
|
if (res.confirm) {
|
uni.redirectTo({
|
url: '/pages/ZLGL/AanDengHujiao/OA_ErrMsgBackCheckBill/OA_ErrMsgBackCheckBill?operationType=1'
|
})
|
// 重新获取最大单据号
|
this.getMaxNum();
|
// 切换到基本信息页签
|
this.tabs = 0;
|
}
|
}
|
});
|
},
|
// 获取所有列表数据
|
getListData() {
|
// 获取部门列表
|
this.getDepartmentList();
|
// 获取异常反馈类型列表
|
this.getHErrMesTypeList();
|
// 获取人员列表(接收人、验收人、抄送人、责任人、QE责任人)
|
this.getPersonList();
|
// 获取设备列表
|
this.getEquipList();
|
// 获取模具列表
|
this.getModList();
|
},
|
|
// 获取部门列表
|
getDepartmentList() {
|
uni.request({
|
url: this.serverUrl + '/Gy_Department/list',
|
data: {
|
sWhere: "",
|
user: uni.getStorageSync('HUserName'),
|
Organization: uni.getStorageSync('Organization')
|
},
|
success: (res) => {
|
if (res.data.count == 1) {
|
this.HDeptNameList = res.data.data
|
for (var i = 0; i < res.data.data.length; i++) {
|
this.arrayHDeptName[i] = res.data.data[i].部门名称
|
}
|
this.$forceUpdate();
|
} else {
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
},
|
});
|
},
|
|
// 获取异常反馈类型列表
|
getHErrMesTypeList() {
|
uni.request({
|
url: this.serverUrl + '/Web/GetGy_ErrMsgBackTypeList_Json',
|
data: {
|
ErrMsg: "",
|
},
|
success: (res) => {
|
if (res.data.count == 1) {
|
this.HErrMsgBackTypeNameList = res.data.data
|
for (var i = 0; i < res.data.data.length; i++) {
|
this.arrayHErrMsgBackTypeName[i] = res.data.data[i].异常反馈类型名称
|
}
|
this.$forceUpdate();
|
} else {
|
uni.showToast({
|
title: '获取异常反馈类型信息失败',
|
icon: 'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: '获取异常反馈类型信息失败',
|
icon: 'none'
|
})
|
},
|
});
|
},
|
|
// 获取人员列表(通用方法)
|
getPersonList() {
|
uni.request({
|
url: this.serverUrl + '/Web/GetEmployeeList_Json',
|
data: {
|
Employee: '',
|
HGroupID: 0
|
},
|
success: (res) => {
|
if (res.data.count == 1) {
|
this.HEmpNameList = res.data.data
|
for (var i = 0; i < res.data.data.length; i++) {
|
this.arrayHEmpName[i] = res.data.data[i].HName
|
}
|
this.$forceUpdate();
|
} else {
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: '接口请求失败',
|
icon: 'none'
|
})
|
},
|
});
|
},
|
|
// 获取设备列表
|
getEquipList() {
|
uni.request({
|
url: this.serverUrl + '/WEBSController/GetEquipList_Json',
|
data: {
|
Equip: "",
|
HCenterID: 0 //uni.getStorageSync("HWorkCenterID")
|
},
|
success: (res) => {
|
if (res.data.count == 1) {
|
this.HEquipNameList = res.data.data
|
for (var i = 0; i < res.data.data.length; i++) {
|
this.arrayHEquipName[i] = res.data.data[i].HName
|
}
|
this.$forceUpdate();
|
} else {
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
},
|
});
|
},
|
|
// 获取模具列表
|
getModList() {
|
uni.request({
|
url: this.serverUrl + '/Web/GetGy_MouldFileMainList_Json',
|
data: {
|
MouldFileMain: ""
|
},
|
success: (res) => {
|
if (res.data.count == 1) {
|
this.HMouldNameList = res.data.data
|
for (var i = 0; i < res.data.data.length; i++) {
|
this.arrayHMouldName[i] = res.data.data[i].HName
|
}
|
this.$forceUpdate();
|
} else {
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
},
|
});
|
},
|
|
//新增
|
getMaxNum() {
|
uni.request({
|
url: this.serverUrl + '/Web/GetMAXNum',
|
data: {
|
HBillType: '4532'
|
},
|
success: (res) => {
|
if (res.data.count == 1) {
|
this.hform.HInterID = res.data.data[0].HInterID
|
this.hform.HBillNo = res.data.data[0].HBillNo
|
} else {
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: '接口请求失败',
|
icon: 'none'
|
})
|
},
|
});
|
},
|
// 获取源单数据并赋值
|
getSourceData(HInterID, HEntryID, HSouceBillType) {
|
let num = 1
|
if (HSouceBillType == '4502') {
|
num = 1; //异常反馈单
|
} else if (HSouceBillType == '4529') {
|
num = 2; //异常反馈接收单
|
} else if (HSouceBillType == '4531') {
|
num = 3; //异常反馈处理单
|
}
|
|
uni.request({
|
url: this.serverUrl + '/Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackList',
|
method: 'GET',
|
data: {
|
"HInterID": HInterID,
|
"HEntryID": HEntryID,
|
"user": uni.getStorageSync('HUserName'),
|
"num": num
|
},
|
success: (res) => {
|
if (res.data.count == 1) {
|
const LoadData = res.data.data[0]
|
|
if (num == 1) {
|
// 异常反馈单
|
this.hform.HDeptID = LoadData.HDeptID
|
this.hform.HDeptName = LoadData.发送部门
|
this.hform.HReceiveID = LoadData.HRecDeptID
|
this.hform.HReceiveName = LoadData.接收部门
|
this.hform.HErrMsgBackTypeID = LoadData.HErrMsgBackTypeID
|
this.hform.HErrMsgBackTypeName = LoadData.异常类型名称
|
this.hform.HSendMan = LoadData.发送人
|
this.hform.HReceiveMan = LoadData.指派处理人
|
this.hform.HCopyMan = LoadData.抄送
|
this.hform.HLevel = LoadData.紧急程度
|
this.hform.HContext = LoadData.主题
|
this.hform.HDescription = LoadData.详细内容
|
this.hform.HMaterName = LoadData.物料名称
|
this.hform.HMaterModel = LoadData.规格型号
|
this.hform.HEquipID = LoadData.设备id
|
this.hform.HEquipName = LoadData.设备名称
|
this.hform.HMouldID = LoadData.模具id
|
this.hform.HMouldName = LoadData.模具名称
|
this.hform.HBillTypeName = HSouceBillType
|
this.hform.HPlanBillNo = LoadData.单据号
|
this.hform.HMainSourceBillNo = LoadData.单据号
|
this.hform.HMainSourceInterID = LoadData.HInterID
|
this.hform.HMainSourceEntryID = LoadData.HEntryID
|
this.hform.HMainSourceBillType = HSouceBillType
|
this.hform.HErrMsgBackBillNo = LoadData.单据号
|
this.hform.HErrMsgBackInterID = LoadData.HInterID
|
this.hform.HErrMsgBackEntryID = LoadData.HEntryID
|
|
} else if (num == 2) {
|
// 异常反馈接收单
|
this.hform.HDeptID = LoadData.HDeptID
|
this.hform.HDeptName = LoadData.发送部门
|
this.hform.HReceiveID = LoadData.HReceiveID == undefined ? 0 : LoadData
|
.HReceiveID
|
this.hform.HReceiveName = LoadData.接收部门
|
this.hform.HErrMsgBackTypeID = LoadData.HErrMsgBackTypeID
|
this.hform.HErrMsgBackTypeName = LoadData.异常类型名称
|
this.hform.HSendMan = LoadData.发送人
|
this.hform.HReceiveMan = LoadData.接收人
|
this.hform.HCopyMan = LoadData.抄送人
|
this.hform.HLevel = LoadData.紧急程度
|
this.hform.HContext = LoadData.主题
|
this.hform.HDescription = LoadData.详细内容
|
this.hform.HMaterName = LoadData.产品名称
|
this.hform.HMaterModel = LoadData.规格型号
|
this.hform.HBillTypeName = HSouceBillType
|
this.hform.HPlanBillNo = LoadData.单据号
|
this.hform.HEquipID = LoadData.HEquipID
|
this.hform.HEquipName = LoadData.设备名称
|
this.hform.HMouldID = LoadData.HMouldID
|
this.hform.HMouldName = LoadData.模治具名称
|
this.hform.HMainSourceBillNo = LoadData.单据号
|
this.hform.HMainSourceInterID = LoadData.hmainid
|
this.hform.HMainSourceEntryID = LoadData.HEntryID == undefined ? "0" : LoadData
|
.HEntryID
|
this.hform.HMainSourceBillType = HSouceBillType
|
|
}else if (num == 2) {
|
// 异常反馈单
|
this.hform.HDeptID = LoadData.HDeptID
|
this.hform.HDeptName = LoadData.发送部门
|
this.hform.HReceiveID = LoadData.HRecDeptID
|
this.hform.HReceiveName = LoadData.接收部门
|
this.hform.HErrMsgBackTypeID = LoadData.HErrMsgBackTypeID
|
this.hform.HErrMsgBackTypeName = LoadData.异常类型名称
|
this.hform.HSendMan = LoadData.发送人
|
this.hform.HReceiveMan = LoadData.指派处理人
|
this.hform.HCopyMan = LoadData.抄送
|
this.hform.HLevel = LoadData.紧急程度
|
this.hform.HContext = LoadData.主题
|
this.hform.HDescription = LoadData.详细内容
|
this.hform.HMaterName = LoadData.物料名称
|
this.hform.HMaterModel = LoadData.规格型号
|
this.hform.HEquipID = LoadData.设备id
|
this.hform.HEquipName = LoadData.设备名称
|
this.hform.HMouldID = LoadData.模具id
|
this.hform.HMouldName = LoadData.模具名称
|
this.hform.HBillTypeName = HSouceBillType
|
this.hform.HPlanBillNo = LoadData.单据号
|
this.hform.HMainSourceBillNo = LoadData.单据号
|
this.hform.HMainSourceInterID = LoadData.hmainid
|
this.hform.HMainSourceEntryID = LoadData.HEntryID
|
this.hform.HMainSourceBillType = HSouceBillType
|
this.hform.HErrMsgBackBillNo = LoadData.单据号
|
this.hform.HErrMsgBackInterID = LoadData.hmainid
|
this.hform.HErrMsgBackEntryID = LoadData.HEntryID
|
|
}
|
|
// 强制更新视图
|
this.$forceUpdate()
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: res.data.msg,
|
icon: 'none'
|
})
|
},
|
})
|
},
|
//编辑
|
getEditData(HInterID) {
|
uni.showLoading({
|
title: '加载中'
|
});
|
uni.request({
|
url: this.serverUrl + '/Sc_MESTransFerWorkBill/Edit_OA_ErrMsgBackCheckBill',
|
data: {
|
"HID": HInterID
|
},
|
success: (res) => {
|
uni.hideLoading();
|
console.log('编辑数据:', res);
|
if (res.data.code == 1) {
|
const data = res.data.data[0]; // 注意这里改为data[0]
|
this.hform = {
|
...this.hform, // 保留原有的默认值
|
HInterID: data["hmainid"] || '',
|
HEntryID: data["HEntryID"] || '',
|
HBillNo: data["单据号"] || '',
|
HDate: data["日期"] ? dayjs(data["日期"]).format("YYYY-MM-DD") : dayjs(
|
new Date()).format("YYYY-MM-DD"),
|
|
HErrMsgBackTypeID: data["HErrMsgBackTypeID"] || '0',
|
HErrMsgBackTypeName: data["异常类型"] || '',
|
HContext: data["主题"] || '',
|
HDescription: data["内容"] || '',
|
|
HDeptID: data["HDeptID"] || '0',
|
HDeptName: data["发送部门"] || '',
|
HReceiveID: data["HReceiveID"] || '0', // 新增字段
|
HReceiveName: data["接收部门"] || '',
|
|
HSendMan: data["发送人"] || '',
|
HReceiveMan: data["接收人"] || '',
|
HCopyMan: data["抄送人"] || '',
|
|
HBillTypeName: data["单据类型"] || '',
|
HPlanBillNo: data["单据号码"] || '',
|
HMaterName: data["产品名称"] || '',
|
HMaterModel: data["规格型号"] || '',
|
|
HEquipID: data["HEquipID"] || '0',
|
HEquipName: data["设备名称"] || '',
|
|
HMouldID: data["HMouldID"] || '0',
|
HMouldName: data["模治具名称"] || '',
|
|
HCheckEmpID: data["HCheckEmpID"] || '0',
|
HCheckEmp: data["验收人"] || '',
|
HCheckNote: data["验收内容"] || '',
|
HCheckResult: data["验收结果"] || '',
|
HHCheckDate: data["验收时间"] ? dayjs(data["验收时间"]).format(
|
"YYYY-MM-DD HH:mm:ss") : dayjs(new Date()).format("YYYY-MM-DD"),
|
|
|
HMainSourceInterID: data["源单ID"] || '0',
|
HMainSourceEntryID: data["源单子ID"] || '0',
|
HMainSourceBillNo: data["源单单号"] || '',
|
HMainSourceBillType: data["源单类型"] || '',
|
|
HErrMsgBackBillNo: data["异常反馈单号"] || '',
|
HErrMsgBackInterID: data["异常反馈单主内码"] || '0',
|
HErrMsgBackEntryID: data["异常反馈单子内码"] || '0',
|
|
HRemark: data["表头备注"] || '',
|
HMaker: data["制单人"] || this.userInfo.Czymc || '',
|
HMakeDate: data["制单日期"] ? dayjs(data["制单日期"]).format("YYYY-MM-DD") : dayjs(
|
new Date()).format("YYYY-MM-DD"),
|
|
HUpDater: data["修改人"] || this.userInfo.Czymc || '',
|
HUpDateDate: data["修改日期"] ? dayjs(data["修改日期"]).format("YYYY-MM-DD") :
|
dayjs(new Date()).format("YYYY-MM-DD"),
|
|
HChecker: data["审核人"] || '',
|
HCheckDate: data["审核日期"] ? dayjs(data["审核日期"]).format("YYYY-MM-DD") : '',
|
|
HDeleteMan: data["作废人"] || '',
|
HDeleteDate: data["作废日期"] ? dayjs(data["作废日期"]).format("YYYY-MM-DD") : '',
|
|
HLevel: data["紧急程度"] || '普通'
|
};
|
|
this.isEdit = true;
|
} else {
|
uni.showToast({
|
title: res.data.msg || '获取编辑数据失败',
|
icon: 'none'
|
});
|
}
|
},
|
fail: (res) => {
|
uni.hideLoading();
|
console.log('编辑数据请求失败:', res);
|
uni.showToast({
|
title: '接口请求失败',
|
icon: 'none'
|
});
|
}
|
});
|
},
|
//保存
|
submit() {
|
if (!this.hform.HReceiveMan) {
|
uni.showToast({
|
title: '请选择接收人',
|
icon: 'none'
|
})
|
} else {
|
uni.showLoading({
|
title: '请稍候'
|
})
|
if (this.OperationType == 1 || this.OperationType == 2 || this.OperationType == 4) {
|
this.refSav = "Add";
|
}
|
//若为编辑-保存,则更新修改人和修改时间
|
if (this.OperationType == 3) {
|
this.refSav = "Update";
|
this.hform.HUpdater = getUserInfo().Czymc;
|
this.hform.HUpdaterDate = dayjs(new Date()).format("YYYY-MM-DD");
|
}
|
var sMainStr = JSON.stringify(this.hform);
|
var sMainSub = sMainStr + ';' + this.refSav + ';' + uni.getStorageSync('HUserName')
|
uni.request({
|
url: this.serverUrl + '/Sc_MESTransFerWorkBill/SaveOA_ErrMsgBackCheckBill_APP',
|
method: 'POST',
|
dataType: "json",
|
data: {
|
"msg": sMainSub
|
},
|
success: (res) => {
|
console.log(1, res);
|
uni.hideLoading()
|
if (res.data.count == 1) {
|
if (res.data.Verify == "Y") { //自动审核
|
this.SaveVerify(res.data.HInterID) //审核
|
} else {
|
uni.showModal({
|
title: '提示',
|
content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
uni.redirectTo({
|
url: '/pages/ZLGL/AanDengHujiao/OA_ErrMsgBackCheckBill/OA_ErrMsgBackCheckBill?operationType=1'
|
})
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
setTimeout(() => {
|
uni.navigateBack();
|
}, 50)
|
}
|
}
|
});
|
}
|
}
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: '接口请求失败',
|
icon: 'none'
|
})
|
},
|
});
|
}
|
},
|
|
SaveVerify(HInterID) {
|
var datas = {
|
HInterID: HInterID,
|
IsAudit: 0,
|
CurUserName: getUserInfo().Czymc
|
}
|
uni.request({
|
url: this.serverUrl + '/Sc_MESTransFerWorkBill/AuditOA_ErrMsgBackCheckBill',
|
method: 'GET',
|
dataType: "json",
|
async: true,
|
data: datas,
|
success: (res) => {
|
uni.showModal({
|
title: '提示',
|
content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
uni.redirectTo({
|
url: '/pages/ZLGL/AanDengHujiao/OA_ErrMsgBackCheckBill/OA_ErrMsgBackCheckBill?operationType=1'
|
})
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
setTimeout(() => {
|
uni.navigateBack();
|
}, 50)
|
}
|
}
|
});
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: '接口请求失败',
|
icon: 'none'
|
})
|
},
|
});
|
},
|
|
goBack() {
|
uni.navigateBack()
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
@import "@/pages/ZLGL/AanDengHujiao/style/OA_ErrMsgStyle.scss"
|
</style>
|