<template>
|
<view>
|
<view class="form">
|
<view class="tabs">
|
<view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">基本信息</view>
|
<view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">其他信息</view>
|
</view>
|
|
<view v-if="tabs == 0">
|
<view class="form-item">
|
<view class="title">模具条码</view>
|
<view class="right">
|
<input type="text" name="HBarCode" v-model="hform.HBarCode"
|
@confirm="getHBarCodeData(hform.HBarCode)" />
|
</view>
|
<uni-icons type="scan"
|
style="background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;flex-shrink: 0;"
|
size="20" @click="toScanCode"></uni-icons>
|
</view>
|
<view class="form-item" @click="searchModule">
|
<view class="title">器具</view>
|
<view class="righton" style="width: 350rpx;">
|
<input placeholder="请选择器具" />
|
</view>
|
<uni-icons type="search"
|
style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
|
size="20" ></uni-icons>
|
</view>
|
<view class="form-item">
|
<view class="title">源单类型</view>
|
<view class="right" v-show="showHMainSourceBillType">
|
<picker :range="arrayHMainSourceBillType"
|
@change="HMainSourceBillTypeChange">
|
|
<input disabled name="HMainSourceBillType" v-model="HMainSourceBillType"
|
placeholder="请选择源单类型" />
|
<view class="picker-overlay"></view>
|
</picker>
|
</view>
|
<view class="righton" v-show="!showHMainSourceBillType">
|
<input name="HMainSourceBillType" disabled v-model="HMainSourceBillType"
|
placeholder="请选择源单类型" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title required">故障登记单</view>
|
<view class="right" v-show="hform.HMainSourceBillType != 1">
|
<input type="text" name="HBarCode" v-model="hform.HMainSourceBillNo" />
|
</view>
|
<view class="icon-wrapper" v-show="hform.HMainSourceBillType != 1"
|
:disabled="hform.HMainSourceBillType == -1">
|
<uni-icons type="search" size="20" @click="showBillList"></uni-icons>
|
</view>
|
<view class="righton" v-show="hform.HMainSourceBillType == 1">
|
<input type="text" disabled name="HBarCode" v-model="hform.HMainSourceBillNo" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">维修开始</view>
|
<view class="right">
|
<uni-datetime-picker type="datetime" v-model="hform.HRepairBeginDate">
|
<view style="font-size: 30rpx;">{{hform.HRepairBeginDate}}</view>
|
</uni-datetime-picker>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">维修结束</view>
|
<view class="right">
|
<uni-datetime-picker type="datetime" v-model="hform.HRepairEndDate">
|
<view style="font-size: 30rpx;">{{hform.HRepairEndDate}}</view>
|
</uni-datetime-picker>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">维修受理日期</view>
|
<view class="right">
|
<uni-datetime-picker type="datetime" v-model="hform.HRepairAccepDate">
|
<view style="font-size: 30rpx;">{{hform.HRepairAccepDate}}</view>
|
</uni-datetime-picker>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">维修内容</view>
|
<view class="right">
|
<textarea v-model="hform.HRepairContent" style="height: 6em;" maxlength="2000"
|
placeholder="请输入维修内容..." />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title required">计划维修工时</view>
|
<view class="right">
|
<input type="number" name="HPlanTimes" v-model="hform.HPlanTimes"
|
@focus="hform.HPlanTimes = ''" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title required">实际维修工时</view>
|
<view class="right">
|
<input type="number" name="HTimes" v-model="hform.HTimes" @focus="hform.HTimes = ''" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">单据号</view>
|
<view class="righton">
|
<input name="HInterID" disabled v-model="hform.HBillNo" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">单据日期</view>
|
<view class="right">
|
<uni-datetime-picker type="datetime" v-model="hform.HDate">
|
<view style="font-size: 30rpx;">{{hform.HDate}}</view>
|
</uni-datetime-picker>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title required">部门</view>
|
<view class="right">
|
<uni-combox :candidates="DeptNameList" placeholder="请选择部门" v-model="hform.HDeptName"
|
@input="DeptChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title required">维修人</view>
|
<view class="right">
|
<uni-combox :candidates="EmpNameList" placeholder="请选择发现人" v-model="hform.HEmpName"
|
@input="EmpChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title required">负责人</view>
|
<view class="right">
|
<uni-combox :candidates="EmpNameList" placeholder="请选择负责人" v-model="hform.HManagerName"
|
@input="ManagerChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title required">维修项目</view>
|
<view class="right">
|
<uni-combox :candidates="RepairNameNameList" placeholder="请选择维修项目" v-model="hform.HRepairName"
|
@input="RepairNameChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">维修要求</view>
|
<view class="right">
|
<textarea v-model="hform.HExplanation" style="height: 6em;" maxlength="2000"
|
placeholder="请输入维修要求..." />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">供应商</view>
|
<view class="right">
|
<uni-combox :candidates="SupplierNameList" placeholder="请选择供应商" v-model="hform.HSupName"
|
@input="SupplierChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">维修类型</view>
|
<view class="right">
|
<picker :range="arrayRepairType" v-model="hform.HRepairType" @change="HRepairTypeChange">
|
|
<input disabled name="HRepairType" v-model="hform.HRepairType" placeholder="请选择维修类型" />
|
<view class="picker-overlay"></view>
|
</picker>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">维修后新规</view>
|
<view class="right">
|
<textarea v-model="hform.HNewModel" style="height: 6em;" maxlength="2000"
|
placeholder="请输入维修后新规..." />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">新设计寿命</view>
|
<view class="right">
|
<input v-model="hform.HNewDesignLife"
|
placeholder="请输入新设计寿命..." />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">器具名称</view>
|
<view class="righton">
|
<input disabled type="text" v-model="hform.HBarName" placeholder="请输入器具名称" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">器具规格</view>
|
<view class="righton">
|
<input disabled type="text" v-model="hform.HBarSpec" placeholder="请输入器具规格" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">器具型号</view>
|
<view class="righton">
|
<input disabled type="text" v-model="hform.HBarModel" placeholder="请输入器具型号" />
|
</view>
|
</view>
|
</view>
|
|
<view v-if="tabs == 1">
|
<view class="form-item">
|
<view class="title">创建人:</view>
|
<view class="righton">
|
<input type="text" v-model="hform.HMaker" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">创建日期:</view>
|
<view class="righton">
|
<input type="text" v-model="hform.HMakeDate" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">修改人:</view>
|
<view class="righton">
|
<input type="text" v-model="hform.HUpDater" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">修改日期:</view>
|
<view class="righton">
|
<input type="text" v-model="hform.HUpDateDate" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">审核人:</view>
|
<view class="righton">
|
<input type="text" v-model="hform.HChecker" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">审核日期:</view>
|
<view class="righton">
|
<input type="text" v-model="hform.HCheckDate" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">作废人:</view>
|
<view class="righton">
|
<input type="text" v-model="hform.HDeleteMan" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">作废日期:</view>
|
<view class="righton">
|
<input type="text" v-model="hform.HDeleteDate" disabled />
|
</view>
|
</view>
|
</view>
|
|
<view class="bottom-btn">
|
<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>
|
<BillListPopupMouldConkBookBillVue ref="billList" :HBillType="hform.HBillType"
|
:HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID">
|
</BillListPopupMouldConkBookBillVue>
|
<BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
|
<BillListPopupMouldVue @BillSelectComplete="MouldBillHandler" ref="billListMould"></BillListPopupMouldVue>
|
</view>
|
</template>
|
<script>
|
import getDateTime from '@/utils/getdateTime.js';
|
import {
|
getUserInfo
|
} from "@/utils/auth.js";
|
import {
|
CommonUtils
|
} from '../../../utils/common';
|
import {
|
getUserStockRelation
|
} from '../../../utils/userRelationManager';
|
import BillListPopupMouldConkBookBillVue from '../../../components/BillListPopup/BillListPopupMouldConkBookBill.vue';
|
import BarCodePopupVue from "../../../components/BarCodePopup/BarCodePopup.vue";
|
import BillListPopupMouldVue from '../../../components/BillListPopup/BillListPopup_Mould.vue';
|
import dayjs from 'dayjs';
|
export default {
|
components: {
|
BarCodePopupVue,
|
BillListPopupMouldConkBookBillVue,
|
BillListPopupMouldVue,
|
},
|
|
data() {
|
return {
|
HSourceBillNoFocus: false,
|
barCodeFocus: false,
|
|
userInfo: getUserInfo(),
|
serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
|
HModName: 'Kf_POStockInBackBill_PDA',
|
ModRightName: 'CE_POStockInBack',
|
OperationType: 1,
|
HInterID_Temp: '',
|
|
showHStockPlaceName: false,
|
showHMainSourceBillType: true,
|
showHSourceBillNo: true,
|
reHSourceBillNo: true,
|
showHSupName: true,
|
barCodeFocus: false,
|
|
tabs: 0,
|
HMainSourceBillType: '模具故障登记单',
|
arrayHMainSourceBillType: ['模具故障登记单'],
|
arrayHMainSourceBillTypeID: ['3815'],
|
arrayRepairType: ["内部维修", "委外维修"],
|
|
linterid: '',
|
HBillNo: '',
|
btnType: 0, //0新增,1修改,2审核,3反审核
|
showmore: false,
|
|
|
materMeta: [],
|
arrayHWHName: [], //仓库
|
HWHNameList: [],
|
arrayHStockPlaceName: [], //仓位
|
HStockPlaceNameList: [],
|
arrayHSourceBillNo: [], //源单单号
|
HSourceBillNoList: [],
|
|
// 供应商列表
|
SupplierNameList: [],
|
SupplierList: [],
|
// 部门列表
|
DeptNameList: [],
|
DeptList: [],
|
// 职员列表(同时作为发现人和负责人的可选择对象)
|
EmpNameList: [],
|
EmpList: [],
|
// 维修项目
|
RepairNameNameList: [],
|
RepairNameList: [],
|
|
Materlist: [],
|
hform: {
|
"HBillType": 3807,
|
"HBarCode": "",
|
"HMainSourceBillType": "1",
|
"HMainSourceBillNo": "",
|
"HMainSourceInterID": "0",
|
"HMainSourceEntryID": "0",
|
"XDHList": "",
|
"HRepairBeginDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
"HRepairEndDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
"HRepairAccepDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
"HRepairContent": "",
|
"HPlanTimes": "0",
|
"HTimes": "0",
|
"HBillNo": "",
|
"HInterID": "0",
|
"HDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
"HDeptName": getUserInfo()["HDeptName"],
|
"HDeptID": getUserInfo()["HDeptID"],
|
"HEmpName": getUserInfo().HEmpName,
|
"HEmpID": getUserInfo().HEmpID,
|
"HManagerName": getUserInfo().HSecManager,
|
"HManagerID": getUserInfo().HSecManagerID,
|
"HRepairName": "",
|
"HRepairID": "0",
|
"HRepairList": "",
|
"HExplanation": "",
|
"HSupName": "",
|
"HSupID": "0",
|
"HSupIDList": "",
|
"HRepairType": "内部维修",
|
"HNewModel": "",
|
"HNewDesignLife": "0",
|
"HBarName": "",
|
"HMouldID": "0",
|
"HBarSpec": "",
|
"HBarModel": "",
|
"HMaker": getUserInfo()['Czymc'],
|
"HMakeDate": dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
"HUpDater": "",
|
"HUpDateDate": "",
|
"HChecker": "",
|
"HCheckDate": "",
|
"HDeleteMan": "",
|
"HDeleteDate": "",
|
"toolbarDemo": "",
|
"xuhao": "",
|
"barDemo": "",
|
"lngBillKey": "",
|
"lngBillSubKey": "",
|
"HStockOrgID": uni.getStorageSync("OrganizationID")
|
|
}
|
}
|
},
|
computed: {},
|
onLoad(e) {
|
console.log(e, this.userInfo)
|
this.OperationType = e.OperationType
|
if (e.HInterID) {
|
this.HInterID_Temp = e.HInterID
|
// this.btnType = 1
|
this.RoadBillMain(e.HInterID)
|
this.barCodeFocus = true
|
} else {
|
this.getNewData()
|
this.HSourceBillNoFocus = true
|
}
|
|
this.InitDept()
|
this.InitEmp()
|
this.InitSupplier()
|
this.InitRepairName()
|
this.loadCache()
|
uni.$on('BillSelectComplete', (e) => {
|
console.log("接收到的消息: ", e)
|
this.hform.HMainSourceInterID = e.HInterID
|
this.hform.HMainSourceBillNo = e.HBillNo
|
this.hform.HMainSourceEntryID = e.HEntryID
|
this.hform.HMouldID = e.HMouldID
|
this.hform.HBarName = e.HMouldName
|
this.hform.HBarSpec = e.HMouldSpec
|
this.hform.HBarModel = e.HMouldModel
|
this.$refs.billList.exit()
|
})
|
},
|
onUnload() {
|
uni.$off('BillSelectComplete')
|
},
|
methods: {
|
searchModule() {
|
this.$refs['billListMould'].showPopup()
|
},
|
MouldBillHandler(mould) {
|
if(!mould.enableMultiSourceBill){
|
let val = mould.val[0]
|
this.hform.HBarCode = val['条码编号']
|
this.getHBarCodeData(this.hform.HBarCode)
|
}
|
this.$refs['billListMould'].exit()
|
},
|
// 维修项目
|
async InitRepairName() { // 初始化维修项目
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/PublicPageMethod/Gy_RepairList_PDA',
|
data: {
|
sWhere: ''
|
}
|
})
|
|
let {
|
count,
|
data,
|
code,
|
Message
|
} = res.data
|
if (count == 1) {
|
this.RepairNameList = data
|
this.RepairNameNameList = Array.from(data).map(elem => elem["HName"])
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: '维修项目初始化失败: ' + Message
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: '维修项目初始化失败: ' + err
|
})
|
}
|
},
|
RepairNameChange(elem) {
|
let index = this.RepairNameNameList.findIndex(e => e == elem)
|
|
if (index == -1) {
|
this.hform.HRepairName = ''
|
this.hform.HRepairID = 0
|
return
|
}
|
|
this.hform.HRepairName = this.RepairNameList[index]['HName']
|
this.hform.HRepairID = this.RepairNameList[index]['HItemID']
|
},
|
// 维修类型 更改 句柄
|
HRepairTypeChange(e) {
|
let index = e.detail.value
|
if (index == NaN || index == -1) {
|
this.hform.HRepairType = '内部维修'
|
return
|
}
|
this.hform.HRepairType = this.arrayRepairType[index]
|
},
|
// 供应商
|
async InitSupplier() { // 初始化供应商\
|
let HOtherOrgID = this.hform.HStockOrgID || 0
|
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/WEBSController/GetSupplierList_Json',
|
data: {
|
Supplier: '',
|
HStockOrgID: HOtherOrgID
|
}
|
})
|
|
let {
|
count,
|
data,
|
code,
|
Message
|
} = res.data
|
if (count == 1) {
|
this.SupplierList = data
|
this.SupplierNameList = Array.from(data).map(elem => elem["HName"])
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: '供应商初始化失败: ' + Message
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: '供应商初始化失败: ' + err
|
})
|
}
|
},
|
SupplierChange(elem) { // 供应商更改 句柄
|
let index = this.SupplierNameList.findIndex(e => e == elem)
|
|
if (index == -1) {
|
this.hform.HSupName = ''
|
this.hform.HSupID = 0
|
return
|
}
|
|
this.hform.HSupName = this.SupplierList[index]['HName']
|
this.hform.HSupID = this.SupplierList[index]['HItemID']
|
},
|
// 部门
|
async InitDept() { // 初始化部门
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/PublicPageMethod/DeptList',
|
data: {
|
sWhere: 'where 1=1',
|
}
|
})
|
let {
|
count,
|
code,
|
Message,
|
data
|
} = res.data
|
if (count == 1) {
|
this.DeptList = data
|
this.DeptNameList = Array.from(data).map(elem => elem['HName'])
|
} else {
|
CommonUtils.showTips({
|
title: '错误提示',
|
message: "初始化部门错误: " + Message,
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '错误提示',
|
message: "初始化部门错误: " + err,
|
})
|
}
|
},
|
DeptChange(elem) { // 部门改变 句柄
|
let index = this.DeptNameList.findIndex(e => e == elem)
|
|
if (index == -1) {
|
this.hform.HDeptName = ''
|
this.hform.HDeptID = 0
|
return
|
}
|
|
this.hform.HDeptName = this.DeptList[index]['HName']
|
this.hform.HDeptID = this.DeptList[index]['HItemID']
|
},
|
// 职员
|
async InitEmp() { // 初始化职员
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/Web/GetEmployeeList_Json',
|
data: {
|
Employee: '',
|
HGroupID: 0,
|
}
|
})
|
let {
|
count,
|
code,
|
Message,
|
data
|
} = res.data
|
if (count == 1) {
|
this.EmpList = data
|
this.EmpNameList = Array.from(data).map(elem => elem['HName'])
|
} else {
|
CommonUtils.showTips({
|
title: '错误提示',
|
message: "初始化职员错误: " + Message,
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '错误提示',
|
message: "初始化职员错误: " + err,
|
})
|
}
|
},
|
EmpChange(elem) { // 维修人更改
|
let index = this.EmpNameList.findIndex(e => e == elem)
|
|
if (index == -1) {
|
this.hform.HEmpName = ''
|
this.hform.HEmpID = 0
|
return
|
}
|
|
this.hform.HEmpName = this.EmpList[index]['HName']
|
this.hform.HEmpID = this.EmpList[index]['HItemID']
|
},
|
ManagerChange(elem) { // 负责人更改
|
let index = this.EmpNameList.findIndex(e => e == elem)
|
|
if (index == -1) {
|
this.hform.HManagerName = ''
|
this.hform.HManagerID = 0
|
return
|
}
|
|
this.hform.HManagerName = this.EmpList[index]['HName']
|
this.hform.HManagerID = this.EmpList[index]['HItemID']
|
},
|
|
|
async qrCodeDisplay() {
|
try {
|
this.$refs.barcodePopup.setCodeInfo(this.hform.HBillNo)
|
await this.$nextTick()
|
this.$refs.barcodePopup.open()
|
} catch (err) {
|
uni.showToast({
|
icon: 'none',
|
title: err
|
})
|
}
|
},
|
async getRelationStore() {
|
let {
|
data,
|
count
|
} = await getUserStockRelation()
|
if (count == 1) {
|
let WHIDList = []
|
|
Array.from(data).forEach(elem => {
|
WHIDList.push(elem.HItemID)
|
})
|
|
let sWhere = ` and HItemID in (${WHIDList.join(",")})`
|
this.getHBaseList({
|
sWhere: sWhere
|
})
|
|
} else {
|
this.getHBaseList()
|
}
|
},
|
showBillList() {
|
this.$refs.billList.showPopup()
|
},
|
async refreshHSourceBillState() {
|
this.HSourceBillNoFocus = false
|
await this.$nextTick(() => {
|
this.hform.HSourceBillNo = ""
|
this.HSourceBillNoFocus = true
|
|
})
|
},
|
async refreshBarCodeState() {
|
this.barCodeFocus = false
|
await this.$nextTick(() => {
|
this.hform.HBarCode = ""
|
this.barCodeFocus = true
|
})
|
},
|
playSound(e) {
|
const innerAudioContext = uni.createInnerAudioContext();
|
if (e == 1) {
|
innerAudioContext.src = '/static/success.wav';
|
} else {
|
innerAudioContext.src = '/static/jingbao.wav';
|
}
|
innerAudioContext.play(); // 播放音频
|
},
|
onSourceBillBlurHandler() {
|
if (this.hform.HMainSourceBillType == -1) {
|
CommonUtils.playSound(1)
|
this.barCodeFocus = true
|
return
|
}
|
let inputVal = ''
|
if (this.$refs.uniComboxSourceBill) {
|
inputVal = this.$refs.uniComboxSourceBill.inputVal || this.hform.HSourceBillNo
|
} else {
|
inputVal = this.hform.HSourceBillNo
|
}
|
if (inputVal == '') {
|
CommonUtils.playSound(0)
|
return uni.showToast({
|
icon: 'none',
|
Message: '源单单号不得为空...'
|
})
|
}
|
this.getHBarCodeData(inputVal)
|
},
|
//扫码
|
toScanCode() {
|
var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
|
mpaasScanModule.mpaasScan({
|
'hideAlbum': true,
|
'timeoutInterval': '10', //超时时间
|
'timeoutText': '未识别到二维码' //超时提醒
|
}, (ret) => {
|
console.log(ret.resp_result)
|
if (this.hform.HBarCode == '*') {
|
this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
|
} else {
|
this.hform.HBarCode = ret.resp_result
|
}
|
|
this.getHBarCodeData(this.hform.HBarCode)
|
})
|
},
|
//日期
|
HDateChange(e) {
|
console.log(e.detail.value)
|
this.hform.HDate = e.detail.value
|
},
|
//选择源单类型
|
HMainSourceBillTypeChange(e) {
|
if (e.detail.value == -1 || e.detail.value == NaN) {
|
this.HMainSourceBillType = '手工录入'
|
this.hform.HMainSourceBillType = -1
|
return
|
}
|
console.log(e.detail.value)
|
console.log(e)
|
this.HMainSourceBillType = this.arrayHMainSourceBillType[e.detail.value]
|
this.hform.HMainSourceBillType = this.arrayHMainSourceBillTypeID[e.detail.value]
|
const pages = getCurrentPages()
|
// 获取页面栈中的最后一个元素,也就是当前显示的页面
|
const currentPage = pages[pages.length - 1]
|
// 选择源单类型后 缓存当前页面选择
|
uni.setStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`, {
|
HSourceBillTypeName: this.HMainSourceBillType,
|
HSourceBillType: this.hform.HMainSourceBillType
|
})
|
},
|
// 读取缓存
|
loadCache() {
|
const pages = getCurrentPages()
|
// 获取页面栈中的最后一个元素,也就是当前显示的页面
|
const currentPage = pages[pages.length - 1]
|
let HBillTypeCache = uni.getStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`)
|
if (HBillTypeCache) {
|
this.HMainSourceBillType = HBillTypeCache.HSourceBillTypeName
|
this.hform.HMainSourceBillType = HBillTypeCache.HSourceBillType
|
}
|
},
|
// 扫描模具条码
|
async getHBarCodeData(HBarCode) {
|
if (!HBarCode) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: '条码不能为空'
|
})
|
return;
|
}
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/QJ_PDA_MouldDotCheckBill/txtHBarCode_KeyDown',
|
data: {
|
HBarCode: HBarCode
|
}
|
})
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
this.hform.HMouldID = data[0].HInterID;
|
this.hform.HBarName = data[0].HName;
|
this.hform.HBarSpec = data[0].HModels;
|
this.hform.HBarModel = data[0].HModel2;
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: Message
|
})
|
}
|
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: err
|
})
|
}
|
|
|
},
|
//物料信息
|
DisBillEntryList() {
|
uni.request({
|
url: this.serverUrl + '/WEBSController/GetBillEntryTmpList_Json',
|
data: {
|
HInterID: this.hform.HInterID,
|
HBillNo: this.hform.HBillNo,
|
HBillType: this.hform.HBillType,
|
HStockOrgID: this.hform.HStockOrgID
|
},
|
success: (res) => {
|
console.log('物料', res.data)
|
if (res.data.count == 1) {
|
var data = res.data.data
|
this.materMeta = data.BarCodeDetailslist
|
this.Materlist = data.Materlist
|
if (/兴达/.test(uni.getStorageSync("Organization"))) {
|
// 兴达客户 带出 仓库
|
console.log("兴达带出默认仓库")
|
this.HWHNameChange(data.BarCodeDetailslist[0].HWHName)
|
}
|
|
|
if (!data.BarCodeDetailslist[0].HBarCode) {
|
this.hform.HMaterName_B = ''
|
this.hform.HMaterModel_B = ''
|
this.hform.HBatchNo_B = ''
|
this.hform.HUnitName_B = ''
|
this.hform.HQty_B = ''
|
this.hform.HTMQty_B = ''
|
this.hform.HWHName_B = ''
|
this.hform.HSPName_B = ''
|
} else {
|
this.hform.HMaterName_B = data.BarCodeDetailslist[0].HMaterName
|
this.hform.HMaterModel_B = data.BarCodeDetailslist[0].HMaterModel
|
this.hform.HBatchNo_B = data.BarCodeDetailslist[0].HBatchNo
|
this.hform.HUnitName_B = data.BarCodeDetailslist[0].HUnitName
|
this.hform.HQty_B = data.BarCodeDetailslist[0].HQty
|
this.hform.HTMQty_B = data.BarCodeDetailslist[0].HTMQty
|
this.hform.HWHName_B = data.BarCodeDetailslist[0].HWHName
|
this.hform.HSPName_B = data.BarCodeDetailslist[0].HSPName
|
}
|
} else {
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: '接口请求失败',
|
icon: 'none'
|
})
|
},
|
});
|
},
|
//删除物料码
|
delMater(item) {
|
uni.showModal({
|
title: '提示',
|
content: '确认要删除 " ' + item.物料名称 + ' " 所有扫码记录?删除后将不可恢复!',
|
success: (res) => {
|
if (res.confirm) {
|
uni.request({
|
url: this.serverUrl +
|
'/WEBSController/set_DelPonderationBillMain_Temp_InterIDAndSource_Json',
|
data: {
|
HInterID: this.hform.HInterID,
|
HMaterID: item.HMaterID,
|
HAuxPropID: item.HAuxPropID,
|
HMTONo: item.HMTONo,
|
HSourceInterID: item.HSourceInterID,
|
HSourceEntryID: item.HSourceEntryID,
|
HBillType: this.hform.HBillType
|
},
|
success: (res) => {
|
if (res.data.count == 1) {
|
this.DisBillEntryList()
|
} else {
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: '接口请求失败',
|
icon: 'none'
|
})
|
},
|
});
|
}
|
}
|
});
|
},
|
// 新增回调
|
addNew() {
|
uni.redirectTo({
|
url: '/pages/weixiujilu/mouldRepairRecordBill?OperationType=1'
|
})
|
},
|
//新增
|
getNewData() {
|
uni.request({
|
url: this.serverUrl + '/Web/GetMAXNum',
|
data: {
|
HBillType: this.hform.HBillType
|
},
|
success: (res) => {
|
// console.log(res.data)
|
if (res.data.count == 1) {
|
this.hform.HInterID = 0
|
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'
|
})
|
},
|
});
|
},
|
//修改回填数据
|
RoadBillMain(HInterID) {
|
uni.request({
|
url: this.serverUrl + '/WEBSController/GetSourceBill_Temp_Json',
|
data: {
|
HInterID: HInterID,
|
HBillType: this.hform.HBillType
|
},
|
success: (res) => {
|
console.log(33, res.data.data[0]);
|
if (res.data.count == 1) {
|
var data = res.data.data[0]
|
this.hform.HInterID = data.HInterID
|
this.hform.HBillNo = data.HBillNo
|
this.hform.HMainSourceBillType = data.HSourceBillType
|
this.hform.HSourceBillNo = data.HSourceBillNo
|
if (data.HSourceBillType == 1105) {
|
this.hform.HMainSourceBillType = 1105
|
this.HMainSourceBillType = '退料通知单'
|
this.showHSupName = false
|
} else if (data.HSourceBillType == 1102) {
|
this.hform.HMainSourceBillType = 1102
|
this.HMainSourceBillType = '采购订单'
|
this.showHSupName = false
|
} else if (data.HSourceBillType == 1201) {
|
this.hform.HMainSourceBillType = 1201
|
this.HMainSourceBillType = '采购入库单'
|
this.showHSupName = false
|
} else {
|
this.hform.HMainSourceBillType = -1
|
this.HMainSourceBillType = '手工录入'
|
}
|
this.showHMainSourceBillType = false
|
|
//非多源单模式
|
if (data.HMulSourceBill == 0) {
|
this.showHSourceBillNo = false
|
}
|
this.hform.HDeptID = data.HDeptID
|
this.hform.HDeptName = data.HDeptName
|
this.hform.HSupID = data.HCusID
|
this.hform.HSupName = data.HSupName
|
this.DisBillEntryList()
|
this.tabs = 2
|
} else {
|
uni.showToast({
|
title: '获取数据回填失败',
|
icon: 'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title: '接口请求失败',
|
icon: 'none'
|
})
|
},
|
});
|
},
|
checkBillValidate() {
|
let message = ''
|
|
if (!this.hform.HMainSourceBillNo && this.hform.HMainSourceBillType != '1') {
|
message = '未填写故障登记单'
|
} else if (!this.hform.HDeptName) {
|
message = '未填写部门'
|
} else if (!this.hform.HEmpName) {
|
message = '未填写维修人人'
|
} else if (!this.hform.HManagerName) {
|
message = '未填写负责人'
|
} else if (!this.hform.HRepairName) {
|
message = '未填写维修项目'
|
}
|
|
if (!message) {
|
return true
|
}
|
|
CommonUtils.showTips({
|
message: message
|
})
|
return false
|
},
|
async submit() {
|
if (!this.checkBillValidate()) {
|
return
|
}
|
let oMain = JSON.stringify(this.hform)
|
let sSubStr = JSON.stringify(
|
[{
|
"HRepairID": this.hform.HRepairID,
|
"HRepairCode": "",
|
"HRepairName": "",
|
"HManagerID": this.hform.HManagerID,
|
"HManagerCode": "",
|
"HManagerName": "",
|
"HRepairExplanation": this.hform.HExplanation,
|
"HRemark": "",
|
"HMoney": 0,
|
"HSourceInterID": this.hform.HMainSourceInterID,
|
"HSourceEntryID": this.hform.HMainSourceEntryID,
|
"HSourceBillNo": this.hform.HMainSourceBillNo
|
}]
|
)
|
let sMainSub = `${oMain};${sSubStr};${getUserInfo()["Czymc"]};`
|
try {
|
let res = await CommonUtils.doRequest2Sync({
|
url: '/Sb_MouldRepairWorkBill/SaveGetMouldRepairWorkBill_PDA',
|
data: {
|
"msg": sMainSub
|
},
|
method: 'POST'
|
})
|
|
if (!res) {
|
return
|
}
|
let {
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
uni.showModal({
|
title: '提示',
|
content: res.data.Message + '。是否继续新增?',
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
uni.redirectTo({
|
url: '/pages/MJGL/Sc_MouldRepairWorkBill/Sc_MouldRepairWorkBill?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
|
})
|
this.EnableSave = true
|
}
|
},
|
|
goBack() {
|
uni.showModal({
|
title: '提示',
|
content: '确认要退出当前页面吗?',
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
uni.navigateBack()
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
}
|
}
|
});
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.page {
|
height: auto;
|
}
|
|
.form {
|
width: 668rpx;
|
padding: 0rpx 20rpx;
|
padding-bottom: 240rpx;
|
}
|
|
.tab_area {
|
width: 100%;
|
height: 50rpx;
|
}
|
|
.other {
|
margin-top: 8rpx;
|
text-align: center;
|
font-size: 28rpx;
|
padding: 4rpx 18rpx;
|
color: #1890FF;
|
}
|
|
.tabs {
|
width: 100%;
|
display: flex;
|
border-bottom: 1px solid #ddd;
|
margin: 20rpx 0;
|
|
view {
|
width: 25%;
|
font-size: 30rpx;
|
color: #555;
|
text-align: center;
|
padding: 16rpx 0;
|
}
|
|
.on {
|
color: #3a78ff;
|
font-weight: bold;
|
border-bottom: 3px solid #3a78ff;
|
}
|
}
|
|
.form-item {
|
display: flex;
|
align-items: center;
|
font-size: inherit;
|
padding: 6rpx 0;
|
gap: 12rpx;
|
|
.title {
|
width: 200rpx;
|
font-size: 30rpx;
|
|
text {
|
color: red;
|
font-weight: bold;
|
}
|
}
|
|
.right {
|
flex: 1;
|
border-radius: 22rpx;
|
border: 1px solid #acacac;
|
position: relative;
|
padding: 8rpx 16rpx;
|
display: flex;
|
|
picker {
|
width: 100%;
|
}
|
|
.uni-combox {
|
width: 100%;
|
padding: 0;
|
|
::v-deep .uni-combox__input {
|
font-size: 30rpx;
|
height: auto;
|
}
|
}
|
}
|
|
.righton {
|
flex: 1;
|
border-radius: 22rpx;
|
border: 1px solid #e4e4e4;
|
background-color: #e4e4e4;
|
padding: 8rpx 16rpx;
|
}
|
|
input {
|
width: 100%;
|
font-size: 30rpx;
|
}
|
|
textarea {
|
width: 98%;
|
font-size: 30rpx;
|
}
|
|
}
|
|
.bottom-btn {
|
width: 100%;
|
box-sizing: border-box;
|
// height: 120rpx;
|
position: fixed;
|
bottom: 0;
|
left: 0;
|
background-color: #fff;
|
box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
|
padding: 30rpx 40rpx 40rpx 40rpx;
|
display: flex;
|
flex-direction: row;
|
gap: 10rpx;
|
|
button {
|
border-radius: 50rpx;
|
width: 180rpx;
|
height: 66rpx;
|
line-height: 66rpx;
|
font-size: 28rpx;
|
}
|
|
.btn-a {
|
background-color: #3A78FF;
|
color: #fff;
|
}
|
|
.btn-b {
|
background-color: #41a863;
|
color: #fff;
|
}
|
|
.btn-c {
|
background-color: #acacac;
|
color: #fff;
|
// position: absolute;
|
// right: 120rpx;
|
}
|
|
.btn-d {
|
background-color: #ff8901;
|
color: #fff;
|
}
|
}
|
|
.list {
|
width: 100%;
|
|
.card-detail {
|
width: 100%;
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
line-height: 120%;
|
|
.detail {
|
// width: 50%;
|
font-size: 26rpx;
|
margin-bottom: 12rpx;
|
color: #555;
|
margin-right: 20rpx;
|
|
text {
|
color: #999;
|
font-size: 26rpx;
|
}
|
}
|
}
|
|
.more {
|
color: #888;
|
font-size: 24rpx;
|
display: flex;
|
border-top: 1px solid #eee;
|
padding-top: 20rpx;
|
|
.part {
|
width: 50%;
|
text-align: center;
|
}
|
}
|
}
|
|
.icon-wrapper {
|
background-color: #3A78FF;
|
width: 52rpx;
|
height: 52rpx;
|
border-radius: 100%;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
|
.uni-icons {
|
color: #fff !important;
|
}
|
}
|
|
.required {
|
position: relative;
|
|
}
|
|
.required::after {
|
content: "*";
|
position: relative;
|
color: red;
|
left: 0;
|
top: 0;
|
font-size: inherit;
|
}
|
|
.icon-wrapper[disabled] {
|
background-color: rgba(228, 228, 228, 1);
|
pointer-events: none;
|
touch-action: none;
|
}
|
</style>
|