init project
This commit is contained in:
88
pages/tpmMould/eqpWithMouldHistory.vue
Normal file
88
pages/tpmMould/eqpWithMouldHistory.vue
Normal file
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData">
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput v-model="formData.equipmentCode" suffixIcon="scan" @iconClick="scanBarEquipmentCode"
|
||||
@confirm="confirmEquipmentCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-collapse-item title="查询结果" :open="true">
|
||||
<uni-card :is-shadow="false" v-for="(item,index) in useRecordList" :key="index" is-full>
|
||||
<view><strong>模具编码</strong> : {{item.mouldUuid}}</view>
|
||||
<view><strong>模具名称</strong> : {{item.mouldName}}</view>
|
||||
<view><strong>设备编码</strong> : {{item.equipmentCode}}</view>
|
||||
<view><strong>设备名称</strong> : {{item.equipmentTitle}}</view>
|
||||
<view><strong>上机时间</strong> : {{item.installTime}}</view>
|
||||
<view><strong>下机时间</strong> : {{item.removeTime}}</view>
|
||||
<view><strong>安装员编码</strong> : {{item.installBy}}</view>
|
||||
<view><strong>安装员</strong> : {{item.installByName}}</view>
|
||||
<view><strong>拆卸员编码</strong> : {{item.removeBy}}</view>
|
||||
<view><strong>拆卸员</strong> : {{item.removeByName}}</view>
|
||||
<view><strong>操作员编码</strong> : {{item.operator}}</view>
|
||||
<view><strong>操作员</strong> : {{item.operatorName}}</view>
|
||||
<view><strong>创建人</strong> : {{item.createBy}}</view>
|
||||
<view><strong>创建时间</strong> : {{item.createTime}}</view>
|
||||
<view><strong>修改人</strong> : {{item.updateBy}}</view>
|
||||
<view><strong>修改时间</strong> : {{item.updateTime}}</view>
|
||||
<view><strong>备注</strong> : {{item.remark}}</view>
|
||||
</uni-card>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listUseRecord,
|
||||
getUseRecord,
|
||||
delUseRecord,
|
||||
addUseRecord,
|
||||
updateUseRecord,
|
||||
bindMould,
|
||||
unbindMould,
|
||||
} from "@/api/tpmMould/useRecord";
|
||||
export default {
|
||||
mounted() {},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
equipmentCode: null
|
||||
},
|
||||
useRecordList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
scanBarEquipmentCode(code) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.equipmentCode = res.result;
|
||||
_this.confirmEquipmentCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmEquipmentCode() {
|
||||
if (this.formData.equipmentCode) {
|
||||
listUseRecord({
|
||||
equipmentCode: this.formData.equipmentCode
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.useRecordList = res.rows;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该设备上模相关信息,请重新输入!")
|
||||
this.formData.equipmentCode = null;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.text {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
244
pages/tpmMould/mouldEnd.vue
Normal file
244
pages/tpmMould/mouldEnd.vue
Normal file
@@ -0,0 +1,244 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :model="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarEquipmentCode" @confirm="confirmEquipmentCode"
|
||||
v-model="formData.equipmentCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备名称" :labelWidth='90' name="equipmentTitle">
|
||||
{{formData.equipmentTitle}}
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="模具编码" :labelWidth='90' name="mouldUuid">
|
||||
{{formData.mouldUuid}}
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="模具名称" :labelWidth='90' name="mouldName">
|
||||
{{formData.mouldName}}
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="库位" :labelWidth='90' name="storageLocationBarcode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarStorageLocationBarcode"
|
||||
v-model="formData.storageLocationBarcode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="拆卸员" :labelWidth='90' name="removeBy">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarRemoveBy" @confirm="confirmRemoveBy"
|
||||
v-model="formData.removeBy" type="text" style="margin-bottom: 10px;" />
|
||||
<uni-data-select v-model="formData.removeBy" :localdata="empList" />
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="操作员" :labelWidth='90' name="operator">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarOperator" @confirm="confirmOperator"
|
||||
v-model="formData.operator" type="text" style="margin-bottom: 10px;" />
|
||||
<uni-data-select v-model="formData.operator" :localdata="empList" />
|
||||
</uni-forms-item> -->
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listUseRecord,
|
||||
getUseRecord,
|
||||
delUseRecord,
|
||||
addUseRecord,
|
||||
updateUseRecord,
|
||||
bindMould,
|
||||
unbindMould,
|
||||
startRemove,
|
||||
listUseRecordAvailable
|
||||
} from "@/api/tpmMould/useRecord";
|
||||
import {
|
||||
listMould,
|
||||
updateMould
|
||||
} from "@/api/tpmMould/mould";
|
||||
import {
|
||||
listEquipment
|
||||
} from "@/api/mes/jobReport";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
mouldUuid: null,
|
||||
mouldName: null,
|
||||
equipmentCode: null,
|
||||
equipmentTitle: null,
|
||||
storageLocationBarcode: null,
|
||||
removeBy: null,
|
||||
operator: null
|
||||
},
|
||||
empList: [],
|
||||
rules: {
|
||||
equipmentCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入设备编码!',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: '^[A-Z0-9]+$',
|
||||
errorMessage: '请输入正确格式的设备编码!',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]
|
||||
},
|
||||
mouldUuid: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入模具编码!'
|
||||
}]
|
||||
},
|
||||
removeBy: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入拆卸员!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
listEmployee().then((res) => {
|
||||
this.empList = res.rows.map(item => {
|
||||
return {
|
||||
text: item.empCode + ':' + item.name,
|
||||
value: item.empCode,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
//扫描模具编码带出模具信息
|
||||
confirmMouldUuid() {
|
||||
if (this.formData.mouldUuid) {}
|
||||
},
|
||||
//扫描设备编码带出设备信息
|
||||
confirmEquipmentCode() {
|
||||
if (this.formData.equipmentCode) {
|
||||
listUseRecordAvailable({
|
||||
equipmentCode: this.formData.equipmentCode,
|
||||
searchType: '3'
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
listMould({
|
||||
mouldUuid: res.rows[0].mouldUuid
|
||||
}).then(resp => {
|
||||
if (resp.rows.length > 0) {
|
||||
res.rows[0].storageLocationBarcode = resp.rows[0]
|
||||
.storageLocationBarcode;
|
||||
res.rows[0].mouldId = resp.rows[0].id
|
||||
this.formData = res.rows[0]
|
||||
} else {
|
||||
this.$modal.msg("未查询到该模具,请重新输入!")
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
this.$modal.msg("未查询到可下模开始的记录,请重新输入!")
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
scanBarMouldUuid() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.mouldUuid = res.result;
|
||||
_this.confirmMouldUuid()
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarEquipmentCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.equipmentCode = res.result;
|
||||
_this.confirmEquipmentCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarRemoveBy() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.removeBy = res.result;
|
||||
_this.confirmRemoveBy()
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarOperator() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.operator = res.result;
|
||||
_this.confirmOperator()
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarStorageLocationBarcode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.storageLocationBarcode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmOperator() {
|
||||
listEmployee({
|
||||
empCode: this.formData.operator
|
||||
}).then(async res => {
|
||||
if (res.rows.length == 0) {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
this.formData.operator = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
confirmRemoveBy() {
|
||||
listEmployee({
|
||||
empCode: this.formData.removeBy
|
||||
}).then(async res => {
|
||||
if (res.rows.length == 0) {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
this.formData.removeBy = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(async res => {
|
||||
console.log(this.formData)
|
||||
if (this.formData.id) {
|
||||
if (this.formData.removeBy == "") this.formData.removeBy = null;
|
||||
if (this.formData.operator == "") this.formData.operator = null;
|
||||
this.$modal.loading('提交中')
|
||||
startRemove(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("模具下机成功!")
|
||||
updateMould({
|
||||
id: this.formData.mouldId,
|
||||
storageLocationBarcode: this.formData.storageLocationBarcode
|
||||
}).then(res => {
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("未查询到可下模开始的记录,请重新输入!")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
144
pages/tpmMould/mouldEndFinish.vue
Normal file
144
pages/tpmMould/mouldEndFinish.vue
Normal file
@@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :model="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarEquipmentCode" @change="confirmEquipmentCode"
|
||||
v-model="formData.equipmentCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备名称" :labelWidth='90' name="equipmentTitle">
|
||||
{{formData.equipmentTitle}}
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="模具编码" :labelWidth='90' name="mouldUuid">
|
||||
<uni-data-select v-model="formData.mouldUuid" :localdata="mouldList" @change="clickDetail(mouldList[formData.mouldUuid])" />
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="模具名称" :labelWidth='90' name="mouldName">
|
||||
{{formData.mouldName}}
|
||||
</uni-forms-item> -->
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listUseRecord,
|
||||
getUseRecord,
|
||||
delUseRecord,
|
||||
addUseRecord,
|
||||
updateUseRecord,
|
||||
bindMould,
|
||||
unbindMould,
|
||||
listUseRecordAvailable,
|
||||
endRemove
|
||||
} from "@/api/tpmMould/useRecord";
|
||||
import {
|
||||
listMould
|
||||
} from "@/api/tpmMould/mould";
|
||||
import {
|
||||
listEquipment
|
||||
} from "@/api/mes/jobReport";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
mouldUuid: 0,
|
||||
mouldName: null,
|
||||
equipmentCode: null,
|
||||
equipmentTitle: null,
|
||||
index:1,
|
||||
},
|
||||
mouldList: [],
|
||||
rules: {
|
||||
equipmentCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入设备编码!',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: '^[A-Z0-9]+$',
|
||||
errorMessage: '请输入正确格式的设备编码!',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]
|
||||
},
|
||||
mouldUuid: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入模具编码!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
clickDetail(e) {
|
||||
|
||||
this.id = e.id
|
||||
},
|
||||
//扫描设备编码带出设备信息
|
||||
confirmEquipmentCode() {
|
||||
if (this.formData.equipmentCode) {
|
||||
listEquipment({
|
||||
equipmentCode: this.formData.equipmentCode
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.equipmentTitle = res.rows[0].equipmentTitle
|
||||
} else {
|
||||
this.$modal.msg("未查询到该设备,请重新输入!")
|
||||
}
|
||||
})
|
||||
listUseRecordAvailable({
|
||||
equipmentCode: this.formData.equipmentCode,
|
||||
searchType: '4'
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
|
||||
this.mouldList = res.rows.map((item,index) => {
|
||||
item.text = item.mouldUuid + ':' + item.mouldName;
|
||||
item.value = index;
|
||||
item.diasble = false;
|
||||
item.index = index;
|
||||
return item
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("未查询到可下模完成的记录,请重新输入!")
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
scanBarEquipmentCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.equipmentCode = res.result;
|
||||
_this.confirmEquipmentCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(async res => {
|
||||
this.$modal.loading('提交中')
|
||||
endRemove([this.id]).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("下模完成成功!")
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
146
pages/tpmMould/mouldQuery.vue
Normal file
146
pages/tpmMould/mouldQuery.vue
Normal file
@@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData">
|
||||
<uni-forms-item label="模具编码" :labelWidth='90' name="mouldUuid">
|
||||
<uni-easyinput v-model="formData.mouldUuid" suffixIcon="scan" @iconClick="scanBarMouldUuid"
|
||||
@confirm="confirmMouldUuid" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-collapse-item title="查询结果" :open="true">
|
||||
<uni-card :is-shadow="false" v-for="(item,index) in mouldList" :key="index" is-full>
|
||||
<view><strong>模具编码</strong> : {{item.mouldUuid}}</view>
|
||||
<view><strong>模具名称</strong> : {{item.mouldName}}</view>
|
||||
<view><strong>型号编码</strong> : {{item.mouldCode}}</view>
|
||||
<view><strong>所属部门名</strong> : {{item.departmentName}}</view>
|
||||
<view><strong>材质</strong> : {{item.material}}</view>
|
||||
<view><strong>库位编码</strong> : {{item.storageLocationBarcode}}</view>
|
||||
<view><strong>模穴数</strong> : {{item.cavityNumber}}</view>
|
||||
<view><strong>状态</strong> : <uni-tag :text="tagText(item.status)" :type="tagType(item.status)"
|
||||
v-if="item.status"></uni-tag></view>
|
||||
<view><strong>上次保养</strong> : {{item.lastMaintainTime}}</view>
|
||||
<view><strong>上次维修</strong> : {{item.lastFixTime}}</view>
|
||||
<view><strong>使用次数</strong> : {{item.useCount + "/"+item.useCountAfterFix}}</view>
|
||||
<view><strong>使用时间(分)</strong> : {{item.useTime+"/"+item.useTimeAfterFix}}</view>
|
||||
<view><strong>备注</strong> : {{item.remark}}</view>
|
||||
<view><strong>所在设备</strong> :
|
||||
{{item.equipmentCode?(item.equipmentCode+':'+item.equipmentTitle):''}}
|
||||
</view>
|
||||
</uni-card>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listUseRecord,
|
||||
getUseRecord,
|
||||
delUseRecord,
|
||||
addUseRecord,
|
||||
updateUseRecord,
|
||||
bindMould,
|
||||
unbindMould,
|
||||
} from "@/api/tpmMould/useRecord";
|
||||
import {
|
||||
listMould
|
||||
} from "@/api/tpmMould/mould";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
export default {
|
||||
mounted() {
|
||||
getDicts("tpm_mould_status").then(res => {
|
||||
this.mouldStatusOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mouldStatusOptions: [],
|
||||
formData: {
|
||||
mouldUuid: null
|
||||
},
|
||||
mouldList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tagText(status) {
|
||||
let obj = this.mouldStatusOptions.find(item => item.value == status)
|
||||
if (obj !== undefined) {
|
||||
return this.mouldStatusOptions.find(item => item.value == status).text
|
||||
}
|
||||
},
|
||||
tagType(status) {
|
||||
let obj = this.mouldStatusOptions.find(item => item.value == status)
|
||||
if (obj !== undefined) {
|
||||
switch (obj.text) {
|
||||
case '维修':
|
||||
return 'warning';
|
||||
break;
|
||||
case '空闲':
|
||||
return 'primary';
|
||||
break;
|
||||
case '使用中':
|
||||
return 'success';
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
scanBarMouldUuid(code) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.mouldUuid = res.result;
|
||||
_this.confirmMouldUuid()
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmMouldUuid() {
|
||||
if (this.formData.mouldUuid) {
|
||||
listMould({
|
||||
mouldUuid: this.formData.mouldUuid
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
listUseRecord({
|
||||
mouldUuid: this.formData.mouldUuid,
|
||||
removeTime: null
|
||||
}).then(resp => {
|
||||
if (resp.rows.length > 0) {
|
||||
let array = resp.rows.filter(item => item.removeTime ==
|
||||
null)
|
||||
if (array.length > 0) {
|
||||
res.rows[0].equipmentCode = array[0]
|
||||
.equipmentCode;
|
||||
res.rows[0].equipmentTitle = array[0]
|
||||
.equipmentTitle;
|
||||
}
|
||||
this.mouldList = res.rows;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该实例相关信息,请重新输入!")
|
||||
this.formData.mouldUuid = null;
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("未查询到该实例相关信息,请重新输入!")
|
||||
this.formData.mouldUuid = null;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.text {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
294
pages/tpmMould/mouldRepairTaskAdd.vue
Normal file
294
pages/tpmMould/mouldRepairTaskAdd.vue
Normal file
@@ -0,0 +1,294 @@
|
||||
<template>
|
||||
<view style="background-color: #fff;">
|
||||
<!-- <uni-collapse> -->
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<!-- <uni-collapse-item title="新增模具维修" :open="true"> -->
|
||||
<uni-forms-item label="任务号" :labelWidth='90' name="taskCode">
|
||||
<uni-easyinput type="text" disabled v-model="formData.taskCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="任务名" :labelWidth='90' name="taskName">
|
||||
<uni-easyinput type="text" v-model="formData.taskName" disabled />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="类型" :labelWidth='90' name="type" v-if="!formData.taskId">
|
||||
<uni-data-select v-model="formData.type" :localdata="repairTypeOptions" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="状态" :labelWidth='90' name="status">
|
||||
<u-radio-group v-model="formData.status" placement="row">
|
||||
<u-radio v-for="(item, index) in taskStatusOptions" :key="index" :label="item.text"
|
||||
:name="item.value">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="模具编码" :labelWidth='90' name="mouldUuid">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarMouldUuid" v-model="formData.mouldUuid" type="text"
|
||||
@confirm="confirmMouldUuid" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="模具名称" :labelWidth='90' name="mouldName">
|
||||
{{formData.mouldName}}
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="备注" :labelWidth='90' name="remark">
|
||||
<uni-easyinput v-model="formData.remark" type="text" />
|
||||
</uni-forms-item>
|
||||
<u-divider :text="'新增故障'" v-if="formData.taskId"></u-divider>
|
||||
<view v-if="formData.taskId">
|
||||
<uni-forms-item label="故障号" :labelWidth='90' name="breakdownCode">
|
||||
<uni-easyinput v-model="formData.breakdownCode" disabled type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="故障名" :labelWidth='90' name="breakdownName">
|
||||
<uni-easyinput v-model="formData.breakdownName" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="故障类型" :labelWidth='90' name="type" v-if="formData.taskId">
|
||||
<uni-data-select v-model="formData.type" :localdata="breakdownTypeOptions" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="维修人" :labelWidth='90' name="operatorCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarOperatorCode" @confirm="confirmOperatorCode"
|
||||
v-model="formData.operatorCode" type="text" style="margin-bottom: 10px;" />
|
||||
<uni-data-select v-model="formData.operatorCode" :localdata="empList" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<!-- </uni-collapse-item> -->
|
||||
</uni-forms>
|
||||
<!-- </uni-collapse> -->
|
||||
<u-button type="success" v-if="!formData.taskId" @click="taskSubmit">新建任务</u-button>
|
||||
<u-button type="primary" v-if="formData.taskId" @click="breakSubmit">新建故障</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMould
|
||||
} from "@/api/tpmMould/mould";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import {
|
||||
listRepairTask,
|
||||
getRepairTask,
|
||||
delRepairTask,
|
||||
addRepairTask,
|
||||
updateRepairTask,
|
||||
finishRepairTask,
|
||||
} from "@/api/tpmMould/repairTask";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn";
|
||||
import {
|
||||
listBreakdown,
|
||||
getBreakdown,
|
||||
delBreakdown,
|
||||
addBreakdown,
|
||||
updateBreakdown,
|
||||
finishBreakdown
|
||||
} from "@/api/tpmMould/breakdown";
|
||||
export default {
|
||||
mounted() {
|
||||
getDicts("tpm_repair_type").then(res => {
|
||||
this.repairTypeOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
getDicts("tpm_task_status").then(res => {
|
||||
this.taskStatusOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
getDicts("tpm_breakdown_type").then(res => {
|
||||
this.breakdownTypeOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
listEmployee().then((res) => {
|
||||
|
||||
this.empList = res.rows.map(item => {
|
||||
item.text = item.empCode + ':' + item.name
|
||||
item.value = item.empCode
|
||||
return item
|
||||
});
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
empList: [],
|
||||
repairTypeOptions: [],
|
||||
breakdownTypeOptions: [],
|
||||
taskStatusOptions: [],
|
||||
formData: {
|
||||
taskCode: null,
|
||||
taskName: "模具维修",
|
||||
type: null,
|
||||
status: "0",
|
||||
mouldUuid: null,
|
||||
mouldName: null,
|
||||
remark: null,
|
||||
breakdownCode: null,
|
||||
breakdownName: null,
|
||||
operatorId: null,
|
||||
operatorCode: null,
|
||||
mouldId: null,
|
||||
taskId: null,
|
||||
taskType: null
|
||||
},
|
||||
rules: {
|
||||
// saleOutTaskCode: {
|
||||
// rules: [{
|
||||
// required: true,
|
||||
// errorMessage: '请输入销售出库任务单!'
|
||||
// }]
|
||||
// },
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
deleteDetail(index) {
|
||||
this.formData.wmsSaleOutDetailList.splice(index, 1);
|
||||
},
|
||||
clickDetail(itemIndex, {
|
||||
position,
|
||||
index
|
||||
}) {
|
||||
if (index == 0) {
|
||||
this.deleteDetail(itemIndex);
|
||||
}
|
||||
},
|
||||
//扫描模具编码带出模具信息
|
||||
confirmMouldUuid() {
|
||||
if (this.formData.mouldUuid) {
|
||||
listMould({
|
||||
mouldUuid: this.formData.mouldUuid
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.mouldId = res.rows[0].id
|
||||
this.formData.mouldName = res.rows[0].mouldName
|
||||
} else {
|
||||
this.$modal.msg("未查询到该模具,请重新输入!")
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
scanBarMouldUuid() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.mouldUuid = res.result;
|
||||
_this.confirmMouldUuid()
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarOperatorCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.operatorCode = res.result;
|
||||
_this.confirmOperatorCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmOperatorCode() {
|
||||
listEmployee({
|
||||
empCode: this.formData.operatorCode
|
||||
}).then(async res => {
|
||||
if (res.rows.length == 0) {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
this.formData.operatorCode = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
taskSubmit() {
|
||||
const _this = this;
|
||||
this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定新建该任务吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log(_this.formData)
|
||||
if (_this.formData.taskName == null || _this.formData.taskName == "") {
|
||||
_this.$modal.msg("任务名不得为空,请输入!")
|
||||
} else {
|
||||
_this.$modal.loading('提交中')
|
||||
addRepairTask(_this.formData).then(async res => {
|
||||
let obj = res.mouldRepairTask
|
||||
_this.formData.taskId = obj.id;
|
||||
_this.formData.taskCode = obj.taskCode;
|
||||
_this.formData.taskType = obj.type;
|
||||
_this.$modal.msgSuccess("新建任务成功!");
|
||||
_this.$modal.closeLoading();
|
||||
});
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
breakSubmit() {
|
||||
const _this = this;
|
||||
this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定新建该故障吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
if (_this.formData.breakdownName == null || _this.formData
|
||||
.breakdownName == "") {
|
||||
_this.$modal.msg("故障名不得为空,请输入!")
|
||||
} else {
|
||||
let obj = _this.empList.find(item => _this.formData.operatorCode ==
|
||||
item.value)
|
||||
if (obj !== undefined) {
|
||||
_this.formData.operatorId = obj.id
|
||||
}
|
||||
console.log(_this.formData)
|
||||
_this.$modal.loading('提交中')
|
||||
addBreakdown(_this.formData).then(async res => {
|
||||
_this.$modal.msgSuccess("新建故障成功!");
|
||||
_this.$modal.closeLoading();
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab(
|
||||
"/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.divider {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
height: 1px;
|
||||
background-color: #F1F1F1;
|
||||
}
|
||||
|
||||
.divider span {
|
||||
padding: 5px;
|
||||
|
||||
}
|
||||
</style>
|
||||
168
pages/tpmMould/mouldRepairTaskList.vue
Normal file
168
pages/tpmMould/mouldRepairTaskList.vue
Normal file
@@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData">
|
||||
<uni-forms-item label="模具编码" :labelWidth='90' name="mouldUuid">
|
||||
<uni-easyinput v-model="formData.mouldUuid" suffixIcon="scan" @iconClick="scanBarMouldUuid"
|
||||
@confirm="submit" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="状态" :labelWidth='90' name="status">
|
||||
<u-radio-group v-model="formData.status" placement="row">
|
||||
<u-radio v-for="(item, index) in taskStatusOptions" :key="index" :label="item.text"
|
||||
:name="item.value">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</uni-forms-item>
|
||||
<u-button type="primary" @click="submit">查询</u-button>
|
||||
<uni-collapse-item title="查询结果" :open="true">
|
||||
<uni-card :is-shadow="false" v-for="(item,index) in breakdownList" :key="index" is-full>
|
||||
<view><strong>任务编码</strong> : {{item.taskCode}}</view>
|
||||
<view><strong>任务名称</strong> : {{item.taskName}}</view>
|
||||
<view><strong>任务类型</strong> : <uni-tag :text="taskText(item.taskType)" type="primary"
|
||||
v-if="item.taskType"></uni-tag></view>
|
||||
<view><strong>故障编码</strong> : {{item.breakdownCode}}</view>
|
||||
<view><strong>故障名称</strong> : {{item.breakdownName}}</view>
|
||||
<view><strong>状态</strong> : <uni-tag :text="statusText(item.status)" type="primary"
|
||||
v-if="item.status"></uni-tag></view>
|
||||
<view><strong>模具编号</strong> : {{item.mouldUuid}}</view>
|
||||
<view><strong>故障类型</strong> : <uni-tag :text="breakText(item.type)" type="primary"
|
||||
v-if="item.type"></uni-tag></view>
|
||||
<view><strong>维修人</strong> : {{item.operatorName}}</view>
|
||||
<view><strong>创建人</strong> : {{item.createBy}}</view>
|
||||
<view><strong>创建时间</strong> : {{item.createTime}}</view>
|
||||
<view><strong>修改人</strong> : {{item.updateBy}}</view>
|
||||
<uni-row>
|
||||
<uni-col :span="18">
|
||||
<view><strong>修改时间</strong> : {{item.updateTime}}</view>
|
||||
<view><strong>备注</strong> : {{item.remark}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6"> <u-button type="primary"
|
||||
@click="handleFinish(item)">完成</u-button></uni-col>
|
||||
</uni-row>
|
||||
</uni-card>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listBreakdown,
|
||||
getBreakdown,
|
||||
delBreakdown,
|
||||
addBreakdown,
|
||||
updateBreakdown,
|
||||
finishBreakdown
|
||||
} from "@/api/tpmMould/breakdown";
|
||||
import {
|
||||
listRepairTask,
|
||||
getRepairTask,
|
||||
delRepairTask,
|
||||
addRepairTask,
|
||||
updateRepairTask,
|
||||
finishRepairTask,
|
||||
} from "@/api/tpmMould/repairTask";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
export default {
|
||||
mounted() {
|
||||
getDicts("tpm_breakdown_type").then(res => {
|
||||
this.breakdownTypeOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
getDicts("tpm_task_status").then(res => {
|
||||
this.taskStatusOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
getDicts("tpm_repair_type").then(res => {
|
||||
this.repairTypeOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
this.submit();
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
repairTypeOptions: [],
|
||||
breakdownTypeOptions: [],
|
||||
taskStatusOptions: [],
|
||||
formData: {
|
||||
mouldUuid: null,
|
||||
status: "0"
|
||||
},
|
||||
breakdownList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
statusText(status) {
|
||||
let obj = this.taskStatusOptions.find(item => item.value == status)
|
||||
if (obj !== undefined) {
|
||||
return this.taskStatusOptions.find(item => item.value == status).text
|
||||
}
|
||||
},
|
||||
breakText(status) {
|
||||
let obj = this.breakdownTypeOptions.find(item => item.value == status)
|
||||
if (obj !== undefined) {
|
||||
return this.breakdownTypeOptions.find(item => item.value == status).text
|
||||
}
|
||||
},
|
||||
taskText(status) {
|
||||
let obj = this.repairTypeOptions.find(item => item.value == status)
|
||||
if (obj !== undefined) {
|
||||
return this.repairTypeOptions.find(item => item.value == status).text
|
||||
}
|
||||
},
|
||||
scanBarMouldUuid(code) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.mouldUuid = res.result;
|
||||
_this.submit()
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
listBreakdown({
|
||||
mouldUuid: this.formData.mouldUuid,
|
||||
status: this.formData.status
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.breakdownList = res.rows;
|
||||
} else {
|
||||
this.$modal.msg("未查询到相关信息,请重新输入!")
|
||||
this.formData.mouldUuid = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
handleFinish(item) {
|
||||
finishBreakdown([item.id]).then(response => {
|
||||
this.submit();
|
||||
this.$modal.msgSuccess("完成成功");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.text {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
224
pages/tpmMould/mouldStart.vue
Normal file
224
pages/tpmMould/mouldStart.vue
Normal file
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :model="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-forms-item label="模具编码" :labelWidth='90' name="mouldUuid">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarMouldUuid" v-model="formData.mouldUuid"
|
||||
type="text" @confirm="confirmMouldUuid" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="模具名称" :labelWidth='90' name="mouldName">
|
||||
{{formData.mouldName}}
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarEquipmentCode" @confirm="confirmEquipmentCode"
|
||||
v-model="formData.equipmentCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备名称" :labelWidth='90' name="equipmentTitle">
|
||||
{{formData.equipmentTitle}}
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="库位" :labelWidth='90' name="storageLocationBarcode">
|
||||
<!-- <uni-easyinput suffixIcon="scan" @iconClick="scanBarStorageLocationBarcode"
|
||||
@confirm="confirmStorageLocationBarcode" v-model="formData.storageLocationBarcode"
|
||||
type="text" /> -->
|
||||
<uni-easyinput v-model="formData.storageLocationBarcode" type="text" disabled />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="安装员" :labelWidth='90' name="installBy">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarInstallCode" @confirm="confirmInstallCode"
|
||||
v-model="formData.installBy" type="text" style="margin-bottom: 10px;" />
|
||||
<uni-data-select v-model="formData.installBy" :localdata="empList" />
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="操作员" :labelWidth='90' name="operator">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarOperator" @confirm="confirmOperator"
|
||||
v-model="formData.operator" type="text" style="margin-bottom: 10px;" />
|
||||
<uni-data-select v-model="formData.operator" :localdata="empList" />
|
||||
</uni-forms-item> -->
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listUseRecord,
|
||||
getUseRecord,
|
||||
delUseRecord,
|
||||
addUseRecord,
|
||||
updateUseRecord,
|
||||
bindMould,
|
||||
unbindMould,
|
||||
} from "@/api/tpmMould/useRecord";
|
||||
import {
|
||||
listMould
|
||||
} from "@/api/tpmMould/mould";
|
||||
import {
|
||||
listEquipment
|
||||
} from "@/api/mes/jobReport";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
mouldUuid: null,
|
||||
mouldName: null,
|
||||
equipmentCode: null,
|
||||
equipmentTitle: null,
|
||||
storageLocationBarcode: null,
|
||||
installBy: null,
|
||||
operator: null
|
||||
},
|
||||
empList: [],
|
||||
rules: {
|
||||
equipmentCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入设备编码!',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: '^[A-Z0-9]+$',
|
||||
errorMessage: '请输入正确格式的设备编码!',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]
|
||||
},
|
||||
mouldUuid: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入模具编码!'
|
||||
}]
|
||||
},
|
||||
installBy: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入安装员!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
listEmployee().then((res) => {
|
||||
this.empList = res.rows.map(item => {
|
||||
return {
|
||||
text: item.empCode + ':' + item.name,
|
||||
value: item.empCode,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
//扫描模具编码带出模具信息
|
||||
confirmMouldUuid() {
|
||||
if (this.formData.mouldUuid) {
|
||||
listMould({
|
||||
mouldUuid: this.formData.mouldUuid
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.mouldName = res.rows[0].mouldName
|
||||
this.formData.storageLocationBarcode = res.rows[0].storageLocationBarcode;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该模具,请重新输入!")
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//扫描设备编码带出设备信息
|
||||
confirmEquipmentCode() {
|
||||
if (this.formData.equipmentCode) {
|
||||
listEquipment({
|
||||
equipmentCode: this.formData.equipmentCode
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.equipmentTitle = res.rows[0].equipmentTitle
|
||||
} else {
|
||||
this.$modal.msg("未查询到该设备,请重新输入!")
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
scanBarMouldUuid() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.mouldUuid = res.result;
|
||||
_this.confirmMouldUuid()
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarEquipmentCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.equipmentCode = res.result;
|
||||
_this.confirmEquipmentCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarInstallCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.installBy = res.result;
|
||||
_this.confirmInstallCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarOperator() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.operator = res.result;
|
||||
_this.confirmOperator()
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmOperator() {
|
||||
listEmployee({
|
||||
empCode: this.formData.operator
|
||||
}).then(async res => {
|
||||
if (res.rows.length == 0) {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
this.formData.operator = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
confirmInstallCode() {
|
||||
listEmployee({
|
||||
empCode: this.formData.installBy
|
||||
}).then(async res => {
|
||||
if (res.rows.length == 0) {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
this.formData.installBy = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(async res => {
|
||||
console.log(this.formData)
|
||||
if (this.formData.installBy == "") this.formData.installBy = null;
|
||||
if (this.formData.operator == "") this.formData.operator = null;
|
||||
this.$modal.loading('提交中')
|
||||
bindMould(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("模具上机成功!")
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
153
pages/tpmMould/mouldStartFinish.vue
Normal file
153
pages/tpmMould/mouldStartFinish.vue
Normal file
@@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :model="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarEquipmentCode" @change="confirmEquipmentCode"
|
||||
v-model="formData.equipmentCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备名称" :labelWidth='90' name="equipmentTitle">
|
||||
{{formData.equipmentTitle}}
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="模具编码" :labelWidth='90' name="mouldUuid">
|
||||
<uni-data-select v-model="formData.mouldUuid" :localdata="mouldList" @change="clickDetail" />
|
||||
</uni-forms-item> -->
|
||||
|
||||
<uni-forms-item label="模具编码" :labelWidth='90' name="mouldUuid">
|
||||
<uni-data-select v-model="formData.mouldUuid" :localdata="mouldList" @change="clickDetail(mouldList[formData.mouldUuid])" />
|
||||
</uni-forms-item>
|
||||
|
||||
<!-- <uni-forms-item label="模具名称" :labelWidth='90' name="mouldName">
|
||||
{{formData.mouldName}}
|
||||
</uni-forms-item> -->
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listUseRecord,
|
||||
getUseRecord,
|
||||
delUseRecord,
|
||||
addUseRecord,
|
||||
updateUseRecord,
|
||||
bindMould,
|
||||
unbindMould,
|
||||
listUseRecordAvailable,
|
||||
endInstall
|
||||
} from "@/api/tpmMould/useRecord";
|
||||
import {
|
||||
listMould
|
||||
} from "@/api/tpmMould/mould";
|
||||
import {
|
||||
listEquipment
|
||||
} from "@/api/mes/jobReport";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
mouldUuid:0,
|
||||
mouldName: null,
|
||||
equipmentCode: null,
|
||||
equipmentTitle: null,
|
||||
index:1,
|
||||
},
|
||||
mouldList: [],
|
||||
rules: {
|
||||
equipmentCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入设备编码!',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: '^[A-Z0-9]+$',
|
||||
errorMessage: '请输入正确格式的设备编码!',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]
|
||||
},
|
||||
mouldUuid: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入模具编码!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
clickDetail(e) {
|
||||
this.id = e.id
|
||||
console.log(e,"123");
|
||||
},
|
||||
//扫描设备编码带出设备信息
|
||||
async confirmEquipmentCode() {
|
||||
if (this.formData.equipmentCode) {
|
||||
await listEquipment({
|
||||
equipmentCode: this.formData.equipmentCode
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.equipmentTitle = res.rows[0].equipmentTitle
|
||||
} else {
|
||||
this.$modal.msg("未查询到该设备,请重新输入!")
|
||||
}
|
||||
})
|
||||
await listUseRecordAvailable({
|
||||
equipmentCode: this.formData.equipmentCode,
|
||||
searchType: '2'
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
console.log(res.rows,"res")
|
||||
this.mouldList = res.rows.map((item,index) => {
|
||||
item.text = item.mouldUuid + ':' + item.mouldName;
|
||||
item.value = index;
|
||||
item.diasble = false;
|
||||
item.index = index;
|
||||
return item
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$modal.msg("未查询到可上模完成的记录,请重新输入!")
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(this.mouldList,"123");
|
||||
},
|
||||
|
||||
|
||||
scanBarEquipmentCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.equipmentCode = res.result;
|
||||
_this.confirmEquipmentCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(async res => {
|
||||
this.$modal.loading('提交中')
|
||||
endInstall([this.id]).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("上模完成成功!")
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user