init project
This commit is contained in:
137
pages/basic/cutterBind.vue
Normal file
137
pages/basic/cutterBind.vue
Normal file
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-forms-item label="刀柄编码" :labelWidth='90' name="shankCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.shankCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="刀刃编码" :labelWidth='90' name="bladeCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarbladeCode" v-model="formData.bladeCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="安装员" :labelWidth='90' name="installCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarinstallBy" @change="selectinstallBy"
|
||||
v-model="installCode" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listUseRecord,
|
||||
getUseRecord,
|
||||
delUseRecord,
|
||||
addStartUse,
|
||||
updateEndUse,
|
||||
listEntity,
|
||||
listMaterial,
|
||||
listEquipment,
|
||||
getEntity,
|
||||
bindRecord
|
||||
} from "@/api/basic/cutter.js";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
shankCode: null,
|
||||
bladeCode: null,
|
||||
installBy: null,
|
||||
},
|
||||
installCode: null,
|
||||
rules: {
|
||||
bladeCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入刀刃编码!'
|
||||
}]
|
||||
},
|
||||
shankCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入刀柄编码!'
|
||||
}]
|
||||
},
|
||||
installCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入安装员!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.shankCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarbladeCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.bladeCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
selectinstallBy(code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.installBy = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarinstallBy() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.installCode = res.result;
|
||||
_this.selectinstallBy(res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(async res => {
|
||||
if (this.formData.bladeCode && this.formData.shankCode) {
|
||||
//判断安装员是否填入
|
||||
setTimeout(() => {
|
||||
if (this.formData.installBy) {
|
||||
this.$modal.loading('提交中')
|
||||
bindRecord(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("刀具安装成功!")
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("请输入安装员!")
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
227
pages/basic/cutterBladeEnd.vue
Normal file
227
pages/basic/cutterBladeEnd.vue
Normal file
@@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-forms-item label="刀刃编码" :labelWidth='90' name="cutterBladeCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.cutterBladeCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarequipmentCode" v-model="formData.equipmentCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="拆卸员" :labelWidth='90' name="removeCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarremoveBy" @change="selectremoveBy"
|
||||
v-model="removeCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="操作员" :labelWidth='90' name="operatorCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBaroperator" @change="selectoperator"
|
||||
v-model="operatorCode" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listUseRecord,
|
||||
getUseRecord,
|
||||
delUseRecord,
|
||||
addStartUse,
|
||||
updateEndUse,
|
||||
listEntity,
|
||||
listMaterial,
|
||||
listEquipment,
|
||||
getEntity,
|
||||
removeBlade
|
||||
} from "@/api/basic/cutter.js";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code: null,
|
||||
formData: {
|
||||
cutterBladeCode: null,
|
||||
equipmentCode: null,
|
||||
removeBy: null,
|
||||
operator: null
|
||||
},
|
||||
removeCode: null,
|
||||
operatorCode: null,
|
||||
value: 0,
|
||||
range: [],
|
||||
entityOptions: [],
|
||||
materialOptions: [],
|
||||
rules: {
|
||||
equipmentCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入设备编码!'
|
||||
},
|
||||
{
|
||||
pattern: '^[A-Z0-9]+$',
|
||||
errorMessage: '请输入正确格式的设备编码!',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]
|
||||
},
|
||||
cutterBladeCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入刀柄编码!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
//扫描物料编码带出绑定的刀具信息
|
||||
scanBarCode() {
|
||||
if (this.formData.materialCode) {
|
||||
console.log(this.formData.materialCode)
|
||||
this.range = [];
|
||||
//判断是否扫描二维码
|
||||
if (typeof(this.formData.materialCode) === 'string') {
|
||||
this.formData.materialName = this.materialOptions.find(item => item.materialCode == this.formData
|
||||
.materialCode).materialName;
|
||||
if (this.formData.materialCode != "") {
|
||||
listEntity({
|
||||
cutterMaterialCode: this.formData.materialCode,
|
||||
cutterMaterialName: this.formData.materialName,
|
||||
}).then((resp) => {
|
||||
this.range = resp.rows;
|
||||
for (var i = 0; i < resp.rows.length; i++) {
|
||||
this.range[i].value = resp.rows[i].id;
|
||||
this.range[i].text = resp.rows[i].entityCode + ':' + (!resp.rows[i].pieceNo ?
|
||||
'' : resp.rows[i].pieceNo) + ':' + (!resp.rows[i].batchNo ? '' : resp
|
||||
.rows[i].batchNo)
|
||||
}
|
||||
this.entityOptions = resp.rows;
|
||||
});
|
||||
} else {
|
||||
this.entityOptions = [];
|
||||
}
|
||||
} else if (typeof(this.formData.materialCode) === 'object') {
|
||||
if (this.formData.materialCode.id) {
|
||||
this.formData.cutterEntityId = this.formData.materialCode.id;
|
||||
getEntity(this.formData.materialCode.id).then(async res => {
|
||||
this.range.push(res.data);
|
||||
this.entityOptions = this.range;
|
||||
this.formData.cutterEntityCode = this.range[0].entityCode;
|
||||
this.range[0].value = this.range[0].id;
|
||||
this.range[0].text = this.range[0].entityCode + ':' + (!this.range[0].pieceNo ?
|
||||
'' : this.range[0].pieceNo) + ':' + (!this.range[0].batchNo ? '' : this
|
||||
.range[0].batchNo)
|
||||
})
|
||||
}
|
||||
this.formData.materialName = this.formData.materialCode.cutterMaterialName;
|
||||
this.formData.materialCode = this.formData.materialCode.cutterMaterialCode;
|
||||
}
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.cutterBladeCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
//根据设备编码获取设备id
|
||||
getEquipmentId() {
|
||||
if (this.formData.equipmentCode) {
|
||||
listEquipment({
|
||||
equipmentCode: this.formData.equipmentCode
|
||||
}).then((resp) => {
|
||||
if (resp.rows.length > 0) {
|
||||
this.formData.equipmentId = resp.rows[0].id;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
scanBarequipmentCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.equipmentCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
selectoperator(code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.operator = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
}
|
||||
})
|
||||
},
|
||||
selectremoveBy(code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.removeBy = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarremoveBy() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.removeCode = res.result;
|
||||
_this.selectremoveBy(res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBaroperator() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.operatorCode = res.result;
|
||||
_this.selectoperator(res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(async res => {
|
||||
if (this.formData.equipmentCode && this.formData.cutterBladeCode) {
|
||||
//判断安装员是否填入
|
||||
setTimeout(() => {
|
||||
if (this.formData.removeBy) {
|
||||
this.$modal.loading('提交中')
|
||||
removeBlade(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("刀刃下机成功!")
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("请输入拆卸员!")
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
234
pages/basic/cutterBladeStart.vue
Normal file
234
pages/basic/cutterBladeStart.vue
Normal file
@@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :model="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-forms-item label="刀刃编码" :labelWidth='90' name="cutterBladeCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.cutterBladeCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarequipmentCode" v-model="formData.equipmentCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="安装员" :labelWidth='90' name="installCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarinstallBy" @change="selectinstallBy"
|
||||
v-model="installCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="操作员" :labelWidth='90' name="operatorCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBaroperator" @change="selectoperator"
|
||||
v-model="operatorCode" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listUseRecord,
|
||||
getUseRecord,
|
||||
delUseRecord,
|
||||
addStartUse,
|
||||
updateEndUse,
|
||||
listEntity,
|
||||
listMaterial,
|
||||
listEquipment,
|
||||
getEntity,
|
||||
installBlade
|
||||
} from "@/api/basic/cutter.js";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code: null,
|
||||
formData: {
|
||||
cutterBladeCode: null,
|
||||
equipmentCode: null,
|
||||
installBy: null,
|
||||
operator: null
|
||||
},
|
||||
installCode: null,
|
||||
operatorCode: null,
|
||||
value: 0,
|
||||
range: [],
|
||||
entityOptions: [],
|
||||
materialOptions: [],
|
||||
rules: {
|
||||
equipmentCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入设备编码!',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: '^[A-Z0-9]+$',
|
||||
errorMessage: '请输入正确格式的设备编码!',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]
|
||||
},
|
||||
cutterBladeCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入刀刃编码!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
//扫描物料编码带出绑定的刀具信息
|
||||
scanBarCode() {
|
||||
if (this.formData.materialCode) {
|
||||
console.log(this.formData.materialCode)
|
||||
this.range = [];
|
||||
//判断是否扫描二维码
|
||||
if (typeof(this.formData.materialCode) === 'string') {
|
||||
// this.formData.materialCode = this.code;
|
||||
this.formData.materialName = this.materialOptions.find(item => item.materialCode == this.formData
|
||||
.materialCode).materialName;
|
||||
if (this.formData.materialCode != "") {
|
||||
listEntity({
|
||||
cutterMaterialCode: this.formData.materialCode,
|
||||
cutterMaterialName: this.formData.materialName,
|
||||
}).then((resp) => {
|
||||
this.range = resp.rows;
|
||||
for (var i = 0; i < resp.rows.length; i++) {
|
||||
this.range[i].value = resp.rows[i].id;
|
||||
this.range[i].text = resp.rows[i].entityCode + ':' + (!resp.rows[i].pieceNo ?
|
||||
'' : resp.rows[i].pieceNo) + ':' + (!resp.rows[i].batchNo ? '' : resp
|
||||
.rows[i].batchNo)
|
||||
}
|
||||
this.entityOptions = resp.rows;
|
||||
});
|
||||
} else {
|
||||
this.entityOptions = [];
|
||||
}
|
||||
} else if (typeof(this.formData.materialCode) === 'object') {
|
||||
if (this.formData.materialCode.id) {
|
||||
this.formData.cutterEntityId = this.formData.materialCode.id;
|
||||
getEntity(this.formData.materialCode.id).then(async res => {
|
||||
this.range.push(res.data);
|
||||
this.entityOptions = this.range;
|
||||
this.formData.cutterEntityCode = this.range[0].entityCode;
|
||||
this.range[0].value = this.range[0].id;
|
||||
this.range[0].text = this.range[0].entityCode + ':' + (!this.range[0].pieceNo ?
|
||||
'' : this.range[0].pieceNo) + ':' + (!this.range[0].batchNo ? '' : this
|
||||
.range[0].batchNo)
|
||||
})
|
||||
}
|
||||
this.formData.materialName = this.formData.materialCode.cutterMaterialName;
|
||||
this.formData.materialCode = this.formData.materialCode.cutterMaterialCode;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.cutterBladeCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
//根据设备编码获取设备id
|
||||
getEquipmentId() {
|
||||
if (this.formData.equipmentCode) {
|
||||
listEquipment({
|
||||
equipmentCode: this.formData.equipmentCode
|
||||
}).then((resp) => {
|
||||
if (resp.rows.length > 0) {
|
||||
this.formData.equipmentId = resp.rows[0].id;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
scanBarequipmentCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.equipmentCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
selectoperator(code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.operator = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
}
|
||||
})
|
||||
},
|
||||
selectinstallBy(code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.installBy = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarinstallBy() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.installCode = res.result;
|
||||
_this.selectinstallBy(res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBaroperator() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.operatorCode = res.result;
|
||||
_this.selectoperator(res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(async res => {
|
||||
if (this.formData.equipmentCode && this.formData.cutterBladeCode) {
|
||||
console.log(this.formData);
|
||||
//判断安装员是否填入
|
||||
setTimeout(() => {
|
||||
if (this.formData.installBy) {
|
||||
this.$modal.loading('提交中')
|
||||
installBlade(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("刀刃上机成功!")
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("请输入安装员!")
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
234
pages/basic/cutterEnd.vue
Normal file
234
pages/basic/cutterEnd.vue
Normal file
@@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-forms-item label="刀柄编码" :labelWidth='90' name="cutterShankCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.cutterShankCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarequipmentCode" v-model="formData.equipmentCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="拆卸员" :labelWidth='90' name="removeCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarremoveBy" @change="selectremoveBy"
|
||||
v-model="removeCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="操作员" :labelWidth='90' name="operatorCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBaroperator" @change="selectoperator"
|
||||
v-model="operatorCode" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listUseRecord,
|
||||
getUseRecord,
|
||||
delUseRecord,
|
||||
addStartUse,
|
||||
updateEndUse,
|
||||
listEntity,
|
||||
listMaterial,
|
||||
listEquipment,
|
||||
getEntity,
|
||||
removeShank
|
||||
} from "@/api/basic/cutter.js";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code: null,
|
||||
formData: {
|
||||
cutterShankCode: null,
|
||||
equipmentCode: null,
|
||||
removeBy: null,
|
||||
operator: null
|
||||
},
|
||||
removeCode: null,
|
||||
operatorCode: null,
|
||||
value: 0,
|
||||
range: [],
|
||||
entityOptions: [],
|
||||
materialOptions: [],
|
||||
rules: {
|
||||
equipmentCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入设备编码!'
|
||||
},
|
||||
{
|
||||
pattern: '^[A-Z0-9]+$',
|
||||
errorMessage: '请输入正确格式的设备编码!',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]
|
||||
},
|
||||
cutterShankCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入刀柄编码!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
//扫描物料编码带出绑定的刀具信息
|
||||
scanBarCode() {
|
||||
if (this.formData.materialCode) {
|
||||
console.log(this.formData.materialCode)
|
||||
this.range = [];
|
||||
//判断是否扫描二维码
|
||||
if (typeof(this.formData.materialCode) === 'string') {
|
||||
// this.formData.materialCode = this.code;
|
||||
this.formData.materialName = this.materialOptions.find(item => item.materialCode == this.formData
|
||||
.materialCode).materialName;
|
||||
if (this.formData.materialCode != "") {
|
||||
listEntity({
|
||||
cutterMaterialCode: this.formData.materialCode,
|
||||
cutterMaterialName: this.formData.materialName,
|
||||
}).then((resp) => {
|
||||
this.range = resp.rows;
|
||||
for (var i = 0; i < resp.rows.length; i++) {
|
||||
this.range[i].value = resp.rows[i].id;
|
||||
this.range[i].text = resp.rows[i].entityCode + ':' + (!resp.rows[i].pieceNo ?
|
||||
'' : resp.rows[i].pieceNo) + ':' + (!resp.rows[i].batchNo ? '' : resp
|
||||
.rows[i].batchNo)
|
||||
}
|
||||
this.entityOptions = resp.rows;
|
||||
});
|
||||
} else {
|
||||
this.entityOptions = [];
|
||||
}
|
||||
} else if (typeof(this.formData.materialCode) === 'object') {
|
||||
if (this.formData.materialCode.id) {
|
||||
this.formData.cutterEntityId = this.formData.materialCode.id;
|
||||
getEntity(this.formData.materialCode.id).then(async res => {
|
||||
this.range.push(res.data);
|
||||
this.entityOptions = this.range;
|
||||
this.formData.cutterEntityCode = this.range[0].entityCode;
|
||||
this.range[0].value = this.range[0].id;
|
||||
this.range[0].text = this.range[0].entityCode + ':' + (!this.range[0].pieceNo ?
|
||||
'' : this.range[0].pieceNo) + ':' + (!this.range[0].batchNo ? '' : this
|
||||
.range[0].batchNo)
|
||||
})
|
||||
}
|
||||
this.formData.materialName = this.formData.materialCode.cutterMaterialName;
|
||||
this.formData.materialCode = this.formData.materialCode.cutterMaterialCode;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.cutterShankCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
//根据设备编码获取设备id
|
||||
getEquipmentId() {
|
||||
if (this.formData.equipmentCode) {
|
||||
listEquipment({
|
||||
equipmentCode: this.formData.equipmentCode
|
||||
}).then((resp) => {
|
||||
if (resp.rows.length > 0) {
|
||||
this.formData.equipmentId = resp.rows[0].id;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
scanBarequipmentCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.equipmentCode = res.result;
|
||||
// _this.getEquipmentId();
|
||||
}
|
||||
});
|
||||
},
|
||||
selectoperator(code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.operator = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
}
|
||||
})
|
||||
},
|
||||
selectremoveBy(code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.removeBy = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarremoveBy() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.removeCode = res.result;
|
||||
_this.selectremoveBy(res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBaroperator() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.operatorCode = res.result;
|
||||
_this.selectoperator(res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(async res => {
|
||||
if (this.formData.equipmentCode && this.formData.cutterShankCode) {
|
||||
console.log(this.formData);
|
||||
//判断安装员是否填入
|
||||
setTimeout(() => {
|
||||
if (this.formData.removeBy) {
|
||||
this.$modal.loading('提交中')
|
||||
removeShank(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("刀柄下机成功!")
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("请输入拆卸员!")
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
235
pages/basic/cutterStart.vue
Normal file
235
pages/basic/cutterStart.vue
Normal file
@@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :model="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-forms-item label="刀柄编码" :labelWidth='90' name="cutterShankCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.cutterShankCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarequipmentCode" v-model="formData.equipmentCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="安装员" :labelWidth='90' name="installCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarinstallBy" @change="selectinstallBy"
|
||||
v-model="installCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="操作员" :labelWidth='90' name="operatorCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBaroperator" @change="selectoperator"
|
||||
v-model="operatorCode" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listUseRecord,
|
||||
getUseRecord,
|
||||
delUseRecord,
|
||||
addStartUse,
|
||||
updateEndUse,
|
||||
listEntity,
|
||||
listMaterial,
|
||||
listEquipment,
|
||||
getEntity,
|
||||
installShank
|
||||
} from "@/api/basic/cutter.js";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code: null,
|
||||
formData: {
|
||||
cutterShankCode: null,
|
||||
equipmentCode: null,
|
||||
installBy: null,
|
||||
operator: null
|
||||
},
|
||||
installCode: null,
|
||||
operatorCode: null,
|
||||
value: 0,
|
||||
range: [],
|
||||
entityOptions: [],
|
||||
materialOptions: [],
|
||||
rules: {
|
||||
equipmentCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入设备编码!',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: '^[A-Z0-9]+$',
|
||||
errorMessage: '请输入正确格式的设备编码!',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]
|
||||
},
|
||||
cutterShankCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入刀柄编码!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
//扫描物料编码带出绑定的刀具信息
|
||||
scanBarCode() {
|
||||
if (this.formData.materialCode) {
|
||||
console.log(this.formData.materialCode)
|
||||
this.range = [];
|
||||
//判断是否扫描二维码
|
||||
if (typeof(this.formData.materialCode) === 'string') {
|
||||
// this.formData.materialCode = this.code;
|
||||
this.formData.materialName = this.materialOptions.find(item => item.materialCode == this.formData
|
||||
.materialCode).materialName;
|
||||
if (this.formData.materialCode != "") {
|
||||
listEntity({
|
||||
cutterMaterialCode: this.formData.materialCode,
|
||||
cutterMaterialName: this.formData.materialName,
|
||||
}).then((resp) => {
|
||||
this.range = resp.rows;
|
||||
for (var i = 0; i < resp.rows.length; i++) {
|
||||
this.range[i].value = resp.rows[i].id;
|
||||
this.range[i].text = resp.rows[i].entityCode + ':' + (!resp.rows[i].pieceNo ?
|
||||
'' : resp.rows[i].pieceNo) + ':' + (!resp.rows[i].batchNo ? '' : resp
|
||||
.rows[i].batchNo)
|
||||
}
|
||||
this.entityOptions = resp.rows;
|
||||
});
|
||||
} else {
|
||||
this.entityOptions = [];
|
||||
}
|
||||
} else if (typeof(this.formData.materialCode) === 'object') {
|
||||
if (this.formData.materialCode.id) {
|
||||
this.formData.cutterEntityId = this.formData.materialCode.id;
|
||||
getEntity(this.formData.materialCode.id).then(async res => {
|
||||
this.range.push(res.data);
|
||||
this.entityOptions = this.range;
|
||||
this.formData.cutterEntityCode = this.range[0].entityCode;
|
||||
this.range[0].value = this.range[0].id;
|
||||
this.range[0].text = this.range[0].entityCode + ':' + (!this.range[0].pieceNo ?
|
||||
'' : this.range[0].pieceNo) + ':' + (!this.range[0].batchNo ? '' : this
|
||||
.range[0].batchNo)
|
||||
})
|
||||
}
|
||||
this.formData.materialName = this.formData.materialCode.cutterMaterialName;
|
||||
this.formData.materialCode = this.formData.materialCode.cutterMaterialCode;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.cutterShankCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
//根据设备编码获取设备id
|
||||
getEquipmentId() {
|
||||
if (this.formData.equipmentCode) {
|
||||
listEquipment({
|
||||
equipmentCode: this.formData.equipmentCode
|
||||
}).then((resp) => {
|
||||
if (resp.rows.length > 0) {
|
||||
this.formData.equipmentId = resp.rows[0].id;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
scanBarequipmentCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.equipmentCode = res.result;
|
||||
// _this.getEquipmentId();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
selectoperator(code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.operator = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
}
|
||||
})
|
||||
},
|
||||
selectinstallBy(code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.installBy = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarinstallBy() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.installCode = res.result;
|
||||
_this.selectinstallBy(res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBaroperator() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.operatorCode = res.result;
|
||||
_this.selectoperator(res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(async res => {
|
||||
if (this.formData.equipmentCode && this.formData.cutterShankCode) {
|
||||
console.log(this.formData);
|
||||
//判断安装员是否填入
|
||||
setTimeout(() => {
|
||||
if (this.formData.installBy) {
|
||||
this.$modal.loading('提交中')
|
||||
installShank(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("刀柄上机成功!")
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("请输入安装员!")
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
166
pages/basic/cutterSwitch.vue
Normal file
166
pages/basic/cutterSwitch.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-forms-item label="刀柄编码" :labelWidth='90' name="shankCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @change="scanbarshankCode"
|
||||
v-model="formData.shankCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="已绑定刀刃编码" :labelWidth='90' name="oldbladeCode">
|
||||
<uni-easyinput disabled v-model="oldbladeCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="刀刃编码" :labelWidth='90' name="bladeCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarbladeCode" v-model="formData.bladeCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="切换人" :labelWidth='90' name="updateBy">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarupdateBy" @change="selectEmpCode"
|
||||
v-model="updateBy" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listInstallRecord,
|
||||
unbindRecord,
|
||||
bindRecord
|
||||
} from "@/api/basic/cutter.js";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
shankCode: null,
|
||||
bladeCode: null,
|
||||
},
|
||||
//临时切换人编码
|
||||
updateBy: null,
|
||||
//切换人姓名
|
||||
updateName: null,
|
||||
//拆卸表单
|
||||
unbindForm: {},
|
||||
//安装表单
|
||||
bindForm: {},
|
||||
//旧刀刃编码
|
||||
oldbladeCode: null,
|
||||
rules: {
|
||||
bladeCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入刀刃编码!'
|
||||
}]
|
||||
},
|
||||
shankCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入刀柄编码!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
selectEmpCode(code) {
|
||||
this.updateName = null;
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.updateName = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.shankCode = res.result;
|
||||
_this.formData.scanbarshankCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
scanbarshankCode() {
|
||||
this.oldbladeCode = null;
|
||||
if (this.formData.shankCode) {
|
||||
listInstallRecord({
|
||||
shankCode: this.formData.shankCode,
|
||||
removeTime: null
|
||||
}).then(async res => {
|
||||
//判断是否存在已绑定且未拆卸的刀具
|
||||
console.log(res);
|
||||
for (var i in res.rows) {
|
||||
if (!res.rows[i].removeTime) {
|
||||
console.log(res.rows[i].bladeCode)
|
||||
this.oldbladeCode = res.rows[i].bladeCode;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBarbladeCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.bladeCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarupdateBy() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.updateBy = res.result;
|
||||
_this.selectEmpCode(res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(async res => {
|
||||
if (this.formData.bladeCode && this.formData.shankCode) {
|
||||
console.log(this.updateName)
|
||||
if (this.updateName) {
|
||||
this.unbindForm = {
|
||||
shankCode: this.formData.shankCode,
|
||||
bladeCode: this.oldbladeCode,
|
||||
removeBy: this.updateName
|
||||
}
|
||||
//拆卸
|
||||
unbindRecord(this.unbindForm);
|
||||
this.bindForm = this.formData
|
||||
this.bindForm.installBy = this.updateName;
|
||||
//由于bindRecord接口过快,导致切换人没有时间赋值,故设置定时器
|
||||
setTimeout(() => {
|
||||
this.$modal.loading('提交中')
|
||||
bindRecord(this.bindForm).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("刀具切换成功!")
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
}, 500);
|
||||
} else {
|
||||
this.$modal.msg("请输入切换人!")
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
132
pages/basic/cutterUnBind.vue
Normal file
132
pages/basic/cutterUnBind.vue
Normal file
@@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-forms-item label="刀柄编码" :labelWidth='90' name="shankCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.shankCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="刀刃编码" :labelWidth='90' name="bladeCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarbladeCode" v-model="formData.bladeCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="拆卸员" :labelWidth='90' name="removeCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarremoveBy" @change="selectremoveBy"
|
||||
v-model="removeCode" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listUseRecord,
|
||||
getUseRecord,
|
||||
delUseRecord,
|
||||
addStartUse,
|
||||
updateEndUse,
|
||||
listEntity,
|
||||
listMaterial,
|
||||
listEquipment,
|
||||
getEntity,
|
||||
unbindRecord
|
||||
} from "@/api/basic/cutter.js";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
shankCode: null,
|
||||
bladeCode: null,
|
||||
removeBy: null,
|
||||
},
|
||||
removeCode: null,
|
||||
rules: {
|
||||
bladeCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入刀刃编码!'
|
||||
}]
|
||||
},
|
||||
shankCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入刀柄编码!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.shankCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarbladeCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.bladeCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
selectremoveBy(code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.removeBy = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarremoveBy() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.removeCode = res.result;
|
||||
_this.selectremoveBy(res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(async res => {
|
||||
if (this.formData.bladeCode && this.formData.shankCode) {
|
||||
console.log(this.formData);
|
||||
setTimeout(() => {
|
||||
if (this.formData.removeBy) {
|
||||
this.$modal.loading('提交中')
|
||||
unbindRecord(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("刀具拆卸成功!")
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("请输入拆卸员!")
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
120
pages/basic/empEqpEnd.vue
Normal file
120
pages/basic/empEqpEnd.vue
Normal file
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="员工编码" :labelWidth='90' name="empCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="search"
|
||||
v-model="formData.empCode" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24" style="margin-bottom: 10px;">
|
||||
该员工已绑定设备:<br><span
|
||||
v-for="item in searchEmpWithEqp">{{item.equipmentCode+':'+item.equipmentTitle}}<br></span>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="eqpCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" v-model="formData.eqpCode" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addStart,
|
||||
addEnd,
|
||||
listEmpEqpHistory
|
||||
} from '@/api/basic/empEqpHistory.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
empCode: null,
|
||||
eqpCode: null
|
||||
},
|
||||
searchEmpWithEqp: [],
|
||||
rules: {
|
||||
empCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入员工编码!'
|
||||
}]
|
||||
},
|
||||
eqpCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入设备编码!'
|
||||
}, {
|
||||
pattern: '^[A-Z0-9]+$',
|
||||
errorMessage: '请输入正确格式的设备编码!',
|
||||
trigger: 'blur',
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//根据员工编码来查询已上机但并未下机的设备
|
||||
search() {
|
||||
this.searchEmpWithEqp = [];
|
||||
listEmpEqpHistory({
|
||||
empCode: this.formData.empCode
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
for (var i in res.rows) {
|
||||
//判断是否下机
|
||||
if (!res.rows[i].endTime) {
|
||||
this.searchEmpWithEqp.push({
|
||||
equipmentCode: res.rows[i].equipmentCode,
|
||||
equipmentTitle: res.rows[i].equipmentTitle
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.empCode = res.result;
|
||||
_this.search();
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.eqpCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
if (this.formData.empCode && this.formData.eqpCode) {
|
||||
this.$modal.loading('提交中')
|
||||
addEnd(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("下机成功!")
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
121
pages/basic/empEqpStart.vue
Normal file
121
pages/basic/empEqpStart.vue
Normal file
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="员工编码" :labelWidth='90' name="empCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="search"
|
||||
v-model="formData.empCode" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24" style="margin-bottom: 10px;">
|
||||
该员工已绑定设备:<br><span v-for="item,index in searchEmpWithEqp"
|
||||
:key="index">{{item.equipmentCode+':'+item.equipmentTitle}}</span></br>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="eqpCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" v-model="formData.eqpCode" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addStart,
|
||||
addEnd,
|
||||
listEmpEqpHistory
|
||||
} from '@/api/basic/empEqpHistory.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
empCode: null,
|
||||
eqpCode: null
|
||||
},
|
||||
searchEmpWithEqp: [],
|
||||
rules: {
|
||||
empCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入员工编码!'
|
||||
}]
|
||||
},
|
||||
eqpCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入设备编码!'
|
||||
},
|
||||
{
|
||||
pattern: '^[A-Z0-9]+$',
|
||||
errorMessage: '请输入正确格式的设备编码!',
|
||||
trigger: 'blur',
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//根据员工编码来查询已上机但并未下机的设备
|
||||
search() {
|
||||
this.searchEmpWithEqp = []
|
||||
listEmpEqpHistory({
|
||||
empCode: this.formData.empCode
|
||||
}).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
for (var i in res.rows) {
|
||||
//判断是否下机
|
||||
if (!res.rows[i].endTime) {
|
||||
this.searchEmpWithEqp.push({
|
||||
equipmentCode: res.rows[i].equipmentCode,
|
||||
equipmentTitle: res.rows[i].equipmentTitle
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.empCode = res.result;
|
||||
_this.search();
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.eqpCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
if (this.formData.empCode && this.formData.eqpCode) {
|
||||
this.$modal.loading('提交中')
|
||||
addStart(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("上机成功!")
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
43
pages/common/textview/index.vue
Normal file
43
pages/common/textview/index.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-card class="view-title" :title="title">
|
||||
<text class="uni-body view-content">{{ content }}</text>
|
||||
</uni-card>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.title = options.title
|
||||
this.content = options.content
|
||||
uni.setNavigationBarTitle({
|
||||
title: options.title
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.view-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.view-content {
|
||||
font-size: 26rpx;
|
||||
padding: 12px 5px 0;
|
||||
color: #333;
|
||||
line-height: 24px;
|
||||
font-weight: normal;
|
||||
}
|
||||
</style>
|
||||
34
pages/common/webview/index.vue
Normal file
34
pages/common/webview/index.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<view v-if="params.url">
|
||||
<web-view :webview-styles="webviewStyles" :src="`${params.url}`"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
params: {},
|
||||
webviewStyles: {
|
||||
progress: {
|
||||
color: "#FF3333"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
src: {
|
||||
type: [String],
|
||||
default: null
|
||||
}
|
||||
},
|
||||
onLoad(event) {
|
||||
this.params = event
|
||||
if (event.title) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: event.title
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
139
pages/esop/esopProLine.vue
Normal file
139
pages/esop/esopProLine.vue
Normal file
@@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产工单" :labelWidth='90' name="pwoCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.pwoCode" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="产线编码" :labelWidth='90' name="productLineCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" v-model="formData.productLineCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="状态" :labelWidth='90' name="issuedState">
|
||||
<u-switch v-model="check" @change="favClick" activeColor="#5AC725"
|
||||
style="float: left;"></u-switch>
|
||||
<view style="float: left;margin: 5px;">{{status}}</view>
|
||||
<!-- <view class="uni-padding-wrap uni-common-mt">
|
||||
<uni-fav :checked="check" circle='true' bg-color="#dd524d" bg-color-checked="#67C23A" fg-color="#ffffff" fg-color-checked="#ffffff" star="false" :content-text="contentText" @click="favClick" />
|
||||
</view> -->
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
updatePwo,
|
||||
listProLine,
|
||||
listPwo
|
||||
} from "@/api/esop/esop.js";
|
||||
export default {
|
||||
mounted() {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
pwoCode: null,
|
||||
productLineCode: null,
|
||||
proLineId: null,
|
||||
issuedState: 0
|
||||
},
|
||||
check: false,
|
||||
contentText: {
|
||||
contentDefault: '待发',
|
||||
contentFav: '已下发'
|
||||
},
|
||||
status: '待发',
|
||||
rules: {
|
||||
pwoCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入生产工单!'
|
||||
}]
|
||||
},
|
||||
productLineCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入产线编码!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.productLineCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
//切换状态
|
||||
favClick(e) {
|
||||
// this.check = !this.check;
|
||||
// console.log(this.check + " " + e);
|
||||
this.$forceUpdate();
|
||||
if (e == false) {
|
||||
this.status = '待发'
|
||||
this.formData.issuedState = 0
|
||||
} else {
|
||||
this.status = '下发'
|
||||
this.formData.issuedState = 1
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
this.$refs["form"].validate().then(valid => {
|
||||
if (this.formData.productLineCode) {
|
||||
let obj = {
|
||||
productLineCode: this.formData.productLineCode
|
||||
}
|
||||
listProLine(obj).then(res => {
|
||||
this.formData.proLineId = res.rows[0].id;
|
||||
let pwoCode = {
|
||||
pwoCode: this.formData.pwoCode
|
||||
}
|
||||
listPwo(pwoCode).then(res => {
|
||||
this.formData.id = res.rows[0].id;
|
||||
this.$modal.loading('提交中')
|
||||
updatePwo(this.formData).then(response => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("下发成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
109
pages/esop/esopPwo.vue
Normal file
109
pages/esop/esopPwo.vue
Normal file
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="工位编码" :labelWidth='90' name="stationCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.stationCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="作业编码" :labelWidth='90' name="pwoJobCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" v-model="formData.pwoJobCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listStation,
|
||||
listPwoJob,
|
||||
addCustomizeEsop
|
||||
} from "@/api/esop/esop.js";
|
||||
export default {
|
||||
mounted() {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
pwoJobCode: null,
|
||||
stationCode: null,
|
||||
|
||||
},
|
||||
rules: {
|
||||
pwoJobCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入作业编码!'
|
||||
}]
|
||||
},
|
||||
stationCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入工位编码!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.stationCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoJobCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs["form"].validate().then(valid => {
|
||||
if (this.formData.stationCode) {
|
||||
let obj = {
|
||||
stationCode: this.formData.stationCode
|
||||
}
|
||||
listStation(obj).then(res => {
|
||||
this.formData.stationId = res.rows[0].id;
|
||||
let pwoJobCd = {
|
||||
code: this.formData.pwoJobCode
|
||||
}
|
||||
listPwoJob(pwoJobCd).then(res => {
|
||||
this.formData.pwoJobId = res.rows[0].id;
|
||||
this.$modal.loading('提交中')
|
||||
addCustomizeEsop(this.formData).then(response => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("提交成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
791
pages/index.vue
Normal file
791
pages/index.vue
Normal file
@@ -0,0 +1,791 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<scroll-view class="data_body" scroll-y style="height:100%">
|
||||
<view class="view_item">
|
||||
<view class="progress_circle">
|
||||
<view v-for="(item,index) in CircleData" :key="index" :class="['progress_block','block_'+index]">
|
||||
<view class="name">{{item.series[0].name}}</view>
|
||||
<!-- <view class="value">{{item.series[0].value}}</view> -->
|
||||
<view class="charts-box arcbar" style="height: 180rpx;width: 60%;">
|
||||
<qiun-data-charts type="arcbar" :chartData="item" :canvas2d="canvas2d"
|
||||
:canvasId="'four_a_'+index" :resshow="delayload"
|
||||
:opts="{title:{name:item.series[0].precent,color:item.series[0].color,fontSize:15},subtitle:{name:'',color:'#666666',fontSize:12},extra:{arcbar:{backgroundColor:item.series[0].backgroundColor}}}" />
|
||||
</view>
|
||||
<view class="planet">
|
||||
<view class="planet_shadow"></view>
|
||||
<view class="crater1"></view>
|
||||
<view class="crater2"></view>
|
||||
<view class="crater3"></view>
|
||||
<view class="crater4"></view>
|
||||
</view>
|
||||
<view class="star" :class="['star'+index]"></view>
|
||||
<view class="star pink" :class="['star'+index]"></view>
|
||||
<view class="star blue" :class="['star'+index]"></view>
|
||||
<view class="star yellow" :class="['star'+index]"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="split_line"></view>
|
||||
<view class="friend_operate">
|
||||
<view class="title">工单状态分布
|
||||
</view>
|
||||
<view v-if="delayload" class="charts-box" style="">
|
||||
<qiun-data-charts type="ring" canvasId="four_b" :canvas2d="canvas2d" :resshow="delayload"
|
||||
:opts="{legend:{position: 'bottom'},title:{name: '',},subtitle: {name: ''},extra:{ring:{customRadius:'55'}}}"
|
||||
:chartData="ProductRateData" style="height: 350px;" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="split_line"></view>
|
||||
<!--概览-->
|
||||
<view class="friend_operate">
|
||||
<text-block :content="CardData"></text-block>
|
||||
</view>
|
||||
<view class="friend_operate">
|
||||
<view class="title">本周报工产量</view>
|
||||
<view v-if="delayload" class="charts-box" style="height: 300px;">
|
||||
<qiun-data-charts type="line" canvasId="four_c" :canvas2d="canvas2d" :resshow="delayload"
|
||||
:chartData="TrendData" />
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import CircleData from "./json/user-server/1.json"
|
||||
import {
|
||||
listPwo,
|
||||
listPo,
|
||||
listReport,
|
||||
reportRate
|
||||
} from '@/api/mes/pwoDraw.js'
|
||||
import {
|
||||
getWeekReport,
|
||||
getPwoStatus,
|
||||
getProduceReport,
|
||||
} from '@/api/mes/jobIn.js'
|
||||
export default {
|
||||
mounted() {
|
||||
uni.showLoading();
|
||||
//获取饼图数据
|
||||
this.getStatus();
|
||||
this.getReport();
|
||||
this.getNum();
|
||||
this.getRate();
|
||||
setTimeout(() => {
|
||||
this.delayload = true;
|
||||
uni.hideLoading();
|
||||
}, 1000)
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: new Date(),
|
||||
CircleData: CircleData,
|
||||
ProductRateData: {},
|
||||
TrendData: [],
|
||||
CardData: [],
|
||||
isRank: true,
|
||||
canvas2d: this.$config.ISCANVAS2D,
|
||||
delayload: false, //延时加载图表,否则会出现图表加载完后定位错乱
|
||||
//饼图数据
|
||||
status1: 0,
|
||||
status2: 0,
|
||||
status3: 0,
|
||||
status4: 0,
|
||||
status5: 0,
|
||||
status6: 0,
|
||||
status7: 0,
|
||||
status8: 0,
|
||||
status9: 0,
|
||||
status10: 0,
|
||||
status11: 0,
|
||||
status12: 0,
|
||||
status13: 0,
|
||||
//卡片数据
|
||||
dayAddedPo: 0,
|
||||
dayAddedPwo: 0,
|
||||
dayAddedReport: 0,
|
||||
dayAvgQltyRate: 0,
|
||||
//折线图数据
|
||||
data: [
|
||||
0, 0, 0, 0, 0, 0, 0,
|
||||
],
|
||||
finishValue: 0,
|
||||
defectValue: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reset() {
|
||||
this.status1 = 0;
|
||||
this.status2 = 0;
|
||||
this.status3 = 0;
|
||||
this.status4 = 0;
|
||||
this.status5 = 0;
|
||||
this.status6 = 0;
|
||||
this.status7 = 0;
|
||||
this.status8 = 0;
|
||||
this.status9 = 0;
|
||||
this.status10 = 0;
|
||||
this.status11 = 0;
|
||||
this.status12 = 0;
|
||||
this.status13 = 0;
|
||||
this.dayAddedPo = 0;
|
||||
this.dayAddedPwo = 0;
|
||||
this.dayAddedReport = 0;
|
||||
this.data = [0, 0, 0, 0, 0, 0, 0];
|
||||
},
|
||||
getTime() {
|
||||
var year = this.value.getFullYear() // 年
|
||||
var month = this.value.getMonth() + 1 < 10 ? "0" + (this.value.getMonth() + 1) : this.value.getMonth() + 1;
|
||||
var day = this.value.getDate() < 10 ? "0" + this.value.getDate() : this.value.getDate();
|
||||
var currentTime = year + '-' + month + '-' + day;
|
||||
return currentTime;
|
||||
},
|
||||
async getStatus() {
|
||||
this.reset();
|
||||
await getPwoStatus().then((resp) => {
|
||||
let data = resp.data;
|
||||
this.status1 = data.status1 ? data.status1 : 0;
|
||||
this.status2 = data.status2 ? data.status2 : 0;
|
||||
this.status3 = data.status3 ? data.status3 : 0;
|
||||
this.status4 = data.status4 ? data.status4 : 0;
|
||||
this.status5 = data.status5 ? data.status5 : 0;
|
||||
this.status6 = data.status6 ? data.status6 : 0;
|
||||
this.status7 = data.status7 ? data.status7 : 0;
|
||||
this.status8 = data.status8 ? data.status8 : 0;
|
||||
this.status9 = data.status9 ? data.status9 : 0;
|
||||
this.status10 = data.status10 ? data.status10 : 0;
|
||||
this.status11 = data.status11 ? data.status11 : 0;
|
||||
this.status12 = data.status12 ? data.status12 : 0;
|
||||
this.status13 = data.status13 ? data.status13 : 0;
|
||||
});
|
||||
this.getBarData();
|
||||
},
|
||||
getBarData() {
|
||||
this.ProductRateData = {
|
||||
"series": [{
|
||||
"name": "计划中",
|
||||
"data": this.status1,
|
||||
"color": "#2fc25b"
|
||||
},
|
||||
{
|
||||
"name": "已生成作业",
|
||||
"data": this.status2,
|
||||
"color": "#facc14"
|
||||
},
|
||||
{
|
||||
"name": "已投料",
|
||||
"data": this.status3,
|
||||
"color": "#f04864"
|
||||
},
|
||||
{
|
||||
"name": "已领料",
|
||||
"data": this.status4,
|
||||
"color": "#8543e0"
|
||||
},
|
||||
{
|
||||
"name": "已开工",
|
||||
"data": this.status5,
|
||||
"color": "#51c2d5"
|
||||
},
|
||||
{
|
||||
"name": "暂停",
|
||||
"data": this.status6,
|
||||
"color": "#C8AB7E"
|
||||
}, {
|
||||
"name": "已完成",
|
||||
"data": this.status7,
|
||||
"color": "#81A1C6"
|
||||
}, {
|
||||
"name": "已领料",
|
||||
"data": this.status8,
|
||||
"color": "#C185BB"
|
||||
}, {
|
||||
"name": "结案",
|
||||
"data": this.status9,
|
||||
"color": "#4BA2FB"
|
||||
}, {
|
||||
"name": "取消",
|
||||
"data": this.status1,
|
||||
"color": "#98AFA7"
|
||||
}, {
|
||||
"name": "待入库",
|
||||
"data": this.status10,
|
||||
"color": "#9DD86E"
|
||||
}, {
|
||||
"name": "待转出",
|
||||
"data": this.status11,
|
||||
"color": "#DE68C4"
|
||||
}, {
|
||||
"name": "已转出",
|
||||
"data": this.status12,
|
||||
"color": "#BF2A39"
|
||||
}, {
|
||||
"name": "其他",
|
||||
"data": this.status13,
|
||||
"color": "#266186"
|
||||
},
|
||||
]
|
||||
}
|
||||
console.log(this.ProductRateData)
|
||||
},
|
||||
async getReport() {
|
||||
await getWeekReport().then(async res => {
|
||||
var now = new Date();
|
||||
var today = now.getDay();
|
||||
//获取当前时间所在的周一的日期
|
||||
const startOfWeek = new Date(
|
||||
now.getFullYear(),
|
||||
now.getMonth(),
|
||||
now.getDate() - (today === 0 ? 6 : today - 1)
|
||||
);
|
||||
// 当前周的结束日
|
||||
const endOfWeek = new Date(
|
||||
startOfWeek.getTime() + 7 * 24 * 60 * 60 * 1000
|
||||
);
|
||||
//将所有属于当前周的数据都存入新的数组里
|
||||
const dataThisWeek = res.data
|
||||
.filter((item) => {
|
||||
const date = new Date(item.createTime);
|
||||
return date >= startOfWeek && date < endOfWeek;
|
||||
})
|
||||
.map((item) => {
|
||||
// 获取星期几,值为 0(周日)到 6(周六)
|
||||
const dayOfWeek = new Date(item.createTime).getDay();
|
||||
// 将数字转换为中文星期表示
|
||||
const dayOfWeekStr = [0, 1, 2, 3, 4, 5, 6][dayOfWeek];
|
||||
// 将星期几加入原始数据中
|
||||
return {
|
||||
...item,
|
||||
dayOfWeek: dayOfWeekStr
|
||||
};
|
||||
});
|
||||
for (var i = 0; i < dataThisWeek.length; i++) {
|
||||
switch (dataThisWeek[i].dayOfWeek) {
|
||||
case 0:
|
||||
this.data[6] += dataThisWeek[i].reportNumber;
|
||||
break;
|
||||
case 1:
|
||||
this.data[0] += dataThisWeek[i].reportNumber;
|
||||
break;
|
||||
case 2:
|
||||
this.data[1] += dataThisWeek[i].reportNumber;
|
||||
break;
|
||||
case 3:
|
||||
this.data[2] += dataThisWeek[i].reportNumber;
|
||||
break;
|
||||
case 4:
|
||||
this.data[3] += dataThisWeek[i].reportNumber;
|
||||
break;
|
||||
case 5:
|
||||
this.data[4] += dataThisWeek[i].reportNumber;
|
||||
break;
|
||||
case 6:
|
||||
this.data[5] += dataThisWeek[i].reportNumber;
|
||||
break;
|
||||
default:
|
||||
this.reset();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.getLineData();
|
||||
},
|
||||
getLineData() {
|
||||
// 获取坐标轴刻度最大值
|
||||
const maxVal = Number(Math.max(...this.data));
|
||||
this.TrendData = {
|
||||
"categories": [
|
||||
"周一",
|
||||
"周二",
|
||||
"周三",
|
||||
"周四",
|
||||
"周五",
|
||||
"周六",
|
||||
"周日"
|
||||
],
|
||||
"series": [{
|
||||
"name": "报工产量",
|
||||
"data": this.data,
|
||||
"type": "line",
|
||||
"style": "curve",
|
||||
"addPoint": true,
|
||||
"color": "#DF297D",
|
||||
"unit": ""
|
||||
}],
|
||||
"yAxis": {
|
||||
"calibration": true,
|
||||
"position": "left",
|
||||
"min": 0,
|
||||
"max": maxVal,
|
||||
"title": "产量",
|
||||
"titleFontSize": 12,
|
||||
"unit": "",
|
||||
"tofix": 0
|
||||
},
|
||||
"targetAdd": "9%"
|
||||
}
|
||||
},
|
||||
async getNum() {
|
||||
this.reset();
|
||||
getProduceReport().then((resp) => {
|
||||
let data = resp.data;
|
||||
this.dayAddedPo = data.todayAddedPo;
|
||||
this.dayAddedPwo = data.todayAddedPwo;
|
||||
this.dayAddedReport = data.todayAddedReport;
|
||||
});
|
||||
const currentDate = new Date();
|
||||
let endTime = this.getTime(currentDate);
|
||||
//获取过去30天
|
||||
const oldDate = new Date();
|
||||
oldDate.setDate(currentDate.getDate() - 30);
|
||||
let startTime = this.getTime(oldDate);
|
||||
|
||||
await reportRate({
|
||||
mesPwoReportType: '2',
|
||||
queryStartTime: startTime,
|
||||
queryEndTime: endTime,
|
||||
}).then((result) => {
|
||||
console.log(result);
|
||||
this.dayAvgQltyRate = result.data;
|
||||
});
|
||||
// //列出订单数量
|
||||
// listPo().then(res => {
|
||||
// for (var i = 0; i < res.rows.length; i++) {
|
||||
// if (this.getTime() == (res.rows[i].createTime === undefined ? '' : res.rows[i]
|
||||
// .createTime.slice(0, 10))) {
|
||||
// this.dayAddedPo++;
|
||||
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// //列出报工数量
|
||||
// listReport().then(res => {
|
||||
// for (var i = 0; i < res.rows.length; i++) {
|
||||
// if (this.getTime() == (res.rows[i].createTime === undefined ? '' : res.rows[i]
|
||||
// .createTime.slice(0, 10))) {
|
||||
// this.dayAddedReport++;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
this.getCardData();
|
||||
},
|
||||
getCardData() {
|
||||
//卡片赋值
|
||||
this.CardData = [{
|
||||
"kind": 4,
|
||||
"background": ["#0081ff", "#1cbbb4"],
|
||||
"content": [{
|
||||
"text": "当日新增生产订单",
|
||||
"value": "",
|
||||
"colortext": "#fff",
|
||||
"colorvalue": "",
|
||||
"size": "24rpx"
|
||||
},
|
||||
{
|
||||
"text": "",
|
||||
"value": this.dayAddedPo,
|
||||
"colortext": "",
|
||||
"colorvalue": "#fff",
|
||||
"size": "44rpx"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": 4,
|
||||
"background": ["#0081ff", "#1cbbb4"],
|
||||
"content": [{
|
||||
"text": "当日新增生产工单",
|
||||
"value": "",
|
||||
"colortext": "#fff",
|
||||
"colorvalue": "",
|
||||
"size": "24rpx"
|
||||
},
|
||||
{
|
||||
"text": "",
|
||||
"value": this.dayAddedPwo,
|
||||
"colortext": "",
|
||||
"colorvalue": "#fff",
|
||||
"size": "44rpx"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": 4,
|
||||
"background": ["#0081ff", "#1cbbb4"],
|
||||
"content": [{
|
||||
"text": "当日报工次数",
|
||||
"value": "",
|
||||
"colortext": "#fff",
|
||||
"colorvalue": "",
|
||||
"size": "24rpx"
|
||||
},
|
||||
{
|
||||
"text": "",
|
||||
"value": this.dayAddedReport,
|
||||
"colortext": "",
|
||||
"colorvalue": "#fff",
|
||||
"size": "44rpx"
|
||||
},
|
||||
]
|
||||
}, {
|
||||
"kind": 4,
|
||||
"background": ["#0081ff", "#1cbbb4"],
|
||||
"content": [{
|
||||
"text": "当日平均质量合格率",
|
||||
"value": "",
|
||||
"colortext": "#fff",
|
||||
"colorvalue": "",
|
||||
"size": "24rpx"
|
||||
},
|
||||
{
|
||||
"text": "",
|
||||
"value": this.dayAvgQltyRate,
|
||||
"colortext": "",
|
||||
"colorvalue": "#fff",
|
||||
"size": "44rpx"
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
async getRate() {
|
||||
this.finishValue = 0;
|
||||
this.defectValue = 0;
|
||||
//当前日期
|
||||
// const currentDate = this.getTime();
|
||||
let endTime = this.getTime();
|
||||
const oldDate = this.value;
|
||||
oldDate.setDate(this.value.getDate() - 30);
|
||||
const year = oldDate.getFullYear();
|
||||
const month = String(oldDate.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(oldDate.getDate()).padStart(2, '0');
|
||||
let startTime = `${year}-${month}-${day}`;
|
||||
|
||||
await reportRate({
|
||||
mesPwoReportType: '3',
|
||||
queryStartTime: startTime,
|
||||
queryEndTime: endTime,
|
||||
}).then((result) => {
|
||||
this.finishValue = result.data;
|
||||
});
|
||||
|
||||
await reportRate({
|
||||
mesPwoReportType: '2',
|
||||
queryStartTime: startTime,
|
||||
queryEndTime: endTime,
|
||||
}).then((result) => {
|
||||
this.defectValue = result.data;
|
||||
});
|
||||
|
||||
this.getCircleData();
|
||||
},
|
||||
getCircleData() {
|
||||
const data1 = this.finishValue.toFixed(0) * 0.01;
|
||||
const data2 = this.defectValue.toFixed(0) * 0.01;
|
||||
this.CircleData = [{
|
||||
"series": [{
|
||||
"color": "#fff",
|
||||
"data": data1,
|
||||
"precent": this.finishValue.toFixed(0) + "%",
|
||||
"index": 0,
|
||||
"legendShape": "circle",
|
||||
"name": "工单完成率",
|
||||
"pointShape": "circle",
|
||||
"show": true,
|
||||
"type": "arcbar",
|
||||
// "value": "12786",
|
||||
"backgroundColor": "#00AEF9"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"series": [{
|
||||
"color": "#fff",
|
||||
"data": data2,
|
||||
"precent": this.defectValue.toFixed(0) + "%",
|
||||
"index": 0,
|
||||
"legendShape": "circle",
|
||||
"name": "工单良品率",
|
||||
"pointShape": "circle",
|
||||
"show": true,
|
||||
"type": "arcbar",
|
||||
// "value": "1096",
|
||||
"backgroundColor": "#F55676"
|
||||
}]
|
||||
}
|
||||
|
||||
]
|
||||
console.log(this.CircleData)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.content {
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
|
||||
.data_body {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
color: #333333;
|
||||
background-repeat: repeat;
|
||||
background-color: #ffffff;
|
||||
|
||||
.friend_operate {
|
||||
padding: 30rpx 20rpx;
|
||||
|
||||
.title {
|
||||
text-align: left;
|
||||
margin-bottom: 30rpx;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.view_item {
|
||||
padding: 30rpx 20rpx;
|
||||
padding-top: 30px;
|
||||
|
||||
.title {
|
||||
text-align: left;
|
||||
margin-bottom: 30rpx;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.progress_circle {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
// height: 450rpx;
|
||||
|
||||
.progress_block {
|
||||
width: 45%;
|
||||
border-radius: 20rpx;
|
||||
height: 180rpx;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
.name {
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
left: 10rpx;
|
||||
max-width: 144rpx;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #fff;
|
||||
font-size: 40rpx;
|
||||
position: absolute;
|
||||
top: 64rpx;
|
||||
left: 10rpx;
|
||||
max-width: 144rpx;
|
||||
}
|
||||
|
||||
.circle {
|
||||
position: absolute;
|
||||
right: 8rpx;
|
||||
top: 16rpx;
|
||||
}
|
||||
|
||||
.arcbar {
|
||||
position: absolute;
|
||||
right: -4rpx;
|
||||
top: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.block_0 {
|
||||
background-color: #0FC3FF;
|
||||
}
|
||||
|
||||
.block_1 {
|
||||
background-color: #FF6B8B;
|
||||
}
|
||||
|
||||
.block_2 {
|
||||
background-color: #FFCB1D;
|
||||
}
|
||||
|
||||
.block_3 {
|
||||
background-color: #3BDCAA;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.planet {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 50%;
|
||||
background: #333;
|
||||
position: absolute;
|
||||
left: -13px;
|
||||
bottom: -26px;
|
||||
overflow: hidden;
|
||||
opacity: 0.5;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.planet_shadow {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
top: -40%;
|
||||
right: -10%;
|
||||
border: 35px solid rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.crater1,
|
||||
.crater2,
|
||||
.crater3,
|
||||
.crater4 {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
background: rgba(0, 0, 0, .3);
|
||||
box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .2);
|
||||
}
|
||||
|
||||
.crater1 {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
left: 25%;
|
||||
top: 20%;
|
||||
}
|
||||
|
||||
.crater2 {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
left: 50%;
|
||||
top: 60%;
|
||||
}
|
||||
|
||||
.crater3 {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
left: 30%;
|
||||
top: 65%;
|
||||
}
|
||||
|
||||
.crater4 {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
left: 60%;
|
||||
top: 35%;
|
||||
}
|
||||
|
||||
.star {
|
||||
display: block;
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
border-radius: 50%;
|
||||
background: #FFF;
|
||||
top: 10px;
|
||||
left: 50px;
|
||||
position: relative;
|
||||
transform-origin: 100% 0;
|
||||
box-shadow: 0 0 5px 5px rgba(255, 255, 255, .3);
|
||||
opacity: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.star0 {
|
||||
animation: star-ani 4s infinite ease-out;
|
||||
}
|
||||
|
||||
.star1 {
|
||||
animation: star-ani 5s infinite ease-out;
|
||||
}
|
||||
|
||||
.star2 {
|
||||
animation: star-ani 6s infinite ease-out;
|
||||
}
|
||||
|
||||
.star3 {
|
||||
animation: star-ani 7s infinite ease-out;
|
||||
}
|
||||
|
||||
.star:after {
|
||||
content: '';
|
||||
display: block;
|
||||
top: 20px;
|
||||
left: 60px;
|
||||
border: 0px solid #fff;
|
||||
border-width: 0px 90px 2px 90px;
|
||||
border-color: transparent transparent transparent rgba(255, 255, 255, .3);
|
||||
transform: rotate(-45deg) translate3d(1px, 3px, 0);
|
||||
box-shadow: 0 0 1px 0 rgba(255, 255, 255, .1);
|
||||
transform-origin: 0% 100%;
|
||||
animation: shooting-ani 100s infinite ease-out;
|
||||
}
|
||||
|
||||
.pink {
|
||||
top: 10px;
|
||||
left: 60px;
|
||||
background: #ff5a99;
|
||||
animation-delay: 5s;
|
||||
-webkit-animation-delay: 5s;
|
||||
-moz-animation-delay: 5s;
|
||||
}
|
||||
|
||||
.pink:after {
|
||||
border-color: transparent transparent transparent #ff5a99;
|
||||
animation-delay: 5s;
|
||||
-webkit-animation-delay: 5s;
|
||||
-moz-animation-delay: 5s;
|
||||
}
|
||||
|
||||
.blue {
|
||||
top: 15px;
|
||||
left: 70px;
|
||||
background: cyan;
|
||||
animation-delay: 7s;
|
||||
-webkit-animation-delay: 7s;
|
||||
-moz-animation-delay: 7s;
|
||||
}
|
||||
|
||||
.blue:after {
|
||||
border-color: 'transpareanimation-delay: 12s';
|
||||
-webkit-animation-delay: 7s;
|
||||
-moz-animation-delay: 7s;
|
||||
animation-delay: 7s;
|
||||
}
|
||||
|
||||
.yellow {
|
||||
top: 0px;
|
||||
left: 80px;
|
||||
background: #ffcd5c;
|
||||
animation-delay: 5.8s;
|
||||
}
|
||||
|
||||
.yellow:after {
|
||||
border-color: transparent transparent transparent #ffcd5c;
|
||||
animation-delay: 5.8s;
|
||||
}
|
||||
|
||||
@keyframes star-ani {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: scale(0) rotate(0) translate3d(0, 0, 0);
|
||||
-webkit-transform: scale(0) rotate(0) translate3d(0, 0, 0);
|
||||
-moz-transform: scale(0) rotate(0) translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 0.5;
|
||||
transform: scale(1) rotate(0) translate3d(-20px, 20px, 0);
|
||||
-webkit-transform: scale(1) rotate(0) translate3d(-20px, 20px, 0);
|
||||
-moz-transform: scale(1) rotate(0) translate3d(-20px, 20px, 0);
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
transform: scale(1) rotate(0) translate3d(-30px, 30px, 0);
|
||||
-webkit-transform: scale(1) rotate(0) translate3d(-30px, 30px, 0);
|
||||
-moz-transform: scale(1) rotate(0) translate3d(-30px, 30px, 0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
68
pages/json/finance/1.json
Normal file
68
pages/json/finance/1.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"expend":{
|
||||
"categories": [
|
||||
"1月",
|
||||
"2月",
|
||||
"2月",
|
||||
"4月",
|
||||
"5月"
|
||||
],
|
||||
"series": [
|
||||
{
|
||||
"name": "支出情况",
|
||||
"data": [1201,2501.5,985,1760,2013.85],
|
||||
"type": "line",
|
||||
"style": "curve",
|
||||
"color": "#4ECDB6",
|
||||
"unit":""
|
||||
}
|
||||
],
|
||||
"yAxis":[
|
||||
{"calibration":true,"position":"left","title":"单位/元","titleFontSize":12,"unit":"","tofix":0,"min":0,"disableGrid":true}
|
||||
]
|
||||
},
|
||||
"income":{
|
||||
"categories": [
|
||||
"1月",
|
||||
"2月",
|
||||
"2月",
|
||||
"4月",
|
||||
"5月"
|
||||
],
|
||||
"series": [
|
||||
{
|
||||
"name": "收入情况",
|
||||
"data": [1601,1840.5,1900,1760,1500.85],
|
||||
"type": "line",
|
||||
"style": "curve",
|
||||
"color": "#4ECDB6",
|
||||
"unit":""
|
||||
}
|
||||
],
|
||||
"yAxis":[
|
||||
{"calibration":true,"position":"left","title":"单位/元","titleFontSize":12,"unit":"","tofix":0,"min":0,"disableGrid":true}
|
||||
]
|
||||
},
|
||||
"remaining":{
|
||||
"categories": [
|
||||
"1月",
|
||||
"2月",
|
||||
"2月",
|
||||
"4月",
|
||||
"5月"
|
||||
],
|
||||
"series": [
|
||||
{
|
||||
"name": "结余情况",
|
||||
"data": [815,712.5,378,450,600.85],
|
||||
"type": "line",
|
||||
"style": "curve",
|
||||
"color": "#4ECDB6",
|
||||
"unit":""
|
||||
}
|
||||
],
|
||||
"yAxis":[
|
||||
{"calibration":true,"position":"left","title":"单位/元","titleFontSize":12,"unit":"","tofix":0,"min":0,"disableGrid":true}
|
||||
]
|
||||
}
|
||||
}
|
||||
33
pages/json/finance/2.json
Normal file
33
pages/json/finance/2.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"series": [
|
||||
{
|
||||
"data":[
|
||||
{
|
||||
"name": "住房相关",
|
||||
"value": 3200,
|
||||
"color":"#4DCCB3"
|
||||
},
|
||||
{
|
||||
"name": "食品酒水",
|
||||
"value": 1020,
|
||||
"color":"#5A77EC"
|
||||
},
|
||||
{
|
||||
"name": "娱乐休闲",
|
||||
"value": 500,
|
||||
"color":"#4E94EC"
|
||||
},
|
||||
{
|
||||
"name": "交流通讯",
|
||||
"value": 214.5,
|
||||
"color":"#4FD4EB"
|
||||
},
|
||||
{
|
||||
"name": "其他",
|
||||
"value": 320.13,
|
||||
"color":"#B5ED21"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
26
pages/json/school/1.json
Normal file
26
pages/json/school/1.json
Normal file
@@ -0,0 +1,26 @@
|
||||
[
|
||||
{
|
||||
"name":"课题研究",
|
||||
"num":500,
|
||||
"width":"",
|
||||
"background":"#FFBE68"
|
||||
},
|
||||
{
|
||||
"name":"论文发布",
|
||||
"num":300,
|
||||
"width":"",
|
||||
"background":"#0FEBE1"
|
||||
},
|
||||
{
|
||||
"name":"实践研究",
|
||||
"num":455,
|
||||
"width":"",
|
||||
"background":"#BF8DFC"
|
||||
},
|
||||
{
|
||||
"name":"评教",
|
||||
"num":601,
|
||||
"width":"",
|
||||
"background":"#FF859C"
|
||||
}
|
||||
]
|
||||
28
pages/json/school/2.json
Normal file
28
pages/json/school/2.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"series": [
|
||||
{
|
||||
"data":[
|
||||
{
|
||||
"name": "本科",
|
||||
"value": 168,
|
||||
"color":"#FFBF31"
|
||||
},
|
||||
{
|
||||
"name": "大专",
|
||||
"value": 144,
|
||||
"color":"#3CEFC4"
|
||||
},
|
||||
{
|
||||
"name": "博士",
|
||||
"value": 123,
|
||||
"color":"#FFA9B3"
|
||||
},
|
||||
{
|
||||
"name": "硕士",
|
||||
"value": 96,
|
||||
"color":"#3CBBFF"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
27
pages/json/school/3.json
Normal file
27
pages/json/school/3.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"categories":["语文","数学","英语","物理","化学","生物"],
|
||||
"series":[
|
||||
{
|
||||
"name":"一班",
|
||||
"area":[123.45,234,192.5,245],
|
||||
"color":"#1890ff",
|
||||
"data":[90,110,165,195,187,172],
|
||||
"index":0,
|
||||
"legendShape":"circle",
|
||||
"pointShape":"",
|
||||
"show": true,
|
||||
"type": "radar"
|
||||
},
|
||||
{
|
||||
"name":"二班",
|
||||
"area":[192.5,234,261.55,245],
|
||||
"color":"#2fc25b",
|
||||
"data":[190,210,105,35,27,102],
|
||||
"index":0,
|
||||
"legendShape":"circle",
|
||||
"pointShape":"",
|
||||
"show": true,
|
||||
"type": "radar"
|
||||
}
|
||||
]
|
||||
}
|
||||
29
pages/json/school/4.json
Normal file
29
pages/json/school/4.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"categories": [
|
||||
"1",
|
||||
"2",
|
||||
"2",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12"
|
||||
],
|
||||
"series": [
|
||||
{
|
||||
"name": "图书借阅人数",
|
||||
"data": [6,8,9,8.2,7.5,9,10.3,8,12,6.2,7.2,4.5],
|
||||
"type": "line",
|
||||
"style": "curve",
|
||||
"color": "#A800FB",
|
||||
"unit":""
|
||||
}
|
||||
],
|
||||
"yAxis":[
|
||||
{"calibration":true,"position":"left","title":"单位/千","titleFontSize":12,"unit":"","tofix":0,"min":0,"max":20,"disableGrid":true}
|
||||
]
|
||||
}
|
||||
80
pages/json/sport/1.json
Normal file
80
pages/json/sport/1.json
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"series": [{
|
||||
"name": "激活放松",
|
||||
"color": "#FDEC9F",
|
||||
"data": [
|
||||
["17:24", 75],
|
||||
["17:26", 83],
|
||||
["17:28", 88],
|
||||
["17:30", 92]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "动态热身",
|
||||
"color": "#FBCD2B",
|
||||
"data": [
|
||||
["17:30", 92],
|
||||
["17:32", 96],
|
||||
["17:34", 94],
|
||||
["17:36", 93.5],
|
||||
["17:38", 94.6],
|
||||
["17:40", 98]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "糖分消耗",
|
||||
"color": "#FC9E83",
|
||||
"data": [
|
||||
["17:40", 98],
|
||||
["17:42", 100],
|
||||
["17:44", 104],
|
||||
["17:46", 113],
|
||||
["17:48", 142]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "脂肪燃烧",
|
||||
"color": "#EF6DCF",
|
||||
"data": [
|
||||
["17:48", 142],
|
||||
["17:50", 130],
|
||||
["17:52", 134],
|
||||
["17:54", 150],
|
||||
["17:56", 148],
|
||||
["17:58", 142],
|
||||
["18:00", 132],
|
||||
["18:02", 136],
|
||||
["18:04", 136.5]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "心肺训练",
|
||||
"color": "#BC38E5",
|
||||
"data": [
|
||||
["18:04", 136.5],
|
||||
["18:06", 140],
|
||||
["18:08", 135],
|
||||
["18:10", 130],
|
||||
["18:12", 124],
|
||||
["18:14", 120],
|
||||
["18:16", 118],
|
||||
["18:18", 116.5],
|
||||
["18:20", 112]
|
||||
]
|
||||
}, {
|
||||
"name": "极限锻炼",
|
||||
"color": "#8908FA",
|
||||
"data": [
|
||||
["18:20", 112],
|
||||
["18:22", 123],
|
||||
["18:24", 130],
|
||||
["18:26", 138],
|
||||
["18:28", 116],
|
||||
["18:30", 123],
|
||||
["18:32", 128],
|
||||
["18:34", 126],
|
||||
["18:36", 137]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
38
pages/json/sport/2.json
Normal file
38
pages/json/sport/2.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"series": [
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"name": "激活放松",
|
||||
"value": 5,
|
||||
"color": "#FDEC9F"
|
||||
},
|
||||
{
|
||||
"name": "动态热身",
|
||||
"value": 13,
|
||||
"color": "#FBCD2B"
|
||||
},
|
||||
{
|
||||
"name": "糖分消耗",
|
||||
"value": 8,
|
||||
"color": "#FC9E83"
|
||||
},
|
||||
{
|
||||
"name": "脂肪燃烧",
|
||||
"value": 24,
|
||||
"color": "#EF6DCF"
|
||||
},
|
||||
{
|
||||
"name": "心肺训练",
|
||||
"value": 7,
|
||||
"color": "#BC38E5"
|
||||
},
|
||||
{
|
||||
"name": "极限锻炼",
|
||||
"value": 16,
|
||||
"color": "#8908FA"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
22
pages/json/sport/3.json
Normal file
22
pages/json/sport/3.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"categories": [
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5"
|
||||
],
|
||||
"series": [
|
||||
{
|
||||
"name": "公里配速",
|
||||
"data": [
|
||||
5.09,
|
||||
6.18,
|
||||
6.38,
|
||||
7.15,
|
||||
9.05
|
||||
],
|
||||
"color":"#FFD597"
|
||||
}
|
||||
]
|
||||
}
|
||||
174
pages/json/sport/4.json
Normal file
174
pages/json/sport/4.json
Normal file
@@ -0,0 +1,174 @@
|
||||
{
|
||||
"series": [
|
||||
{
|
||||
"name": "速度",
|
||||
"color": "#1C9862",
|
||||
"index":0,
|
||||
"data": [
|
||||
[
|
||||
"17:24",
|
||||
0
|
||||
],
|
||||
[
|
||||
"17:26",
|
||||
1
|
||||
],
|
||||
[
|
||||
"17:28",
|
||||
1.2
|
||||
],
|
||||
[
|
||||
"17:30",
|
||||
1.6
|
||||
],
|
||||
[
|
||||
"17:32",
|
||||
1.8
|
||||
],
|
||||
[
|
||||
"17:34",
|
||||
2
|
||||
],
|
||||
[
|
||||
"17:36",
|
||||
4
|
||||
],
|
||||
[
|
||||
"17:38",
|
||||
6.5
|
||||
],
|
||||
[
|
||||
"17:40",
|
||||
10
|
||||
],
|
||||
[
|
||||
"17:42",
|
||||
13.4
|
||||
],
|
||||
[
|
||||
"17:44",
|
||||
13
|
||||
],
|
||||
[
|
||||
"17:46",
|
||||
12.6
|
||||
],
|
||||
[
|
||||
"17:48",
|
||||
12.2
|
||||
],
|
||||
[
|
||||
"17:50",
|
||||
14
|
||||
],
|
||||
[
|
||||
"17:52",
|
||||
16.8
|
||||
],
|
||||
[
|
||||
"17:54",
|
||||
20
|
||||
],
|
||||
[
|
||||
"17:56",
|
||||
25
|
||||
],
|
||||
[
|
||||
"17:58",
|
||||
23
|
||||
],
|
||||
[
|
||||
"18:00",
|
||||
16
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "心率",
|
||||
"index":1,
|
||||
"color": "#FBCD2B",
|
||||
"data": [
|
||||
[
|
||||
"17:24",
|
||||
72
|
||||
],
|
||||
[
|
||||
"17:26",
|
||||
73
|
||||
],
|
||||
[
|
||||
"17:28",
|
||||
73.5
|
||||
],
|
||||
[
|
||||
"17:30",
|
||||
74
|
||||
],
|
||||
[
|
||||
"17:32",
|
||||
76.5
|
||||
],
|
||||
[
|
||||
"17:34",
|
||||
78
|
||||
],
|
||||
[
|
||||
"17:36",
|
||||
80
|
||||
],
|
||||
[
|
||||
"17:38",
|
||||
76.3
|
||||
],
|
||||
[
|
||||
"17:40",
|
||||
75
|
||||
],
|
||||
[
|
||||
"17:42",
|
||||
86
|
||||
],
|
||||
[
|
||||
"17:44",
|
||||
84
|
||||
],
|
||||
[
|
||||
"17:46",
|
||||
90
|
||||
],
|
||||
[
|
||||
"17:48",
|
||||
100
|
||||
],
|
||||
[
|
||||
"17:50",
|
||||
112
|
||||
],
|
||||
[
|
||||
"17:52",
|
||||
125
|
||||
],
|
||||
[
|
||||
"17:54",
|
||||
117
|
||||
],
|
||||
[
|
||||
"17:56",
|
||||
110
|
||||
],
|
||||
[
|
||||
"17:58",
|
||||
108
|
||||
],
|
||||
[
|
||||
"18:00",
|
||||
104
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"yAxis":[
|
||||
{"calibration":true,"position":"left","title":"","titleFontSize":12,"unit":"","tofix":0,"min":0,"max":25,"disableGrid":true},
|
||||
{"calibration":true,"position":"right","title":"","titleFontSize":12,"unit":"","tofix":0,"min":0,"disableGrid":true}
|
||||
]
|
||||
}
|
||||
21
pages/json/user-healthy/1.json
Normal file
21
pages/json/user-healthy/1.json
Normal file
@@ -0,0 +1,21 @@
|
||||
[
|
||||
{
|
||||
"expect": "",
|
||||
"now": "",
|
||||
"name": "时间进度",
|
||||
"value": "60.12"
|
||||
},
|
||||
{
|
||||
"expect": "30000",
|
||||
"now": "36000",
|
||||
"dataType": "1",
|
||||
"name": "会员拉新",
|
||||
"value": "120"
|
||||
},
|
||||
{
|
||||
"expect": "",
|
||||
"now": "",
|
||||
"name": "扫码渗透率",
|
||||
"value": "35"
|
||||
}
|
||||
]
|
||||
34
pages/json/user-healthy/2.json
Normal file
34
pages/json/user-healthy/2.json
Normal file
@@ -0,0 +1,34 @@
|
||||
[
|
||||
{
|
||||
"kind":1,
|
||||
"background":["#B678FD","#4A64F9"],
|
||||
"content":[
|
||||
{"text":"","value":"1800","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"日均新增目标","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":1,
|
||||
"background":["#B678FD","#4A64F9"],
|
||||
"content":[
|
||||
{"text":"","value":"1960","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"当日新增会员","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":1,
|
||||
"background":["#B678FD","#4A64F9"],
|
||||
"content":[
|
||||
{"text":"","value":"36050","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"本月新增会员","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":1,
|
||||
"background":["#B678FD","#4A64F9"],
|
||||
"content":[
|
||||
{"text":"","value":"3%","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"日均环比","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}
|
||||
]
|
||||
}
|
||||
]
|
||||
74
pages/json/user-healthy/3.json
Normal file
74
pages/json/user-healthy/3.json
Normal file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"categories": [
|
||||
"1月11",
|
||||
"1月12",
|
||||
"1月11",
|
||||
"1月14",
|
||||
"1月15"
|
||||
],
|
||||
"series": [{
|
||||
"name": "新增会员数",
|
||||
"data": [{
|
||||
"value": 5,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": -3,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 3.5,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 10,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 2.8,
|
||||
"color": "#24ABFD"
|
||||
}
|
||||
],
|
||||
"type": "column",
|
||||
"color": "#24ABFD",
|
||||
"unit": "",
|
||||
"textNoShow": true
|
||||
},
|
||||
{
|
||||
"name": "当日达成率",
|
||||
"data": [
|
||||
101,
|
||||
91,
|
||||
97,
|
||||
131,
|
||||
109
|
||||
],
|
||||
"type": "line",
|
||||
"addPoint": true,
|
||||
"color": "#DF297D",
|
||||
"unit": "%",
|
||||
"index": 1
|
||||
},
|
||||
{
|
||||
"name": "日均达成率",
|
||||
"data": [
|
||||
102,
|
||||
92,
|
||||
96,
|
||||
115,
|
||||
105
|
||||
],
|
||||
"type": "line",
|
||||
"color": "#24ABFD",
|
||||
"unit": "%",
|
||||
"index": 1
|
||||
}
|
||||
],
|
||||
"yAxis": [{
|
||||
"max": 20,
|
||||
"min": 0
|
||||
}, {
|
||||
"max": 200,
|
||||
"min": 0
|
||||
}]
|
||||
}
|
||||
26
pages/json/user-healthy/4.json
Normal file
26
pages/json/user-healthy/4.json
Normal file
@@ -0,0 +1,26 @@
|
||||
[
|
||||
{
|
||||
"kind":1,
|
||||
"background":["#B678FD","#4A64F9"],
|
||||
"content":[
|
||||
{"text":"","value":"42%","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"当日扫码率","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":1,
|
||||
"background":["#B678FD","#4A64F9"],
|
||||
"content":[
|
||||
{"text":"","value":"37%","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"累计扫码率","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":2,
|
||||
"background":["#B678FD","#4A64F9"],
|
||||
"content":[
|
||||
{"text":"环比增长","value":"3.2%","colortext":"#fff","colorvalue":"#fff","size":"24rpx"},
|
||||
{"text":"同比增长","value":"1.1%","colortext":"#fff","colorvalue":"#fff","size":"24rpx"}
|
||||
]
|
||||
}
|
||||
]
|
||||
57
pages/json/user-healthy/5.json
Normal file
57
pages/json/user-healthy/5.json
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"categories": [
|
||||
"1月11",
|
||||
"1月12",
|
||||
"1月13",
|
||||
"1月14",
|
||||
"1月15"
|
||||
],
|
||||
"series": [{
|
||||
"name": "当天扫码率",
|
||||
"data": [
|
||||
39,
|
||||
34,
|
||||
36,
|
||||
45,
|
||||
38
|
||||
],
|
||||
"type": "line",
|
||||
"addPoint": true,
|
||||
"color": "#24ABFD",
|
||||
"unit": "%"
|
||||
},
|
||||
{
|
||||
"name": "累计扫码率",
|
||||
"data": [
|
||||
32,
|
||||
30,
|
||||
31,
|
||||
37,
|
||||
35
|
||||
],
|
||||
"type": "line",
|
||||
"addPoint": true,
|
||||
"color": "#DF297D",
|
||||
"unit": "%"
|
||||
},
|
||||
{
|
||||
"name": "目标扫码率",
|
||||
"data": [
|
||||
40,
|
||||
40,
|
||||
40,
|
||||
40,
|
||||
40
|
||||
],
|
||||
"type": "line",
|
||||
"color": "#FF9900",
|
||||
"textNoShow": true,
|
||||
"unit": ""
|
||||
}
|
||||
|
||||
],
|
||||
"yAxis": [{
|
||||
"max": 60,
|
||||
"min": 0
|
||||
}]
|
||||
}
|
||||
12
pages/json/user-healthy/6.json
Normal file
12
pages/json/user-healthy/6.json
Normal file
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"kind":3,
|
||||
"background":["#B678FD","#4A64F9"],
|
||||
"content":[
|
||||
{"text":"","value":"38%","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"小程序购买活跃会员占比","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"},
|
||||
{"text":"同比","value":"2.5%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"环比","value":"3.2%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}
|
||||
]
|
||||
}
|
||||
]
|
||||
89
pages/json/user-healthy/7.json
Normal file
89
pages/json/user-healthy/7.json
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"categories": [
|
||||
"1月11",
|
||||
"1月12",
|
||||
"1月11",
|
||||
"1月14",
|
||||
"1月15"
|
||||
],
|
||||
"series": [{
|
||||
"name": "新增会员数",
|
||||
"data": [{
|
||||
"value": 5,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": -3,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 3.5,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 10,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 2.8,
|
||||
"color": "#24ABFD"
|
||||
}
|
||||
],
|
||||
"type": "column",
|
||||
"color": "#24ABFD",
|
||||
"unit": "",
|
||||
"textNoShow": true
|
||||
},
|
||||
{
|
||||
"name": "当日达成率",
|
||||
"data": [
|
||||
101,
|
||||
91,
|
||||
97,
|
||||
131,
|
||||
109
|
||||
],
|
||||
"type": "line",
|
||||
"addPoint": true,
|
||||
"color": "#DF297D",
|
||||
"unit": "%",
|
||||
"index": 1
|
||||
},
|
||||
{
|
||||
"name": "日均达成率",
|
||||
"data": [
|
||||
102,
|
||||
92,
|
||||
96,
|
||||
115,
|
||||
105
|
||||
],
|
||||
"type": "line",
|
||||
"style": "curve",
|
||||
"color": "#ff9900",
|
||||
"unit": "%",
|
||||
"index": 1
|
||||
},
|
||||
{
|
||||
"name": "日均达成率",
|
||||
"data": [
|
||||
102,
|
||||
92,
|
||||
96,
|
||||
115,
|
||||
105
|
||||
],
|
||||
"type": "area",
|
||||
"color": "#ff9900",
|
||||
"unit": "%",
|
||||
"index": 1
|
||||
}
|
||||
],
|
||||
"yAxis": [{
|
||||
"max": 20,
|
||||
"min": 0
|
||||
}, {
|
||||
"max": 200,
|
||||
"min": 0
|
||||
}]
|
||||
}
|
||||
22
pages/json/user-operate/1.json
Normal file
22
pages/json/user-operate/1.json
Normal file
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{
|
||||
"expect": "",
|
||||
"now": "",
|
||||
"name": "时间进度",
|
||||
"value": "50.88"
|
||||
},
|
||||
{
|
||||
"expect": "54800",
|
||||
"now": "51000",
|
||||
"dataType": "1",
|
||||
"name": "新开会员",
|
||||
"value": "93.07"
|
||||
},
|
||||
{
|
||||
"expect": "30000",
|
||||
"now": "25600",
|
||||
"dataType": "1",
|
||||
"name": "新增消费会员",
|
||||
"value": "85.33"
|
||||
}
|
||||
]
|
||||
35
pages/json/user-operate/2.json
Normal file
35
pages/json/user-operate/2.json
Normal file
@@ -0,0 +1,35 @@
|
||||
[
|
||||
{
|
||||
"kind":5,
|
||||
"background":["#F77E89","#F7953B"],
|
||||
"content":[
|
||||
{"text":"扫一扫","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"},
|
||||
{"text":"","value":"63%","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"环比","value":"81.5%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"同比","value":"-81.3%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"平均参考水平","value":"85%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":5,
|
||||
"background":["#F77E89","#F7953B"],
|
||||
"content":[
|
||||
{"text":"二维码识别","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"},
|
||||
{"text":"","value":"13%","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"环比","value":"2%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"同比","value":"-0.8%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"平均参考水平","value":"80%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":5,
|
||||
"background":["#F77E89","#F7953B"],
|
||||
"content":[
|
||||
{"text":"最近使用","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"},
|
||||
{"text":"","value":"21%","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"环比","value":"1%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"同比","value":"-0.8%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"平均参考水平","value":"80%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}
|
||||
]
|
||||
}
|
||||
]
|
||||
35
pages/json/user-operate/3.json
Normal file
35
pages/json/user-operate/3.json
Normal file
@@ -0,0 +1,35 @@
|
||||
[
|
||||
{
|
||||
"kind":5,
|
||||
"background":["#F77E89","#F7953B"],
|
||||
"content":[
|
||||
{"text":"会员销售占比","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"},
|
||||
{"text":"","value":"80%","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"环比","value":"81.5%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"同比","value":"-81.3%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"平均参考水平","value":"85%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":5,
|
||||
"background":["#F77E89","#F7953B"],
|
||||
"content":[
|
||||
{"text":"会员客流占比","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"},
|
||||
{"text":"","value":"79%","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"环比","value":"2%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"同比","value":"-0.8%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"平均参考水平","value":"80%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":5,
|
||||
"background":["#F77E89","#F7953B"],
|
||||
"content":[
|
||||
{"text":"会员客单价","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"},
|
||||
{"text":"","value":"79元","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"环比","value":"1%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"同比","value":"-0.8%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"},
|
||||
{"text":"平均参考水平","value":"80%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}
|
||||
]
|
||||
}
|
||||
]
|
||||
61
pages/json/user-operate/4.json
Normal file
61
pages/json/user-operate/4.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"categories": [
|
||||
"1周",
|
||||
"2周",
|
||||
"3周",
|
||||
"4周",
|
||||
"5周"
|
||||
],
|
||||
"series": [{
|
||||
"name": "同比增长率",
|
||||
"data": [{
|
||||
"value": 5,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": -3,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 3.5,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 10,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 2.8,
|
||||
"color": "#24ABFD"
|
||||
}
|
||||
],
|
||||
"type": "column",
|
||||
"color": "#24ABFD",
|
||||
"index": 1,
|
||||
"unit": "%"
|
||||
},
|
||||
{
|
||||
"name": "消费金额",
|
||||
"data": [
|
||||
1850,
|
||||
1660,
|
||||
1760,
|
||||
2360,
|
||||
1970
|
||||
],
|
||||
"type": "line",
|
||||
"addPoint": true,
|
||||
"color": "#DF297D",
|
||||
"unit": ""
|
||||
}
|
||||
],
|
||||
"target": 1800,
|
||||
"yAxis": [{
|
||||
"max": 3000,
|
||||
"min": 0
|
||||
}, {
|
||||
"max": 20,
|
||||
"min": 0
|
||||
}],
|
||||
"targetAdd": "9%"
|
||||
}
|
||||
88
pages/json/user-operate/6.json
Normal file
88
pages/json/user-operate/6.json
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"headers":[
|
||||
{
|
||||
"label": "最近活跃时间",
|
||||
"key": "col1"
|
||||
}, {
|
||||
"label": "人数",
|
||||
"key": "col2"
|
||||
}, {
|
||||
"label": "人数占比",
|
||||
"key": "col3"
|
||||
}, {
|
||||
"label": "活跃会员环比",
|
||||
"key": "col4"
|
||||
}, {
|
||||
"label": "活跃消费人数占比",
|
||||
"key": "col5"
|
||||
}
|
||||
],
|
||||
"contents":[
|
||||
{
|
||||
"col1": "0-30天",
|
||||
"col2": "15350",
|
||||
"col3": "45",
|
||||
"col4": "9.5",
|
||||
"col5": "29"
|
||||
}, {
|
||||
"col1": "30-60天",
|
||||
"col2": "15350",
|
||||
"col3": "13",
|
||||
"col4": "-2.5",
|
||||
"col5": "-25"
|
||||
}, {
|
||||
"col1": "60-90天",
|
||||
"col2": "15371",
|
||||
"col3": "15",
|
||||
"col4": "-5.2",
|
||||
"col5": "63"
|
||||
}, {
|
||||
"col1": "90-120天",
|
||||
"col2": "12340",
|
||||
"col3": "12",
|
||||
"col4": "2.9",
|
||||
"col5": "-12"
|
||||
}, {
|
||||
"col1": "120-180天",
|
||||
"col2": "12360",
|
||||
"col3": "17",
|
||||
"col4": "3.5",
|
||||
"col5": "11"
|
||||
}
|
||||
],
|
||||
"sortCol":[
|
||||
{
|
||||
"key": "col1",
|
||||
"isNumber": false
|
||||
}, {
|
||||
"key": "col2",
|
||||
"isNumber": true
|
||||
},
|
||||
{
|
||||
"key": "col3",
|
||||
"isNumber": true
|
||||
},
|
||||
{
|
||||
"key": "col4",
|
||||
"isNumber": true
|
||||
},
|
||||
{
|
||||
"key": "col5",
|
||||
"isNumber": true
|
||||
}
|
||||
],
|
||||
"computedCol":["col2","col3","col4","col5"],
|
||||
"formatCol":[{
|
||||
"key": "col3",
|
||||
"template": "#col3#%",
|
||||
"bottomComputedFormat": true
|
||||
}, {
|
||||
"key": "col4",
|
||||
"template": "#col4#%",
|
||||
"bottomComputedFormat": true
|
||||
}, {
|
||||
"key": "col5",
|
||||
"template": "#col5#%",
|
||||
"bottomComputedFormat": true
|
||||
}]
|
||||
}
|
||||
25
pages/json/user-operate/7.json
Normal file
25
pages/json/user-operate/7.json
Normal file
@@ -0,0 +1,25 @@
|
||||
[{
|
||||
"series": [{
|
||||
"color": "#24ABFD",
|
||||
"data": 0.18,
|
||||
"index": 0,
|
||||
"legendShape": "circle",
|
||||
"name": "当前脱落率",
|
||||
"pointShape": "circle",
|
||||
"show": true,
|
||||
"type": "arcbar"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"series": [{
|
||||
"color": "#F04864",
|
||||
"data": 0.25,
|
||||
"index": 0,
|
||||
"legendShape": "circle",
|
||||
"name": "脱落率警示线",
|
||||
"pointShape": "circle",
|
||||
"show": true,
|
||||
"type": "arcbar"
|
||||
}]
|
||||
}
|
||||
]
|
||||
36
pages/json/user-operate/8.json
Normal file
36
pages/json/user-operate/8.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"categories": [
|
||||
"高血压",
|
||||
"糖尿病",
|
||||
"痛风",
|
||||
"血脂",
|
||||
"尿酸"
|
||||
],
|
||||
"series": [{
|
||||
"name": "今周脱落率",
|
||||
"data": [{
|
||||
"value": 6,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 3.2,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 5.5,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 8,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 6,
|
||||
"color": "#24ABFD"
|
||||
}
|
||||
],
|
||||
"type": "column",
|
||||
"color": "#24ABFD",
|
||||
"unit": "%"
|
||||
}]
|
||||
}
|
||||
26
pages/json/user-operate/9.json
Normal file
26
pages/json/user-operate/9.json
Normal file
@@ -0,0 +1,26 @@
|
||||
[{
|
||||
"series": [{
|
||||
"color": "#24ABFD",
|
||||
"data": 0.75,
|
||||
"index": 0,
|
||||
"legendShape": "circle",
|
||||
"name": "当前脱落率",
|
||||
"pointShape": "circle",
|
||||
"show": true,
|
||||
"type": "arcbar"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"series": [{
|
||||
"color": "#F04864",
|
||||
"data": 0.33,
|
||||
"index": 0,
|
||||
"legendShape": "circle",
|
||||
"name": "脱落率警示线",
|
||||
"pointShape": "circle",
|
||||
"show": true,
|
||||
"type": "arcbar"
|
||||
}]
|
||||
}
|
||||
]
|
||||
|
||||
32
pages/json/user-server/1.json
Normal file
32
pages/json/user-server/1.json
Normal file
@@ -0,0 +1,32 @@
|
||||
[{
|
||||
"series": [{
|
||||
"color": "#fff",
|
||||
"data": 1,
|
||||
"precent": "100%",
|
||||
"index": 0,
|
||||
"legendShape": "circle",
|
||||
"name": "工单完成率",
|
||||
"pointShape": "circle",
|
||||
"show": true,
|
||||
"type": "arcbar",
|
||||
"value": "12786",
|
||||
"backgroundColor": "#00AEF9"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"series": [{
|
||||
"color": "#fff",
|
||||
"data": 1,
|
||||
"precent": "100%",
|
||||
"index": 0,
|
||||
"legendShape": "circle",
|
||||
"name": "工单良品率",
|
||||
"pointShape": "circle",
|
||||
"show": true,
|
||||
"type": "arcbar",
|
||||
"value": "1096",
|
||||
"backgroundColor": "#F55676"
|
||||
}]
|
||||
}
|
||||
|
||||
]
|
||||
29
pages/json/user-server/2.json
Normal file
29
pages/json/user-server/2.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"series": [
|
||||
{
|
||||
"name": "任务栏最近使用",
|
||||
"data": 500,
|
||||
"color":"#2fc25b"
|
||||
},
|
||||
{
|
||||
"name": "最近使用小程序列表",
|
||||
"data": 623,
|
||||
"color":"#facc14"
|
||||
},
|
||||
{
|
||||
"name": "手机系统",
|
||||
"data": 123,
|
||||
"color":"#f04864"
|
||||
},
|
||||
{
|
||||
"name": "任务栏我的小程序",
|
||||
"data": 96,
|
||||
"color":"#8543e0"
|
||||
},
|
||||
{
|
||||
"name": "其他",
|
||||
"data": 423,
|
||||
"color":"#51c2d5"
|
||||
}
|
||||
]
|
||||
}
|
||||
36
pages/json/user-server/3.json
Normal file
36
pages/json/user-server/3.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"categories": [
|
||||
"周一",
|
||||
"周二",
|
||||
"周三",
|
||||
"周四",
|
||||
"周五",
|
||||
"周六",
|
||||
"周日"
|
||||
],
|
||||
"series": [
|
||||
{
|
||||
"name": "老会员",
|
||||
"data": [
|
||||
1850,
|
||||
1660,
|
||||
1760,
|
||||
2360,
|
||||
1560,
|
||||
1970,
|
||||
2570
|
||||
],
|
||||
"type": "line",
|
||||
"style": "curve",
|
||||
"addPoint": true,
|
||||
"color": "#DF297D",
|
||||
"unit":""
|
||||
},
|
||||
{
|
||||
"name": "新会员",
|
||||
"data": [
|
||||
450,
|
||||
260,
|
||||
360,
|
||||
560,
|
||||
460,
|
||||
32
pages/json/user-server/4.json
Normal file
32
pages/json/user-server/4.json
Normal file
@@ -0,0 +1,32 @@
|
||||
[
|
||||
{
|
||||
"kind":4,
|
||||
"background":["#0081ff","#1cbbb4"],
|
||||
"content":[
|
||||
{"text":"已评价数","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"},
|
||||
{"text":"","value":"161","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"增长","value":"","colortext":"#fff","colorvalue":"","size":"20rpx"},
|
||||
{"text":"up","value":"325","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":4,
|
||||
"background":["#0081ff","#1cbbb4"],
|
||||
"content":[
|
||||
{"text":"平均分","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"},
|
||||
{"text":"","value":"82","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"增长","value":"","colortext":"#fff","colorvalue":"","size":"20rpx"},
|
||||
{"text":"up","value":"0.7","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":4,
|
||||
"background":["#0081ff","#1cbbb4"],
|
||||
"content":[
|
||||
{"text":"好评率","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"},
|
||||
{"text":"","value":"161","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"增长","value":"","colortext":"#fff","colorvalue":"","size":"20rpx"},
|
||||
{"text":"down","value":"1.2%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}
|
||||
]
|
||||
}
|
||||
]
|
||||
32
pages/json/user-server/5.json
Normal file
32
pages/json/user-server/5.json
Normal file
@@ -0,0 +1,32 @@
|
||||
[
|
||||
{
|
||||
"name":"华东",
|
||||
"num":50000,
|
||||
"width":"",
|
||||
"background":"#FFBE68"
|
||||
},
|
||||
{
|
||||
"name":"华南",
|
||||
"num":30000,
|
||||
"width":"",
|
||||
"background":"#0FEBE1"
|
||||
},
|
||||
{
|
||||
"name":"华北",
|
||||
"num":45500,
|
||||
"width":"",
|
||||
"background":"#BF8DFC"
|
||||
},
|
||||
{
|
||||
"name":"西北",
|
||||
"num":60120,
|
||||
"width":"",
|
||||
"background":"#FF859C"
|
||||
},
|
||||
{
|
||||
"name":"西南",
|
||||
"num":26020,
|
||||
"width":"",
|
||||
"background":"#51ADCF"
|
||||
}
|
||||
]
|
||||
22
pages/json/wechat/1.json
Normal file
22
pages/json/wechat/1.json
Normal file
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{
|
||||
"expect": "",
|
||||
"now": "",
|
||||
"name": "时间进度",
|
||||
"value": "37.88"
|
||||
},
|
||||
{
|
||||
"expect": "224.64",
|
||||
"now": "53.96",
|
||||
"dataType": "1",
|
||||
"name": "微好友拉新",
|
||||
"value": "24.02"
|
||||
},
|
||||
{
|
||||
"expect": "80.17",
|
||||
"now": "18.82",
|
||||
"dataType": "1",
|
||||
"name": "微客群拉新",
|
||||
"value": "23.48"
|
||||
}
|
||||
]
|
||||
50
pages/json/wechat/2.json
Normal file
50
pages/json/wechat/2.json
Normal file
@@ -0,0 +1,50 @@
|
||||
[
|
||||
{
|
||||
"kind":1,
|
||||
"background":["#3EB2F5","#9374F7"],
|
||||
"content":[
|
||||
{"text":"","value":"5860","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"新增微好友","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":1,
|
||||
"background":["#3EB2F5","#9374F7"],
|
||||
"content":[
|
||||
{"text":"","value":"3605","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"新增小程序会员","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":1,
|
||||
"background":["#3EB2F5","#9374F7"],
|
||||
"content":[
|
||||
{"text":"","value":"5860","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"删除/拉黑的微好友","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":1,
|
||||
"background":["#3EB2F5","#9374F7"],
|
||||
"content":[
|
||||
{"text":"","value":"605","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"单聊总数","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":1,
|
||||
"background":["#3EB2F5","#9374F7"],
|
||||
"content":[
|
||||
{"text":"","value":"641","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"发送消息数","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind":1,
|
||||
"background":["#3EB2F5","#9374F7"],
|
||||
"content":[
|
||||
{"text":"","value":"35分钟","colortext":"","colorvalue":"#fff","size":"44rpx"},
|
||||
{"text":"平均首次回复时长","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}
|
||||
]
|
||||
}
|
||||
]
|
||||
33
pages/json/wechat/3.json
Normal file
33
pages/json/wechat/3.json
Normal file
@@ -0,0 +1,33 @@
|
||||
[{
|
||||
"categories": [{
|
||||
"value": 0.2,
|
||||
"color": "#1890ff"
|
||||
},
|
||||
{
|
||||
"value": 0.8,
|
||||
"color": "#1890ff"
|
||||
}
|
||||
],
|
||||
"series": [{
|
||||
"name": "新增小程序会员占比",
|
||||
"data": 0.21,
|
||||
"color": "#24ABFD"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"categories": [{
|
||||
"value": 0.2,
|
||||
"color": "#1890ff"
|
||||
},
|
||||
{
|
||||
"value": 0.8,
|
||||
"color": "#1890ff"
|
||||
}
|
||||
],
|
||||
"series": [{
|
||||
"name": "已回复单聊占比",
|
||||
"data": 0.65,
|
||||
"color": "#24ABFD"
|
||||
}]
|
||||
}
|
||||
]
|
||||
82
pages/json/wechat/4.json
Normal file
82
pages/json/wechat/4.json
Normal file
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"categories": [
|
||||
"1月11",
|
||||
"1月12",
|
||||
"1月13",
|
||||
"1月14",
|
||||
"1月15",
|
||||
"1月16",
|
||||
"1月17"
|
||||
],
|
||||
"series": [{
|
||||
"name": "新增微好友数",
|
||||
"data": [{
|
||||
"value": 1800,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 1300,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 1580,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 1600,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 1600,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 1600,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 1300,
|
||||
"color": "#24ABFD"
|
||||
}
|
||||
],
|
||||
"type": "column",
|
||||
"color": "#24ABFD",
|
||||
"unit": ""
|
||||
},
|
||||
{
|
||||
"name": "新增小程序会员数",
|
||||
"data": [{
|
||||
"value": 1580,
|
||||
"color": "#6BC588"
|
||||
},
|
||||
{
|
||||
"value": 850,
|
||||
"color": "#6BC588"
|
||||
},
|
||||
{
|
||||
"value": 1100,
|
||||
"color": "#6BC588"
|
||||
},
|
||||
{
|
||||
"value": 1400,
|
||||
"color": "#6BC588"
|
||||
},
|
||||
{
|
||||
"value": 1200,
|
||||
"color": "#6BC588"
|
||||
},
|
||||
{
|
||||
"value": 980,
|
||||
"color": "#6BC588"
|
||||
},
|
||||
{
|
||||
"value": 560,
|
||||
"color": "#6BC588"
|
||||
}
|
||||
],
|
||||
"type": "column",
|
||||
"color": "#6BC588",
|
||||
"unit": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
92
pages/json/wechat/5.json
Normal file
92
pages/json/wechat/5.json
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"categories": [
|
||||
"1月11",
|
||||
"1月12",
|
||||
"1月13",
|
||||
"1月14",
|
||||
"1月15",
|
||||
"1月16",
|
||||
"1月17"
|
||||
],
|
||||
"series": [{
|
||||
"name": "新增微好友数",
|
||||
"data": [{
|
||||
"value": 1400,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 1300,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 1000,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 1500,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 1580,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 1700,
|
||||
"color": "#24ABFD"
|
||||
},
|
||||
{
|
||||
"value": 1500,
|
||||
"color": "#24ABFD"
|
||||
}
|
||||
],
|
||||
"type": "column",
|
||||
"color": "#24ABFD",
|
||||
"unit": ""
|
||||
},
|
||||
{
|
||||
"name": "新增小程序会员数",
|
||||
"data": [{
|
||||
"value": 400,
|
||||
"color": "#FB8F82"
|
||||
},
|
||||
{
|
||||
"value": 700,
|
||||
"color": "#FB8F82"
|
||||
},
|
||||
{
|
||||
"value": 500,
|
||||
"color": "#FB8F82"
|
||||
},
|
||||
{
|
||||
"value": 300,
|
||||
"color": "#FB8F82"
|
||||
},
|
||||
{
|
||||
"value": 400,
|
||||
"color": "#FB8F82"
|
||||
},
|
||||
{
|
||||
"value": 350,
|
||||
"color": "#FB8F82"
|
||||
},
|
||||
{
|
||||
"value": 400,
|
||||
"color": "#FB8F82"
|
||||
}
|
||||
],
|
||||
"type": "column",
|
||||
"color": "#FB8F82",
|
||||
"unit": ""
|
||||
}
|
||||
],
|
||||
"yAxis": [{
|
||||
"calibration": true,
|
||||
"position": "left",
|
||||
"title": "",
|
||||
"titleFontSize": 12,
|
||||
"unit": "",
|
||||
"tofix": 0,
|
||||
"min": 0,
|
||||
"max": 2500
|
||||
}]
|
||||
}
|
||||
57
pages/json/wechat/6.json
Normal file
57
pages/json/wechat/6.json
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"headers":[
|
||||
{
|
||||
"label": "活动名称",
|
||||
"key": "col1"
|
||||
}, {
|
||||
"label": "员工总任务",
|
||||
"key": "col2"
|
||||
}, {
|
||||
"label": "员工完成数",
|
||||
"key": "col3"
|
||||
}, {
|
||||
"label": "完成率",
|
||||
"key": "col4"
|
||||
}
|
||||
],
|
||||
"contents":[
|
||||
{
|
||||
"col1": "周末秒杀",
|
||||
"col2": "450",
|
||||
"col3": "420",
|
||||
"col4": "99%"
|
||||
}, {
|
||||
"col1": "摇号活动",
|
||||
"col2": "430",
|
||||
"col3": "1390",
|
||||
"col4": "90%"
|
||||
}, {
|
||||
"col1": "早间问候",
|
||||
"col2": "450",
|
||||
"col3": "430",
|
||||
"col4": "95%"
|
||||
}, {
|
||||
"col1": "汇总",
|
||||
"col2": "1330",
|
||||
"col3": "1240",
|
||||
"col4": "93%"
|
||||
}
|
||||
],
|
||||
"sortCol":[
|
||||
{
|
||||
"key": "col1",
|
||||
"isNumber": false
|
||||
}, {
|
||||
"key": "col2",
|
||||
"isNumber": true
|
||||
},
|
||||
{
|
||||
"key": "col3",
|
||||
"isNumber": true
|
||||
},
|
||||
{
|
||||
"key": "col4",
|
||||
"isNumber": true
|
||||
}
|
||||
]
|
||||
}
|
||||
539
pages/login.vue
Normal file
539
pages/login.vue
Normal file
@@ -0,0 +1,539 @@
|
||||
<template>
|
||||
<view class="normal-login-container">
|
||||
<view class="logo-content align-center justify-center flex">
|
||||
<image class="image" style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
|
||||
</image>
|
||||
<text class="title">MES移动端登录</text>
|
||||
</view>
|
||||
<view class="login-form-content">
|
||||
<view class="input-item flex align-center">
|
||||
<view class="iconfont icon-user icon"></view>
|
||||
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
|
||||
</view>
|
||||
<view class="input-item flex align-center">
|
||||
<view class="iconfont icon-password icon"></view>
|
||||
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
|
||||
</view>
|
||||
<view class="input-item flex align-center" style="margin: 20px auto 0;" v-if="captchaEnabled">
|
||||
<view class="iconfont icon-code icon"></view>
|
||||
<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
|
||||
<image :src="codeUrl" @click="getCode" class="login-code-img"></image>
|
||||
</view>
|
||||
<!-- <u-cell-group :border="false">
|
||||
<u-cell :title="typeTitle" @click="show=!show" :isLink="true" arrow-direction="down"></u-cell>
|
||||
<u-picker :show="show" :columns="columns" :closeOnClickOverlay="true" @cancel="typeCancel"
|
||||
@confirm="typeConfirm" @close="typeClose"></u-picker>
|
||||
</u-cell-group> -->
|
||||
<view class="flex align-center">
|
||||
<!-- <checkbox-group @change="checkboxChange">
|
||||
<checkbox id="chkRem" type="checkbox" :checked='rememberPsw' @tap="rememberPsw =! rememberPsw" color="#09CC86"/>
|
||||
记住账号密码
|
||||
</checkbox-group> -->
|
||||
<uni-data-checkbox multiple v-model="value" :localdata="range"
|
||||
@change="checkboxChange"></uni-data-checkbox>
|
||||
</view>
|
||||
|
||||
<view class="action-btn">
|
||||
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="list-cell list-cell-arrow" @click="handleBaseUrl">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-refresh menu-icon"></view>
|
||||
<view>配置服务器地址</view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-popup ref="popup" type="dialog">
|
||||
<uni-popup-dialog mode="input" message="成功消息" :duration="2000" :before-close="true" @close="close"
|
||||
@confirm="confirm">
|
||||
<uni-row>
|
||||
<uni-col>
|
||||
<uni-easyinput type="text" v-model="baseUrl" placeholder="请输入服务器地址" />
|
||||
</uni-col>
|
||||
<!-- <uni-col>
|
||||
<uni-easyinput type="text" v-model="baseUrl" placeholder="请输入MES服务器地址" />
|
||||
</uni-col>
|
||||
<uni-col>
|
||||
<uni-easyinput type="text" v-model="wmsUrl" placeholder="请输入WMS服务器地址" />
|
||||
</uni-col> -->
|
||||
</uni-row>
|
||||
</uni-popup-dialog>
|
||||
</uni-popup>
|
||||
<!-- <view class="xieyi text-center">
|
||||
<text class="text-grey1">登录即代表同意</text>
|
||||
<text @click="handleUserAgrement" class="text-blue">《用户协议》</text>
|
||||
<text @click="handlePrivacy" class="text-blue">《隐私协议》</text>
|
||||
</view> -->
|
||||
<uni-fab ref="fab" :pattern="pattern" :content="content" :horizontal="horizontal" :vertical="vertical"
|
||||
:direction="direction" @trigger="trigger" @fabClick="fabClick" />
|
||||
<view> <span class="version">版本 {{version}}</span></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getToken
|
||||
} from '@/utils/auth'
|
||||
import {
|
||||
getCodeImg
|
||||
} from '@/api/login'
|
||||
import {
|
||||
version
|
||||
} from "vue"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
typeTitle: '常规功能',
|
||||
show: false,
|
||||
columns: [
|
||||
['常规功能', 'ESOP', 'IPC']
|
||||
],
|
||||
version: "",
|
||||
value: [0],
|
||||
range: [{
|
||||
"value": 0,
|
||||
"text": "记住账号密码"
|
||||
}],
|
||||
baseUrl: uni.getStorageSync('base_url'),
|
||||
// wmsUrl: uni.getStorageSync('wms_url'),
|
||||
codeUrl: "",
|
||||
captchaEnabled: true,
|
||||
globalConfig: getApp().globalData.config,
|
||||
loginForm: {
|
||||
username: "",
|
||||
password: "",
|
||||
code: "",
|
||||
uuid: '',
|
||||
},
|
||||
rememberPsw: true,
|
||||
title: 'uni-fab',
|
||||
directionStr: '垂直',
|
||||
horizontal: 'right',
|
||||
vertical: 'bottom',
|
||||
direction: 'horizontal',
|
||||
pattern: {
|
||||
icon: 'list',
|
||||
color: '#7A7E83',
|
||||
backgroundColor: '#fff',
|
||||
selectedColor: '#007AFF',
|
||||
buttonColor: '#007AFF',
|
||||
iconColor: '#fff'
|
||||
},
|
||||
is_color_type: false,
|
||||
content: [{
|
||||
iconPath: '/static/images/esop.png',
|
||||
selectedIconPath: '/static/images/esop.png',
|
||||
text: 'ESOP',
|
||||
active: false
|
||||
},
|
||||
{
|
||||
iconPath: '/static/images/ipc.png',
|
||||
selectedIconPath: '/static/images/ipc.png',
|
||||
text: 'IPC',
|
||||
active: false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.version = uni.getAppBaseInfo(version).appVersion;
|
||||
//缓存的账号
|
||||
const HBusername = uni.getStorageSync('HBusername');
|
||||
//缓存的密码
|
||||
const HBpassword = uni.getStorageSync('HBpassword');
|
||||
// console.log("缓存的账号:" + HBusername)
|
||||
// console.log("缓存的密码:" + HBpassword)
|
||||
//有缓存就赋值给文本没有就清空
|
||||
if (HBusername && HBpassword) {
|
||||
this.loginForm.username = HBusername;
|
||||
this.loginForm.password = HBpassword;
|
||||
} else {
|
||||
this.loginForm.username = '';
|
||||
this.loginForm.password = '';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getCode()
|
||||
},
|
||||
onLoad() {
|
||||
//检测更新
|
||||
// const type = uni.getSystemInfoSync().platform
|
||||
// console.log(type, '机型')
|
||||
// // #ifdef APP-PLUS
|
||||
// plus.screen.lockOrientation('default');
|
||||
// // #endif
|
||||
},
|
||||
// 页面关闭时清除横屏正方向
|
||||
// onUnload() {
|
||||
// // #ifdef APP-PLUS
|
||||
// plus.screen.lockOrientation('portrait-primary');
|
||||
// // #endif
|
||||
// },
|
||||
methods: {
|
||||
trigger(e) {
|
||||
const _this = this;
|
||||
console.log(e)
|
||||
_this.content[e.index].active = !e.item.active
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: `您确定进入${e.item.text}页面吗?`,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
if (e.index == 0) {
|
||||
_this.$tab.reLaunch('/pages/work/esop')
|
||||
} else if (e.index == 1) {
|
||||
console.log(2)
|
||||
_this.$tab.reLaunch('/pages/work/ipc')
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
fabClick() {
|
||||
// uni.showToast({
|
||||
// // title: '点击了悬浮按钮',
|
||||
// icon: 'none'
|
||||
// })
|
||||
},
|
||||
// 隐私协议
|
||||
handlePrivacy() {
|
||||
let site = this.globalConfig.appInfo.agreements[0]
|
||||
this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
|
||||
},
|
||||
// 用户协议
|
||||
handleUserAgrement() {
|
||||
let site = this.globalConfig.appInfo.agreements[1]
|
||||
this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
|
||||
},
|
||||
// 获取图形验证码
|
||||
getCode() {
|
||||
getCodeImg().then(res => {
|
||||
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
|
||||
if (this.captchaEnabled) {
|
||||
this.codeUrl = 'data:image/gif;base64,' + res.img
|
||||
this.loginForm.uuid = res.uuid
|
||||
}
|
||||
})
|
||||
},
|
||||
// 登录方法
|
||||
async handleLogin() {
|
||||
if (this.loginForm.username === "") {
|
||||
this.$modal.msgError("请输入您的账号")
|
||||
} else if (this.loginForm.password === "") {
|
||||
this.$modal.msgError("请输入您的密码")
|
||||
} else if (this.loginForm.code === "" && this.captchaEnabled) {
|
||||
this.$modal.msgError("请输入验证码")
|
||||
} else {
|
||||
this.$modal.loading("登录中,请耐心等待...")
|
||||
this.pwdLogin()
|
||||
}
|
||||
},
|
||||
// 密码登录
|
||||
async pwdLogin() {
|
||||
this.$store.dispatch('Login', this.loginForm).then(() => {
|
||||
this.$modal.closeLoading()
|
||||
this.loginSuccess()
|
||||
}).catch(() => {
|
||||
if (this.captchaEnabled) {
|
||||
this.getCode()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 登录成功后,处理函数
|
||||
loginSuccess(result) {
|
||||
// 设置用户信息
|
||||
if (this.rememberPsw) {
|
||||
uni.setStorageSync('HBusername', this.loginForm.username);
|
||||
uni.setStorageSync('HBpassword', this.loginForm.password);
|
||||
} else { //销毁缓存
|
||||
uni.removeStorageSync('HBusername');
|
||||
uni.removeStorageSync('HBpassword');
|
||||
}
|
||||
this.$store.dispatch('GetInfo').then(res => {
|
||||
// this.$tab.redirectTo('/pages/work/esop')
|
||||
// if (this.typeTitle == '常用功能') {
|
||||
this.$tab.reLaunch('/pages/index')
|
||||
// } else if (this.typeTitle == 'ESOP') {
|
||||
|
||||
// } else if (this.typeTitle == 'IPC') {
|
||||
// }
|
||||
})
|
||||
},
|
||||
handleBaseUrl() {
|
||||
this.$refs.popup.open()
|
||||
},
|
||||
close() {
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
confirm() {
|
||||
// 输入框的值
|
||||
uni.setStorageSync('base_url', this.baseUrl)
|
||||
// uni.setStorageSync('wms_url',this.wmsUrl)
|
||||
console.log(uni.getStorageSync('base_url'));
|
||||
// console.log(uni.getStorageSync('wms_url'));
|
||||
// TODO 做一些其他的事情,手动执行 close 才会关闭对话框
|
||||
// ...
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
//复选框
|
||||
checkboxChange: function(e) {
|
||||
if (e.detail.value.length == 1) {
|
||||
//获取缓存的账号 赋值
|
||||
uni.getStorageSync('HBusername', this.loginForm.username);
|
||||
uni.getStorageSync('HBpassword', this.loginForm.password);
|
||||
} else { //销毁
|
||||
uni.removeStorageSync('HBusername');
|
||||
uni.removeStorageSync('HBpassword');
|
||||
}
|
||||
},
|
||||
typeCancel() {
|
||||
this.show = false;
|
||||
},
|
||||
typeConfirm(e) {
|
||||
console.log(this.baseUrl.slice(0, -1) + '3')
|
||||
this.typeTitle = e.value[0];
|
||||
this.show = false;
|
||||
},
|
||||
typeClose() {
|
||||
this.show = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.normal-login-container {
|
||||
width: 100%;
|
||||
|
||||
.logo-content {
|
||||
width: 100%;
|
||||
font-size: 21px;
|
||||
text-align: center;
|
||||
padding-top: 15%;
|
||||
|
||||
image {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.login-form-content {
|
||||
// text-align: center;
|
||||
margin: 20px auto;
|
||||
margin-top: 15%;
|
||||
width: 80%;
|
||||
|
||||
.input-item {
|
||||
margin: 20px auto;
|
||||
background-color: #f5f6f7;
|
||||
height: 45px;
|
||||
border-radius: 20px;
|
||||
|
||||
.icon {
|
||||
font-size: 38rpx;
|
||||
margin-left: 10px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
text-align: left;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
margin-top: 15px;
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.xieyi {
|
||||
color: #333;
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.easyinput {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.login-code-img {
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.version {
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
bottom: 30rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 600px) and (orientation:landscape) {
|
||||
::v-deep .uni-data-checklist .checklist-group .checklist-box .checkbox__inner {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
::v-deep .uni-data-checklist .checklist-group .checklist-box .checkbox__inner .checkbox__inner-icon {
|
||||
height: 20px;
|
||||
width: 10px;
|
||||
left: 9px;
|
||||
}
|
||||
|
||||
::v-deep .uni-data-checklist .checklist-group .checklist-box .checklist-content .checklist-text {
|
||||
font-size: 24px
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 45px
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 200px !important;
|
||||
height: 200px !important;
|
||||
}
|
||||
|
||||
.normal-login-container {
|
||||
width: 100%;
|
||||
|
||||
.logo-content {
|
||||
width: 100%;
|
||||
font-size: 21px;
|
||||
text-align: center;
|
||||
padding-top: 10%;
|
||||
|
||||
image {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.login-form-content {
|
||||
// text-align: center;
|
||||
margin: 20px auto;
|
||||
// margin-top: 15%;
|
||||
width: 80%;
|
||||
|
||||
.input-item {
|
||||
margin: 20px auto;
|
||||
background-color: #f5f6f7;
|
||||
height: 80px;
|
||||
border-radius: 20px;
|
||||
|
||||
.icon {
|
||||
font-size: 40px;
|
||||
margin-left: 10px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
font-size: 30px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
margin-top: 15px;
|
||||
height: 80px;
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.xieyi {
|
||||
color: #333;
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.easyinput {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.menu-item-box {
|
||||
font-size: 30px
|
||||
}
|
||||
|
||||
.menu-icon {
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.version {
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
::v-deep .uni-popup-dialog {
|
||||
width: 800px;
|
||||
}
|
||||
|
||||
::v-deep .uni-dialog-title-text {
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
::v-deep .uni-easyinput__content-input {
|
||||
width: 700px;
|
||||
font-size: 30px
|
||||
}
|
||||
|
||||
::v-deep .content-clear-icon {
|
||||
font-size: 40px !important;
|
||||
}
|
||||
|
||||
::v-deep .uni-dialog-button-text {
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
::v-deep .uni-dialog-button {
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
// .uni-fab__content .uni-fab__content--right .uni-fab__content--other-platform{
|
||||
// width: 300px;
|
||||
// height: 80px;
|
||||
// }
|
||||
|
||||
// uni-fab__content uni-fab__content--right uni-fab__content--other-platform
|
||||
|
||||
// .uni-fab__item-image{
|
||||
// width: 80px;
|
||||
// height: 50px;
|
||||
// }
|
||||
|
||||
// .uni-fab__item{
|
||||
// width: 100px;
|
||||
// height: 50px;
|
||||
// }
|
||||
|
||||
// .uni-fab__item-text{
|
||||
// font-size: 24px;
|
||||
// margin-right: 15px;
|
||||
// }
|
||||
}
|
||||
|
||||
.login-code-img {
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
182
pages/mes/jobCv/jobBindEqp.vue
Normal file
182
pages/mes/jobCv/jobBindEqp.vue
Normal file
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="作业编码" :labelWidth='90' name="pwoJobCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.pwoJobCode" type="text"
|
||||
@confirm="scanBarCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="当前设备" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput disabled v-model="formData.equipmentCode" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="切换设备" :labelWidth='90' name="newEquipmentCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" v-model="formData.newEquipmentCode"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPwoJob,
|
||||
updatePwoJob,
|
||||
getEquipment,
|
||||
listEquipment
|
||||
} from "@/api/mes/jobReport.js";
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
// this.test()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
pwoJobCode: null,
|
||||
equipmentCode: null,
|
||||
newEquipmentCode: null,
|
||||
eqpId: null
|
||||
},
|
||||
rules: {
|
||||
pwoJobCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入作业编码'
|
||||
}]
|
||||
},
|
||||
newEquipmentCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入要切换的设备编号'
|
||||
},
|
||||
{
|
||||
pattern: '^[A-Z0-9]+$',
|
||||
errorMessage: '请输入正确格式的设备编码!',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
test() {
|
||||
let ip = null;
|
||||
uni.setStorageSync('appversion', plus.runtime.version)
|
||||
// IP地址
|
||||
let Context = plus.android.importClass('android.content.Context')
|
||||
let main = plus.android.runtimeMainActivity()
|
||||
let cm = main.getSystemService(Context.CONNECTIVITY_SERVICE)
|
||||
plus.android.importClass(cm)
|
||||
let linkProperties = cm.getLinkProperties(cm.getActiveNetwork())
|
||||
let linkAddrs = plus.android.invoke(linkProperties, 'getLinkAddresses')
|
||||
plus.android.importClass(linkAddrs)
|
||||
for (var i = 0; i < linkAddrs.size(); i++) {
|
||||
let inetAddr = plus.android.invoke(linkAddrs.get(i), 'getAddress')
|
||||
ip = plus.android.invoke(inetAddr, 'getHostAddress')
|
||||
}
|
||||
|
||||
// let baseUrl = uni.getStorageSync("base_url").slice(0, 20)
|
||||
console.log(ip)
|
||||
uni.request({
|
||||
url: 'http://' + ip + ':8080/api/1.0/alarm/success_start',
|
||||
success: (res) => {
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.pwoJobCode) {
|
||||
let obj = Number(this.formData.pwoJobCode.slice(4));
|
||||
console.log(Number(this.formData.pwoJobCode.slice(4)));
|
||||
getPwoJob(obj).then(async res => {
|
||||
console.log(res);
|
||||
if (res) {
|
||||
let eqpId = res.data.eqpId;
|
||||
//判断扫描的作业编码是否绑定设备
|
||||
if (eqpId && eqpId != 0) {
|
||||
this.formData.eqpId = eqpId;
|
||||
getEquipment(eqpId).then(async res => {
|
||||
this.formData.equipmentCode = res.data.equipmentCode;
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("该作业编码未绑定设备!");
|
||||
}
|
||||
} else {
|
||||
this.formData.equipmentCode = "无";
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.newEquipmentCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoJobCode = res.result;
|
||||
_this.scanBarCode(_this.formData.pwoJobCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定使用该设备上工吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
let query = {
|
||||
equipmentCode: _this.formData.newEquipmentCode
|
||||
}
|
||||
//根据设备编码来获取设备id
|
||||
listEquipment(query).then(async res => {
|
||||
let eqpId1 = res.rows[0].id;
|
||||
let data = {
|
||||
id: _this.formData.pwoJobCode.slice(4),
|
||||
eqpId: res.rows[0].id
|
||||
}
|
||||
_this.$modal.loading('提交中')
|
||||
updatePwoJob(data).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("作业上机成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab(
|
||||
"/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
423
pages/mes/jobCv/jobIn.vue
Normal file
423
pages/mes/jobCv/jobIn.vue
Normal file
@@ -0,0 +1,423 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms :modelValue="jobInForm" ref="jobInForm" :rules="rules">
|
||||
<uni-collapse-item title="上机转入单" :open="true">
|
||||
<uni-forms-item label="作业编码" :labelWidth='90' name="pwoJobCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" @confirm="scanJobCode"
|
||||
v-model="jobInForm.pwoJobCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="工单" :labelWidth='90' name="pwoCode">
|
||||
<uni-easyinput type="text" disabled v-model="jobInForm.pwoCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="工位编码" :labelWidth='90' name="stationCode">
|
||||
<uni-easyinput suffixIcon="scan" type="text" v-model="stationCode"
|
||||
@iconClick="scanBarStationCode" @input="scanStationCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput suffixIcon="scan" :disabled=flag ref="equipmentCode" @iconClick="scanBar1"
|
||||
type="text" v-model="equipmentCode">
|
||||
</uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item v-show="show" :labelWidth='90' style="text-align: center;" name="">
|
||||
<button type="primary" size="mini" style=" text-align: center;font-size: 18px;"
|
||||
@click="eqpBind">绑定</button>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="选择状态" :labelWidth='90'>
|
||||
<u-radio-group v-model="radiovalue1" placement="row">
|
||||
<u-radio v-for="(item, index) in radiolist1" :key="index" :label="item.name"
|
||||
:name="item.name">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item :label="radiovalue1+'时间'" :labelWidth='90'>
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="datetime" v-model="value1" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="操作人编码" :labelWidth='90' name="operateByCode">
|
||||
<uni-easyinput suffixIcon="scan" @confirm="scanBarOperateBy" @iconClick="scanBar2" type="text"
|
||||
v-model="operateByCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="操作人" :labelWidth='90' name="operateBy">
|
||||
<uni-easyinput disabled type="text" v-model="operateBy"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="转移单类型" :labelWidth='90' name="type">
|
||||
<uni-easyinput type="text" disabled v-model="jobInForm.type"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="备注" :labelWidth='90' name="remark">
|
||||
<uni-easyinput autoHeight type="textarea" v-model="jobInForm.remark"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="上机转入单明细" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions"
|
||||
v-for="(item, index) in jobInForm.mesPwoJobCvDetailList" :key="index"
|
||||
@click="(data) => clickDetail(index,data)" @change="swipChange">
|
||||
<!-- <uni-badge :text="index+1" type="primary"><u-tag text="未核销" size="large" type="error" plain
|
||||
plainFill></u-tag></uni-badge> -->
|
||||
<!-- <div><u-tag text="未核销" size="mini" type="error" plain plainFill></u-tag></div> -->
|
||||
<uni-forms-item label="物料编码" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.materialCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.materialName'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialName"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料批号" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.materialBatch'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialBatch"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="目标仓库" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.whCodeDest'">
|
||||
<uni-easyinput type="text" disabled v-model="item.whCodeDest"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="目标库位" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.locCodeDest'">
|
||||
<uni-easyinput type="text" disabled v-model="item.locCodeDest"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="可转入数量" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.availableNum'">
|
||||
<uni-easyinput type="text" disabled v-model="item.availableNum"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="转移数量" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.number'">
|
||||
<uni-easyinput type="text" v-model="item.number"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<view style="text-align: center;margin: 10px 0;" v-show="jobInForm.mesPwoJobCvDetailList.length>0">
|
||||
<button type="primary" size="mini" style=" text-align: center;font-size: 18px;"
|
||||
@click="byDetailAdd">照单领</button>
|
||||
</view>
|
||||
<u-button type="primary" @click="jobInSubmit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
handleConvert,
|
||||
getEquipment,
|
||||
addConversion,
|
||||
listEmpEqpHistory,
|
||||
listEmployee,
|
||||
listConversion,
|
||||
pwoStart,
|
||||
pwoStop
|
||||
} from "@/api/mes/jobIn.js";
|
||||
import {
|
||||
updatePwoJob,
|
||||
listEquipment,
|
||||
getPwoJob,
|
||||
listPwoJob
|
||||
} from "@/api/mes/jobReport.js"
|
||||
import {
|
||||
listStation,
|
||||
addCustomizeEsop
|
||||
} from "@/api/esop/esop.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value1: null,
|
||||
radiolist1: [{
|
||||
name: '开工',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: '暂停',
|
||||
disabled: false
|
||||
}
|
||||
],
|
||||
radiovalue1: '开工',
|
||||
stationCode: null,
|
||||
jobInForm: {
|
||||
mesPwoJobCvDetailList: [],
|
||||
},
|
||||
stationId: null,
|
||||
number: null,
|
||||
equipmentCode: null,
|
||||
flag: true,
|
||||
show: false,
|
||||
operateBy: null,
|
||||
operateByCode: null,
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
pwoJobCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入作业编码!'
|
||||
}]
|
||||
},
|
||||
// materialName: [{
|
||||
// required: false,
|
||||
// errorMessage: '请输入物料名称!'
|
||||
// }],
|
||||
// number: [{
|
||||
// required: true,
|
||||
// errorMessage: '请输入转移数量!'
|
||||
// }],
|
||||
// equipmentCode: {
|
||||
// rules: [{
|
||||
// pattern: '^[A-Z0-9]+$',
|
||||
// errorMessage: '请输入正确格式的设备编码!',
|
||||
// trigger: 'blur',
|
||||
// }]
|
||||
// }
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
listEquipment().then(response => {
|
||||
this.equipmentList = response.rows
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
//照单领
|
||||
byDetailAdd() {
|
||||
if (this.jobInForm.mesPwoJobCvDetailList.length > 0) {
|
||||
for (var i in this.jobInForm.mesPwoJobCvDetailList) {
|
||||
this.jobInForm.mesPwoJobCvDetailList[i].number = this.jobInForm.mesPwoJobCvDetailList[i]
|
||||
.availableNum;
|
||||
}
|
||||
}
|
||||
},
|
||||
deleteDetail(index) {
|
||||
this.jobInForm.mesPwoJobCvDetailList.splice(index, 1);
|
||||
},
|
||||
clickDetail(itemIndex, {
|
||||
position,
|
||||
index
|
||||
}) {
|
||||
if (index == 0) {
|
||||
this.deleteDetail(itemIndex);
|
||||
}
|
||||
},
|
||||
reset(code) {
|
||||
this.jobInForm = {
|
||||
pwoJobCode: code,
|
||||
mesPwoJobCvDetailList: [],
|
||||
};
|
||||
this.equipmentCode = null;
|
||||
this.operateBy = null;
|
||||
this.operateByCode = null;
|
||||
},
|
||||
eqpBind() {
|
||||
|
||||
let id = Number(this.jobInForm.pwoJobCode.substring(4));
|
||||
//判断是否有该设备
|
||||
if (this.equipmentCode != "" && this.equipmentCode) {
|
||||
let query = {
|
||||
equipmentCode: this.equipmentCode
|
||||
}
|
||||
listEquipment(query).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
//绑定设备
|
||||
let data = {
|
||||
id: this.jobInForm.pwoJobCode.slice(4),
|
||||
eqpId: res.rows[0].id
|
||||
}
|
||||
this.$modal.loading('提交中')
|
||||
updatePwoJob(data).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("绑定成功!");
|
||||
this.show = false;
|
||||
this.flag = true;
|
||||
this.scanJobCode(this.jobInForm.pwoJobCode);
|
||||
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("未查询到该设备编码!");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("请输入设备编码!");
|
||||
}
|
||||
|
||||
},
|
||||
scanJobCode(code) {
|
||||
if (code) {
|
||||
this.reset(code);
|
||||
// let id = Number(code.substring(4));
|
||||
listPwoJob({
|
||||
code: code
|
||||
}).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
if (!res.rows[0].eqpId) {
|
||||
//未绑定设备,设备编码框可用,绑定按钮显示
|
||||
this.$modal.msg("该作业未绑定设备,请绑定设备!");
|
||||
this.flag = false;
|
||||
this.show = true;
|
||||
} else {
|
||||
//已绑定设备,
|
||||
handleConvert(res.rows[0].id).then(async response => {
|
||||
this.equipmentCode = this.equipmentList.find(item => item.id ==
|
||||
response.jobInfo.eqpId).equipmentCode; //赋值设备编码
|
||||
listEmpEqpHistory({
|
||||
equipmentCode: this.equipmentCode
|
||||
}).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
//取上机且未下机的人员
|
||||
if (res.rows[res.rows.length -
|
||||
1].startTime && !res.rows[res.rows
|
||||
.length -
|
||||
1].endTime) {
|
||||
this.operateBy = res.rows[res.rows
|
||||
.length -
|
||||
1].empName;
|
||||
this.operateByCode = res.rows[res.rows
|
||||
.length - 1].empCode;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.jobInForm.pwoJobId = response.jobInfo.id;
|
||||
this.jobInForm.powJobCode = response.jobInfo.code;
|
||||
this.jobInForm.pwoId = response.jobInfo.pwoId;
|
||||
this.jobInForm.pwoCode = response.jobInfo.pwoCode;
|
||||
this.jobInForm.type = 2;
|
||||
|
||||
if (response.materials != null && response.materials.length >
|
||||
0) {
|
||||
for (let i in response.materials) {
|
||||
let obj = {};
|
||||
obj.materialCode = response.materials[i].cPtNo;
|
||||
obj.materialName = response.materials[i].cTitle;
|
||||
obj.materialBatch = response.materials[i].batchNo;
|
||||
obj.whCodeDest = "op-" + response.jobInfo.opCode;
|
||||
obj.availableNum = response.materials[i].availableNum;
|
||||
obj.locCodeDest = this.equipmentCode + "-01";
|
||||
obj.number = null;
|
||||
this.jobInForm.mesPwoJobCvDetailList.push(obj);
|
||||
}
|
||||
} else {
|
||||
this.$modal.msg("未查询到可转入的原材料!");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBarOperateBy() {
|
||||
let obj = {
|
||||
empCode: this.operateByCode
|
||||
}
|
||||
listEmployee(obj).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
this.operateBy = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员信息!");
|
||||
}
|
||||
});
|
||||
},
|
||||
//工位编码
|
||||
scanBarStationCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.stationCode = res.result;
|
||||
_this.scanStationCode(_this.stationCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
scanStationCode(code) {
|
||||
let obj = {
|
||||
stationCode: code
|
||||
}
|
||||
listStation(obj).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.stationId = res.rows[0].id
|
||||
} else {
|
||||
this.$modal.msg("未查询到该工位,无法同步ESOP!")
|
||||
}
|
||||
});
|
||||
},
|
||||
jobInSubmit() {
|
||||
//判断是否输入工位,并进行同步esop
|
||||
if (this.stationCode && this.stationCode != '' && this.stationId && this.stationId != '') {
|
||||
addCustomizeEsop({
|
||||
pwoJobId: this.jobInForm.pwoJobId,
|
||||
stationId: this.stationId,
|
||||
stationCode: this.stationCode,
|
||||
pwoJobCode: this.jobInForm.pwoJobCode
|
||||
}).then(resp => {
|
||||
this.$modal.msgSuccess("ESOP同步成功!");
|
||||
});
|
||||
}
|
||||
//判断是否输入时间
|
||||
if (this.value1 && this.value1 != '') {
|
||||
switch (this.radiovalue1) {
|
||||
case '开工':
|
||||
pwoStart(this.jobInForm.pwoJobId, this.value1).then(res => {
|
||||
this.$modal.msgSuccess("作业开工成功!");
|
||||
});
|
||||
break;
|
||||
case '暂停':
|
||||
pwoStop(this.jobInForm.pwoJobId, this.value1).then(res => {
|
||||
this.$modal.msgSuccess("作业暂停成功!");
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.jobInForm.operateBy = this.operateBy;
|
||||
this.$refs["jobInForm"].validate().then(valid => {
|
||||
//作业转入
|
||||
this.$modal.loading('提交中')
|
||||
addConversion(this.jobInForm).then(response => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("转入成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
},
|
||||
//作业编码
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.jobInForm.pwoJobCode = res.result;
|
||||
_this.scanJobCode(_this.jobInForm.pwoJobCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//设备编码
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.equipmentCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
//操作人编码
|
||||
scanBar2() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.operateByCode = res.result;
|
||||
_this.scanBarOperateBy();
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
86
pages/mes/jobCv/pieceIn.vue
Normal file
86
pages/mes/jobCv/pieceIn.vue
Normal file
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="物料件号" :labelWidth='90' name="pieceNo">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.pieceNo" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addPiece
|
||||
} from "@/api/mes/jobReport.js";
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
pieceNo: null,
|
||||
},
|
||||
|
||||
rules: {
|
||||
pieceNo: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入件号!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pieceNo = res.result;
|
||||
_this.scanBarCode(_this.formData.pieceNo);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定转入吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log(_this.formData.pieceNo);
|
||||
_this.$modal.loading('提交中')
|
||||
addPiece(_this.formData.pieceNo).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("件号转入成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
83
pages/mes/jobCv/pieceReport.vue
Normal file
83
pages/mes/jobCv/pieceReport.vue
Normal file
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="物料件号" :labelWidth='90' name="pieceNo">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.pieceNo" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
pieceReport
|
||||
} from "@/api/mes/jobReport.js";
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
pieceNo: null,
|
||||
},
|
||||
|
||||
rules: {
|
||||
pieceNo: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入件号!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pieceNo = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定报工吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
_this.$modal.loading('提交中')
|
||||
pieceReport(_this.formData.pieceNo, {}).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("件号报工成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
111
pages/mes/jobCv/pwoClose.vue
Normal file
111
pages/mes/jobCv/pwoClose.vue
Normal file
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产工单" :labelWidth='90' name="pwoCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.pwoCode" type="text"
|
||||
@confirm="scanBarCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">关闭工单</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPwo,
|
||||
listPwo,
|
||||
pwoAtificialClose
|
||||
} from "@/api/mes/pwoDraw.js";
|
||||
import {
|
||||
listWarehouse
|
||||
} from "@/api/wms/pdcIn.js";
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
pwoCode: null,
|
||||
},
|
||||
id: null,
|
||||
value: 0,
|
||||
range: [],
|
||||
status: null,
|
||||
rules: {
|
||||
pwoCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入生产工单!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
scanBarCode() {
|
||||
const _this = this;
|
||||
if (_this.formData.pwoCode) {
|
||||
let obj = {
|
||||
pwoCode: _this.formData.pwoCode
|
||||
}
|
||||
listPwo(obj).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
_this.id = res.rows[0].id;
|
||||
_this.status = res.rows[0].status;
|
||||
} else {
|
||||
_this.$modal.msg("未找到该工单!")
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoCode = res.result;
|
||||
_this.scanBarCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定关闭该生产工单吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
//判断工单是否能关闭
|
||||
if (_this.status >= 7) {
|
||||
_this.$modal.msg("该工单无法关闭!")
|
||||
} else {
|
||||
_this.$modal.loading('提交中')
|
||||
pwoAtificialClose('"' + _this.id + '"').then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("工单关闭成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
208
pages/mes/jobCv/pwoDraw.vue
Normal file
208
pages/mes/jobCv/pwoDraw.vue
Normal file
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms :modelValue="jobInForm" ref="jobInForm" :rules="rules">
|
||||
<uni-collapse-item title="领料转移单" :open="true">
|
||||
<uni-forms-item label="工单" :labelWidth='90' name="pwoCode">
|
||||
<view class="uni-flex uni-row">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" @confirm="scanJobCode"
|
||||
v-model="jobInForm.pwoCode"></uni-easyinput>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="转移单类型" :labelWidth='90' name="type">
|
||||
<uni-data-select v-model="jobInForm.type" :localdata="typeOptions"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="备注" :labelWidth='90' name="remark">
|
||||
<uni-easyinput autoHeight type="textarea" v-model="jobInForm.remark"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="领料转移单明细" :labelWidth='90' :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
v-for="(item, index) in jobInForm.mesPwoJobCvDetailList"
|
||||
@click="(data) => clickDetail(index,data)" @change="swipChange">
|
||||
<uni-badge :text="index+1" type="primary"></uni-badge>
|
||||
<uni-forms-item label="物料编码" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.materialCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.materialName'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialName"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料批号" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.materialBatchNo'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialBatchNo"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="生产车间" :labelWidth='90' :rules="rules.workshopCode"
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.workshopCode'">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarworkshopCode(index)" type="text"
|
||||
v-model="item.workshopCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="目标仓库" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.whCodeDest'">
|
||||
<uni-easyinput type="text" v-model="item.whCodeDest"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="目标库位" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.locCodeDest'">
|
||||
<uni-easyinput type="text" v-model="item.locCodeDest"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="转移数量" :labelWidth='90' :rules="rules.number"
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.number'">
|
||||
<u-number-box button-size="36" inputWidth="120" v-model="item.number"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
|
||||
<u-button type="primary" @click="jobInSubmit" v-if="!isPwoRoute">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getDrawMat,
|
||||
addConversion
|
||||
} from "@/api/mes/pwoDraw.js";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
export default {
|
||||
onLoad: function(option) {
|
||||
console.log(option);
|
||||
if (option) {
|
||||
this.jobInForm.pwoCode = option.pwoCode;
|
||||
this.jobInForm.type = option.type
|
||||
this.jobInForm.mesPwoJobCvDetailList = JSON.parse(decodeURIComponent(option.mesPwoJobCvDetailList));
|
||||
this.isPwoRoute = true;
|
||||
}
|
||||
getDicts("mes_conv_type").then(res => {
|
||||
this.typeOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isPwoRoute: false,
|
||||
typeOptions: [],
|
||||
jobInForm: {
|
||||
pwoCode: "",
|
||||
mesPwoJobCvDetailList: [],
|
||||
},
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
pwoCode: [{
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入工单!'
|
||||
}]
|
||||
}],
|
||||
type: [{
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入转移单类型!',
|
||||
}]
|
||||
}],
|
||||
materialCode: [{
|
||||
required: true,
|
||||
errorMessage: '请输入物料编码!'
|
||||
}],
|
||||
materialName: [{
|
||||
required: true,
|
||||
errorMessage: '请输入物料名称!'
|
||||
}],
|
||||
number: [{
|
||||
required: true,
|
||||
errorMessage: '请输入转移数量!'
|
||||
}],
|
||||
workshopCode: [{
|
||||
required: true,
|
||||
errorMessage: '请输入生产车间!'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
deleteDetail(index) {
|
||||
this.jobInForm.mesPwoJobCvDetailList.splice(index, 1);
|
||||
},
|
||||
clickDetail(itemIndex, {
|
||||
position,
|
||||
index
|
||||
}) {
|
||||
if (index == 0) {
|
||||
this.deleteDetail(itemIndex);
|
||||
}
|
||||
},
|
||||
submit() {},
|
||||
reset(code) {
|
||||
this.jobInForm = {
|
||||
pwoCode: code,
|
||||
mesPwoJobCvDetailList: [],
|
||||
};
|
||||
},
|
||||
scanJobCode(code) {
|
||||
if (code) {
|
||||
getDrawMat(code).then(res => {
|
||||
this.reset(code);
|
||||
this.jobInForm.type = 1;
|
||||
for (let i = 0; i < res.rows.length; i++) {
|
||||
let obj = {};
|
||||
obj.materialCode = res.rows[i].materialCode;
|
||||
obj.materialName = res.rows[i].materialName;
|
||||
obj.materialBatchNo = res.rows[i].materialBatchNo;
|
||||
this.jobInForm.mesPwoJobCvDetailList.push(obj);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
jobInSubmit() {
|
||||
this.$refs["jobInForm"].validate().then(valid => {
|
||||
this.$modal.loading('提交中')
|
||||
addConversion(this.jobInForm).then(response => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("工单领料成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.jobInForm.pwoCode = res.result;
|
||||
_this.scanJobCode(_this.jobInForm.pwoCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarworkshopCode(index) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.jobInForm.mesPwoJobCvDetailList[index].workshopCode = res.result;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
152
pages/mes/jobCv/pwoIn.vue
Normal file
152
pages/mes/jobCv/pwoIn.vue
Normal file
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms :modelValue="jobInForm" ref="jobInForm" :rules="rules">
|
||||
<uni-collapse-item title="完工转移单" :open="true">
|
||||
<uni-forms-item label="工单" :labelWidth='90' name="pwoCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" @confirm="scanJobCode"
|
||||
v-model="jobInForm.pwoCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="转移单类型" :labelWidth='90' name="type">
|
||||
<uni-easyinput type="text" disabled v-model="jobInForm.type"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="备注" :labelWidth='90' name="remark">
|
||||
<uni-easyinput autoHeight type="textarea" v-model="jobInForm.remark"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="完工转移单明细" :open="true">
|
||||
<!-- <u-button type="primary" @click="addDetail">新增</u-button>
|
||||
<u-button type="primary" @click="submit">确认</u-button> -->
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
v-for="(item, index) in jobInForm.mesPwoJobCvDetailList"
|
||||
@click="(data) => clickDetail(index,data)" @change="swipChange">
|
||||
<uni-badge :text="index+1" type="primary"></uni-badge>
|
||||
<uni-forms-item label="物料编码" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.materialCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.materialName'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialName"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="目标仓库" :name="'mesPwoJobCvDetailList.'+ index +'.whCodeDest'">
|
||||
<uni-easyinput type="text" v-model="item.whCodeDest"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="目标库位" :name="'mesPwoJobCvDetailList.'+ index +'.locCodeDest'">
|
||||
<uni-easyinput type="text" v-model="item.locCodeDest"></uni-easyinput>
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="转移数量" :labelWidth='90' :rules="rules.number"
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.number'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.number"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="jobInSubmit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getInMat,
|
||||
addConversion
|
||||
} from "@/api/mes/pwoIn.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
jobInForm: {
|
||||
mesPwoJobCvDetailList: [],
|
||||
},
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
materialCode: [{
|
||||
required: true,
|
||||
errorMessage: '请输入物料编码!'
|
||||
}],
|
||||
materialName: [{
|
||||
required: true,
|
||||
errorMessage: '请输入物料名称!'
|
||||
}],
|
||||
number: [{
|
||||
required: true,
|
||||
errorMessage: '请输入转移数量!'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addDetail() {
|
||||
this.jobInForm.mesPwoJobCvDetailList.push({});
|
||||
},
|
||||
deleteDetail(index) {
|
||||
this.jobInForm.mesPwoJobCvDetailList.splice(index, 1);
|
||||
},
|
||||
clickDetail(itemIndex, {
|
||||
position,
|
||||
index
|
||||
}) {
|
||||
if (index == 0) {
|
||||
this.deleteDetail(itemIndex);
|
||||
}
|
||||
},
|
||||
submit() {},
|
||||
reset(code) {
|
||||
this.jobInForm = {
|
||||
pwoCode: code,
|
||||
mesPwoJobCvDetailList: [],
|
||||
};
|
||||
},
|
||||
scanJobCode(code) {
|
||||
if (code) {
|
||||
getInMat(code).then(res => {
|
||||
this.reset(code);
|
||||
console.log(res);
|
||||
this.jobInForm.type = 3;
|
||||
for (let i = 0; i < res.rows.length; i++) {
|
||||
let obj = {};
|
||||
obj.materialCode = res.rows[i].materialCode;
|
||||
obj.materialName = res.rows[i].materialName;
|
||||
obj.number = res.rows[i].number;
|
||||
this.jobInForm.mesPwoJobCvDetailList.push(obj);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
jobInSubmit() {
|
||||
this.$refs["jobInForm"].validate().then(valid => {
|
||||
this.$modal.loading('提交中')
|
||||
addConversion(this.jobInForm).then(response => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("工单领料成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.jobInForm.pwoCode = res.result;
|
||||
_this.scanJobCode(_this.jobInForm.pwoCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
439
pages/mes/jobCv/pwoSearch.vue
Normal file
439
pages/mes/jobCv/pwoSearch.vue
Normal file
@@ -0,0 +1,439 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产工单" :labelWidth='90' name="pwoCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.pwoCode" type="text"
|
||||
@confirm="scanBarCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="状态" :labelWidth='90'>
|
||||
<uni-tag :text="pwotag(status)" type="warning"></uni-tag>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<uni-row style="margin-top: 20px;" :gutter="10">
|
||||
<uni-col :span="8" style="text-align: center;">
|
||||
<u-button type="warning" @click="selectPwoStock(formData.pwoCode)">物料核销</u-button>
|
||||
</uni-col>
|
||||
<uni-col :span="8" style="text-align: center;">
|
||||
<u-button type="success" @click="submitIn" :disabled="disabledIn">入库</u-button>
|
||||
</uni-col>
|
||||
<uni-col :span="8" style="text-align: center;">
|
||||
<u-button type="primary" @click="submitClose" :disabled="disabledClose">关闭工单</u-button>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
</uni-collapse>
|
||||
<view class="cu-card article ">
|
||||
<view class="cu-item shadow borderBottom" v-for="(item,index) in pwoJobList" :key="index">
|
||||
<view class="content">
|
||||
<view class="desc">
|
||||
<view class="text-content" style="font-size: 15px;">
|
||||
<view><strong>生产工单作业编码</strong> : {{item.code}}</view>
|
||||
<view><strong>制程编码</strong> : {{item.opCode}}</view>
|
||||
<view><strong>制程名称</strong> : {{item.opTitle}}</view>
|
||||
<view><strong>开工状态</strong> :
|
||||
<uni-tag :text="jobtag(item.status)" type="success"></uni-tag>
|
||||
</view>
|
||||
<view><strong>目标产量</strong> : {{item.targetNum}}</view>
|
||||
<view><strong>已完成数量</strong> : {{item.finishQty}}</view>
|
||||
<view><strong>合格总数</strong> : {{item.totalOutput}}</view>
|
||||
<view><strong>不良总数</strong> : {{item.totalDefect}}</view>
|
||||
<view><strong>报废总数</strong> : {{item.totalScrap}}</view>
|
||||
<view><strong>损耗总数</strong> : {{item.totalLoss}}</view>
|
||||
<uni-row>
|
||||
<uni-col :span="18">
|
||||
<view><strong>在制数量</strong> : {{item.makingNum}}</view>
|
||||
<view><strong>结存数量</strong> : {{item.surplusNum}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6"> <u-button type="primary" @click="report(item.code)"
|
||||
v-show="item.status<5">报工</u-button></uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="show" @close="close" @open="getMaterialStock" :closeable="true">
|
||||
<view class="cu-card article ">
|
||||
<view class="cu-item shadow borderBottom" v-for="(item,index) in materialStockList" :key="index">
|
||||
<view class="content">
|
||||
<view class="desc">
|
||||
<view class="text-content" style="font-size: 15px;">
|
||||
<view><strong>物料</strong> : {{item.materialCode+':'+item.materialName}}</view>
|
||||
<view><strong>批号</strong> : {{item.batchNo}}</view>
|
||||
<view><strong>类型</strong> :
|
||||
<uni-tag :text="typetag(item.type)" :type="colortag(item.type)"></uni-tag>
|
||||
</view>
|
||||
<view><strong>数量</strong> : {{item.number}}</view>
|
||||
<view><strong>仓库</strong> :
|
||||
<picker @change="val => {warehouseConfirm(val,item);}" :value="tyindex"
|
||||
:range="range" range-key="warehouseName">
|
||||
<view>选择:{{item.whName}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPwo,
|
||||
listPwo,
|
||||
pwoAtificialClose,
|
||||
handleIn,
|
||||
listCirculateBalance
|
||||
} from "@/api/mes/pwoDraw.js";
|
||||
import {
|
||||
listWarehouse
|
||||
} from "@/api/wms/pdcIn.js";
|
||||
import {
|
||||
listStock
|
||||
} from "@/api/mes/pwoIn.js";
|
||||
export default {
|
||||
mounted() {
|
||||
listWarehouse().then(async res => {
|
||||
this.range = res.rows
|
||||
// for (var i = 0; i < res.rows.length; i++) {
|
||||
// this.range[0][i].value = res.rows[i].warehouseCode;
|
||||
// this.range[0][i].text = res.rows[i].warehouseName;
|
||||
// }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tyindex: null,
|
||||
index: 0,
|
||||
show: false,
|
||||
materialStockList: [],
|
||||
wmsOpTransferOutStockList: [],
|
||||
disabledIn: false,
|
||||
disabledClose: false,
|
||||
formData: {
|
||||
pwoCode: null,
|
||||
},
|
||||
id: null,
|
||||
value: null,
|
||||
range: [],
|
||||
status: null,
|
||||
pwoJobList: [],
|
||||
rules: {
|
||||
pwoCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入生产工单!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
typeCancel() {
|
||||
this.warehouseshow = false;
|
||||
},
|
||||
typeConfirm(e, item) {
|
||||
item.warehouseName = this.range[e.detail.value].warehouseName;
|
||||
item.warehouseCode = this.range[e.detail.value].warehouseCode;
|
||||
this.tyindex = e.detail.value
|
||||
},
|
||||
typeClose() {
|
||||
this.warehouseshow = false;
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
/** 获取物料信息 */
|
||||
getMaterialStock(ids) {
|
||||
// 清空物料库存信息
|
||||
this.materialStockList = [];
|
||||
listStock({
|
||||
pwoBelongCode: this.formData.pwoCode
|
||||
}).then((resp) => {
|
||||
this.materialStockList = this.materialStockList.concat(resp.rows);
|
||||
});
|
||||
},
|
||||
stockConvertion(code) {
|
||||
this.selectPwoStock(code)
|
||||
|
||||
},
|
||||
selectPwoStock(pwoCode) {
|
||||
listStock({
|
||||
pwoBelongCode: pwoCode
|
||||
}).then((res) => {
|
||||
if (res.rows.length > 0) {
|
||||
this.wmsOpTransferOutStockList = res.rows.map(obj => {
|
||||
return {
|
||||
stockId: obj.id,
|
||||
materialCode: obj.materialCode,
|
||||
materialName: obj.materialName,
|
||||
batchNo: obj.batchNo,
|
||||
lotNo: obj.lotNo,
|
||||
pieceNo: obj.pieceNo,
|
||||
storageLocationCode: obj.storageLocationCode,
|
||||
type: obj.type,
|
||||
num: obj.number
|
||||
}
|
||||
});
|
||||
console.log(this.wmsOpTransferOutStockList)
|
||||
if (this.wmsOpTransferOutStockList && this.wmsOpTransferOutStockList != []) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/mes/jobCv/stockConvertion?wmsOpTransferOutStockList=' +
|
||||
encodeURIComponent(
|
||||
JSON.stringify(this.wmsOpTransferOutStockList))
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$modal.msg("未查询到该工单工序消耗信息!")
|
||||
}
|
||||
});
|
||||
},
|
||||
colortag(type) {
|
||||
switch (Number(type)) {
|
||||
case 1:
|
||||
return 'success';
|
||||
break;
|
||||
case 2:
|
||||
return 'warning';
|
||||
break;
|
||||
case 3:
|
||||
return 'error';
|
||||
break;
|
||||
case 4:
|
||||
return 'primary';
|
||||
break;
|
||||
default:
|
||||
return '无';
|
||||
break;
|
||||
}
|
||||
},
|
||||
typetag(type) {
|
||||
switch (Number(type)) {
|
||||
case 1:
|
||||
return '合格品';
|
||||
break;
|
||||
case 2:
|
||||
return '不良品';
|
||||
break;
|
||||
case 3:
|
||||
return '报废品';
|
||||
break;
|
||||
case 4:
|
||||
return '待退料';
|
||||
break;
|
||||
default:
|
||||
return '无';
|
||||
break;
|
||||
}
|
||||
},
|
||||
jobtag(status) {
|
||||
switch (Number(status)) {
|
||||
case 1:
|
||||
return '计划中';
|
||||
break;
|
||||
case 2:
|
||||
return '材料转入';
|
||||
break;
|
||||
case 3:
|
||||
return '作业开工';
|
||||
break;
|
||||
case 4:
|
||||
return '作业暂停';
|
||||
break;
|
||||
case 5:
|
||||
return '作业完工';
|
||||
break;
|
||||
case 6:
|
||||
return '完成品转出';
|
||||
break;
|
||||
case 7:
|
||||
return '取消';
|
||||
break;
|
||||
default:
|
||||
return '无';
|
||||
break;
|
||||
}
|
||||
|
||||
},
|
||||
pwotag(status) {
|
||||
switch (Number(status)) {
|
||||
case 1:
|
||||
return '计划中';
|
||||
break;
|
||||
case 2:
|
||||
return '已生成作业';
|
||||
break;
|
||||
case 3:
|
||||
return '已投料';
|
||||
break;
|
||||
case 4:
|
||||
return '已领料';
|
||||
break;
|
||||
case 5:
|
||||
return '已开工';
|
||||
break;
|
||||
case 6:
|
||||
return '暂停';
|
||||
break;
|
||||
case 7:
|
||||
return '已完成';
|
||||
break;
|
||||
case 8:
|
||||
return '结案';
|
||||
break;
|
||||
case 9:
|
||||
return '取消';
|
||||
break;
|
||||
case 10:
|
||||
return '待入库';
|
||||
break;
|
||||
case 11:
|
||||
return '待转出';
|
||||
break;
|
||||
case 12:
|
||||
return '已转出';
|
||||
break;
|
||||
case 13:
|
||||
return '其他';
|
||||
break;
|
||||
default:
|
||||
return '无';
|
||||
break;
|
||||
}
|
||||
},
|
||||
scanBarCode() {
|
||||
const _this = this;
|
||||
_this.disabledClose = false;
|
||||
_this.disabledIn = false;
|
||||
if (_this.formData.pwoCode) {
|
||||
let obj = {
|
||||
pwoCode: _this.formData.pwoCode
|
||||
}
|
||||
listPwo(obj).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
_this.id = res.rows[0].id;
|
||||
_this.status = res.rows[0].status;
|
||||
if (_this.status >= 7) {
|
||||
_this.disabledClose = true;
|
||||
} else if (_this.status != 10) {
|
||||
_this.disabledIn = true;
|
||||
}
|
||||
} else {
|
||||
_this.$modal.msg("未找到该工单!")
|
||||
}
|
||||
});
|
||||
_this.$modal.loading('提交中')
|
||||
listCirculateBalance(obj).then((response) => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.pwoJobList = response.rows;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoCode = res.result;
|
||||
_this.scanBarCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
submitClose() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定关闭该生产工单吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
//判断工单是否能关闭
|
||||
if (_this.status >= 7) {
|
||||
_this.$modal.msg("该工单无法关闭!")
|
||||
} else {
|
||||
_this.$modal.loading('提交中')
|
||||
pwoAtificialClose('"' + _this.id + '"').then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("工单关闭成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
report(code) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/mes/jobReport/onceReport?code=' + code
|
||||
});
|
||||
},
|
||||
async submitIn() {
|
||||
this.materialStockList = [];
|
||||
this.$modal.loading('提交中')
|
||||
await listStock({
|
||||
pwoBelongCode: this.formData.pwoCode
|
||||
}).then((resp) => {
|
||||
this.$modal.closeLoading();
|
||||
this.materialStockList = this.materialStockList.concat(resp.rows);
|
||||
uni.navigateTo({
|
||||
url: '/pages/mes/jobCv/pwoWarehousing?pwoCode=' + this.formData.pwoCode +
|
||||
'&materialStockList=' + encodeURIComponent(JSON.stringify(
|
||||
this.materialStockList))
|
||||
});
|
||||
});
|
||||
|
||||
// const _this = this;
|
||||
// this.$refs.form.validate().then(res => {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '您确定入库该生产工单吗?',
|
||||
// success: function(res) {
|
||||
// if (res.confirm) {
|
||||
// if (_this.status != 10) {
|
||||
// console.log(_this.status);
|
||||
// _this.$modal.msg("该工单不是‘待入库’状态,请重新输入!")
|
||||
// } else {
|
||||
// _this.formData.warehouseCode = _this.value
|
||||
// console.log(_this.formData)
|
||||
// handleIn(Number(_this.formData.pwoCode.slice(4)), _this.formData
|
||||
// .warehouseCode).then(res => {
|
||||
// _this.$modal.msgSuccess("入库成功!");
|
||||
// setTimeout(() => {
|
||||
// _this.$tab.switchTab("/pages/work/index");
|
||||
// }, 500);
|
||||
// });
|
||||
// }
|
||||
// } else if (res.cancel) {
|
||||
// console.log('用户点击取消');
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.cu-card.article>.cu-item .content .text-content {
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
.cu-card>.cu-item {
|
||||
margin: 13px 0;
|
||||
}
|
||||
</style>
|
||||
271
pages/mes/jobCv/pwoWarehousing.vue
Normal file
271
pages/mes/jobCv/pwoWarehousing.vue
Normal file
@@ -0,0 +1,271 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<uni-collapse>
|
||||
|
||||
<uni-forms :modelValue="formData" ref="form" :rules="rules">
|
||||
|
||||
<uni-collapse-item title="工单入库单" :open="true">
|
||||
<uni-forms-item label="生产工单" :labelWidth='90' name="pwoCode">
|
||||
<uni-easyinput suffixIcon="scan" v-model="formData.pwoCode" @iconClick="scanBar" type="text"
|
||||
@confirm="scanBarCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
|
||||
</uni-collapse-item>
|
||||
<!-- <u-divider text="工单入库单明细"></u-divider> -->
|
||||
<!-- <uni-collapse-item title="工单入库单明细" :open="true"> -->
|
||||
<view :key="item.id" v-for="(item, index) in materialStockList" style="over-flowe">
|
||||
<uni-badge :text="index+1" type="primary"></uni-badge>
|
||||
<uni-forms-item label="物料编码" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'. materialCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='90'
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.materialName'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialName"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="类型" :labelWidth="90">
|
||||
<uni-tag :text="typetag(item.type)" :type="colortag(item.type)"
|
||||
@click="showConfirm(index)"></uni-tag>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="数量" :labelWidth='90' :rules="rules.number"
|
||||
:name="'mesPwoJobCvDetailList.'+ index +'.number'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.number" min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="仓库" :labelWidth="90">
|
||||
<!-- <view class="item" catchtap="hidekeyborad">
|
||||
<picker @change="val => {typeConfirm(val,item);}" :value="tyindex" :range="range"
|
||||
range-key="label">
|
||||
<uni-easyinput type="text" v-model="item.whName" @focus="focus" />
|
||||
</picker>
|
||||
</view> -->
|
||||
<uni-data-select v-model="item.whCode" :localdata="range"></uni-data-select>
|
||||
|
||||
</uni-forms-item>
|
||||
|
||||
</view>
|
||||
<!-- </uni-collapse-item> -->
|
||||
|
||||
</uni-forms>
|
||||
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="submit">入库</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPwo,
|
||||
listPwo,
|
||||
handleIn
|
||||
} from "@/api/mes/pwoDraw.js";
|
||||
import {
|
||||
listWarehouse
|
||||
} from "@/api/wms/pdcIn.js";
|
||||
import {
|
||||
listStock
|
||||
} from "@/api/mes/pwoIn.js";
|
||||
export default {
|
||||
onLoad: function(option) {
|
||||
console.log(option);
|
||||
if (option) {
|
||||
this.formData.pwoCode = option.pwoCode;
|
||||
this.materialStockList = JSON.parse(decodeURIComponent(option.materialStockList));
|
||||
this.status = 10;
|
||||
this.isSearchRoute = true;
|
||||
this.scanBarCode()
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
listWarehouse().then(async res => {
|
||||
// this.range = [res.rows]
|
||||
console.log(this.range)
|
||||
// res.rows.map(item => {
|
||||
// item.label = item.warehouseCode + ':' + item.warehouseName;
|
||||
// return item
|
||||
// })
|
||||
this.range = res.rows.map(item => {
|
||||
return {
|
||||
text: item.warehouseCode + ':' + item.warehouseName,
|
||||
value: item.warehouseCode,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
whName: null,
|
||||
flag: false,
|
||||
isSearchRoute: false,
|
||||
selectedWarehouseName: [],
|
||||
materialStockList: [],
|
||||
formData: {
|
||||
pwoCode: null,
|
||||
},
|
||||
tyindex: null,
|
||||
value: 0,
|
||||
range: [],
|
||||
status: null,
|
||||
rules: {
|
||||
pwoCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入生产工单'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
focus() {
|
||||
console.log('key')
|
||||
if (this.flag) {
|
||||
return
|
||||
} else {
|
||||
console.log('key')
|
||||
// plus.key.hideSoftKeybord()
|
||||
uni.hideKeyboard()
|
||||
}
|
||||
},
|
||||
typetag(type) {
|
||||
switch (Number(type)) {
|
||||
case 1:
|
||||
return '合格品';
|
||||
break;
|
||||
case 2:
|
||||
return '不良品';
|
||||
break;
|
||||
case 3:
|
||||
return '报废品';
|
||||
break;
|
||||
case 4:
|
||||
return '待退料';
|
||||
break;
|
||||
default:
|
||||
return '无';
|
||||
break;
|
||||
}
|
||||
},
|
||||
colortag(type) {
|
||||
switch (Number(type)) {
|
||||
case 1:
|
||||
return 'success';
|
||||
break;
|
||||
case 2:
|
||||
return 'warning';
|
||||
break;
|
||||
case 3:
|
||||
return 'error';
|
||||
break;
|
||||
case 4:
|
||||
return 'primary';
|
||||
break;
|
||||
default:
|
||||
return '无';
|
||||
break;
|
||||
}
|
||||
},
|
||||
change(e) {
|
||||
console.log("e:", e);
|
||||
},
|
||||
scanBarCode() {
|
||||
console.log(this.formData.pwoCode);
|
||||
const _this = this;
|
||||
console.log(_this.formData.pwoCode);
|
||||
if (_this.formData.pwoCode) {
|
||||
let obj = {
|
||||
pwoCode: _this.formData.pwoCode
|
||||
}
|
||||
console.log(1);
|
||||
listPwo(obj).then(async res => {
|
||||
console.log(res.rows[0].id);
|
||||
_this.pwoId = res.rows[0].id;
|
||||
_this.status = res.rows[0].status;
|
||||
})
|
||||
}
|
||||
/** 获取物料信息 */
|
||||
|
||||
// 清空物料库存信息
|
||||
this.materialStockList = [];
|
||||
console.log(this.formData.pwoCode);
|
||||
listStock({
|
||||
pwoBelongCode: this.formData.pwoCode
|
||||
}).then((resp) => {
|
||||
console.log(3);
|
||||
this.materialStockList = this.materialStockList.concat(resp.rows);
|
||||
});
|
||||
|
||||
},
|
||||
typeConfirm(e, item) {
|
||||
this.tyindex = null;
|
||||
console.log(item)
|
||||
item.whName = this.range[e.detail.value].warehouseName;
|
||||
item.whCode = this.range[e.detail.value].warehouseCode;
|
||||
this.tyindex = e.detail.value
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoCode = res.result;
|
||||
_this.scanBarCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定入库该生产工单吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
if (_this.status != 10) {
|
||||
console.log(_this.status);
|
||||
_this.$modal.msg("该工单不是‘待入库’状态,请重新输入!")
|
||||
} else {
|
||||
// _this.formData.warehouseCode = _this.value;
|
||||
let stockWhList = _this.materialStockList.map((obj) => {
|
||||
return {
|
||||
id: obj.id,
|
||||
whCode: obj.whCode,
|
||||
};
|
||||
});
|
||||
_this.$modal.loading('提交中')
|
||||
handleIn(_this.pwoId, '1', stockWhList).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("入库成功!");
|
||||
|
||||
if (_this.isSearchRoute = true) {
|
||||
setTimeout(() => {
|
||||
_this.$tab.navigateBack();
|
||||
}, 500);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab(
|
||||
"/pages/work/index");
|
||||
}, 500);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
upLoadSelect /deep/ .uni-select__selector-scroll {
|
||||
overflow: hidden;
|
||||
height: 1500px; //调整为合适的高度即可
|
||||
}
|
||||
</style>
|
||||
102
pages/mes/jobCv/stockConvertion.vue
Normal file
102
pages/mes/jobCv/stockConvertion.vue
Normal file
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<view class="cu-card article ">
|
||||
<uni-row>
|
||||
<uni-col :span="6">
|
||||
<u-button type="success" @click="restore">还原</u-button>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<view class="cu-item shadow borderBottom" v-for="(item,index) in wmsOpTransferOutStockList" :key="index">
|
||||
<view class="content">
|
||||
<view class="desc">
|
||||
<view class="text-content" style="font-size: 15px;">
|
||||
<view><strong>物料编码</strong> : {{item.materialCode}}</view>
|
||||
<view><strong>物料名称</strong> : {{item.materialName}}</view>
|
||||
<view><strong>批号</strong> : {{item.batchNo}}</view>
|
||||
<view><strong>件号</strong> : {{item.pieceNo}}</view>
|
||||
<view><strong>库位</strong> : {{item.storageLocationCode}}</view>
|
||||
<view><uni-row>
|
||||
<uni-col :span="3">
|
||||
<strong>数量</strong> :
|
||||
</uni-col>
|
||||
<uni-col :span="21"> <u-number-box v-model="item.num" @change="valChange"
|
||||
inputWidth="120"></u-number-box></uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
<view><strong>单位</strong> : {{item.unitId}}</view>
|
||||
<uni-row>
|
||||
<uni-col :span="18">
|
||||
<view><strong>备注</strong> : {{item.remark}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<u-button size="small" type="error" icon="trash"
|
||||
@click="deleteList(index)">删除</u-button></uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
customizeConvert
|
||||
} from "@/api/mes/pwoIn.js";
|
||||
export default {
|
||||
onLoad: function(option) {
|
||||
console.log(option);
|
||||
this.wmsOpTransferOutStockList = JSON.parse(decodeURIComponent(
|
||||
option.wmsOpTransferOutStockList));
|
||||
this.formerWmsOpTransferOutStockList = JSON.parse(decodeURIComponent(
|
||||
option.wmsOpTransferOutStockList));
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
wmsOpTransferOutStockList: [],
|
||||
formerWmsOpTransferOutStockList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
deleteList(i) {
|
||||
this.formerWmsOpTransferOutStockList = [...this.formerWmsOpTransferOutStockList];
|
||||
this.wmsOpTransferOutStockList.splice(i, 1);
|
||||
console.log(this.wmsOpTransferOutStockList);
|
||||
},
|
||||
restore() {
|
||||
this.wmsOpTransferOutStockList = this.formerWmsOpTransferOutStockList;
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定核销吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
let requestData = {
|
||||
wmsOpTransferOutStockList: _this.wmsOpTransferOutStockList
|
||||
}
|
||||
console.log(_this.wmsOpTransferOutStockList);
|
||||
_this.$modal.loading('提交中')
|
||||
customizeConvert(requestData).then((response) => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("核销成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.navigateBack();
|
||||
}, 500);
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.cu-card.article>.cu-item .content .text-content {
|
||||
height: 100% !important;
|
||||
}
|
||||
</style>
|
||||
205
pages/mes/jobQuality/jobQuality.vue
Normal file
205
pages/mes/jobQuality/jobQuality.vue
Normal file
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-forms-item label="作业编码" :labelWidth='90' name="code">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode" v-model="formData.code"
|
||||
type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检结果" :labelWidth='90' name="qcFlag">
|
||||
<u-radio-group v-model="formData.qcFlag" placement="row">
|
||||
<u-radio v-for="(item, index) in qc_bill_result_Options" :key="index" :label="item.text"
|
||||
:name="item.name"></u-radio>
|
||||
</u-radio-group>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检人" :labelWidth='90' name="qcBy">
|
||||
<uni-easyinput v-model="formData.qcBy" type="text" suffixIcon="scan" @iconClick="scanBarqcBy" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="图片" :labelWidth='90' name="qcImg">
|
||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
||||
:maxCount="10"></u-upload>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPwoJob,
|
||||
listPwoJob,
|
||||
updatePwoJob,
|
||||
} from "@/api/mes/jobReport.js";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import {
|
||||
uploadImage,
|
||||
getStandardList,
|
||||
addQualityHistoryList,
|
||||
listQualityHistory,
|
||||
updateQualityHistory
|
||||
} from "@/api/qc/qc.js";
|
||||
export default {
|
||||
mounted() {
|
||||
getDicts("qc_bill_result").then(res => {
|
||||
this.qc_bill_result_Options = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
name: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
qc_bill_result_Options: [],
|
||||
fileList1: [],
|
||||
formData: {
|
||||
code: null,
|
||||
qcFlag: null,
|
||||
qcBy: null,
|
||||
qcImg: null
|
||||
},
|
||||
rules: {
|
||||
code: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入作业!'
|
||||
}]
|
||||
},
|
||||
qcFlag: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入质检结果!'
|
||||
}]
|
||||
},
|
||||
qcBy: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入质检人!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 删除图片
|
||||
deletePic(event) {
|
||||
this[`fileList${event.name}`].splice(event.index, 1)
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file)
|
||||
console.log(event)
|
||||
let fileListLen = this[`fileList${event.name}`].length
|
||||
lists.map((item) => {
|
||||
this[`fileList${event.name}`].push({
|
||||
...item,
|
||||
status: 'uploading',
|
||||
message: '上传中'
|
||||
})
|
||||
})
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const result = await this.uploadFilePromise(lists[i].url)
|
||||
let item = this[`fileList${event.name}`][fileListLen]
|
||||
// console.log(item)
|
||||
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
||||
status: 'success',
|
||||
message: '',
|
||||
url: result
|
||||
}))
|
||||
fileListLen++
|
||||
}
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let a = uploadImage({
|
||||
filePath: url
|
||||
}).then(response => {
|
||||
uni.showToast({
|
||||
title: "上传成功",
|
||||
icon: 'success'
|
||||
});
|
||||
console.log(response)
|
||||
resolve(response.fileName)
|
||||
});
|
||||
})
|
||||
},
|
||||
// selectQcFlag(e) {
|
||||
// console.log(e, this.formData.qcFlag)
|
||||
// },
|
||||
scanBarCode(code) {
|
||||
if (code) {
|
||||
listPwoJob({
|
||||
code: code
|
||||
}).then(async res => {
|
||||
console.log(res);
|
||||
if (res.rows != null && res.rows.length > 0) {
|
||||
this.formData = res.rows[0]
|
||||
} else {
|
||||
this.$modal.msg("未查询到该作业!");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
//作业编码
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.code = res.result;
|
||||
_this.scanBarCode(_this.formData.code);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检人
|
||||
scanBarqcBy() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcBy = res.result;
|
||||
_this.scanBarCode(_this.formData.qcBy);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该质检吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
if (_this.fileList1.length > 0) {
|
||||
_this.formData.qcImg = _this.fileList1.map(obj => obj.url)
|
||||
.join(', ');
|
||||
}
|
||||
console.log(_this.formData)
|
||||
_this.$modal.loading('提交中')
|
||||
updatePwoJob(_this.formData).then(response => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("质检成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab(
|
||||
"/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
344
pages/mes/jobReport/defect.vue
Normal file
344
pages/mes/jobReport/defect.vue
Normal file
@@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="作业编码" :labelWidth='80' name="pwoJobCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" v-model="formData.pwoJobCode"
|
||||
@confirm="scanBarCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="工单" :labelWidth='80' name="pwoCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.pwoCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="产品编码" :labelWidth='80' name="ptNoTar">
|
||||
<uni-easyinput disabled type="text" v-model="formData.ptNoTar" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="产品名称" :labelWidth='80' name="ptTitleTar">
|
||||
<uni-easyinput disabled type="text" v-model="formData.ptTitleTar" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="设备编号" :labelWidth='80' name="machineId">
|
||||
<uni-easyinput disabled type="text" v-model="formData.machineId" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="批号" :labelWidth='80' name="batchNo">
|
||||
<uni-easyinput disabled type="text" v-model="formData.batchNo" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="制程编码" :labelWidth='80' name="opCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.opCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="制程名称" :labelWidth='80' name="opTitle">
|
||||
<uni-easyinput disabled type="text" v-model="formData.opTitle" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="用时(s)" :labelWidth='80' name="timeTake">
|
||||
<uni-easyinput type="number" v-model="formData.timeTake" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="报工类型" :labelWidth='80' name="type">
|
||||
<uni-easyinput disabled type="text" v-model="formData.type" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="报工数量" :labelWidth='80' name="reportNumber">
|
||||
<uni-easyinput type="number" :placeholder="'可报工数量:'+reportableNum"
|
||||
v-model="formData.reportNumber" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="不良原因" :labelWidth='80' name="reason">
|
||||
<uni-data-select v-model="formData.reason" :localdata="reasonOptions"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产员工编码" :labelWidth='80' name="createByCode">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarCreateBy"
|
||||
v-model="formData.createByCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产员工" :labelWidth='80' name="createByName">
|
||||
<uni-easyinput disabled type="text" v-model="formData.createByName" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="是否录入件号" :labelWidth='120'>
|
||||
<uni-data-checkbox v-model="radio" :localdata="pieceIn"></uni-data-checkbox>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<view v-show="radio==1">
|
||||
<uni-forms-item label="件号" :labelWidth='80' name="pieceNo">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarPieceNo" type="text"
|
||||
v-model="formData.pieceNo" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="开工时间" :labelWidth='90'>
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="datetime" v-model="formData.startTime" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="完工时间" :labelWidth='90' name="endTime">
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="datetime" v-model="formData.endTime" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit" v-if="!isPwoRoute">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listPwoJob,
|
||||
addReport,
|
||||
getEquipment,
|
||||
addReportEnterPiece
|
||||
} from "@/api/mes/jobReport.js";
|
||||
import {
|
||||
listEmpEqpHistory,
|
||||
listEmployee,
|
||||
listConversion
|
||||
} from "@/api/mes/jobIn.js";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
|
||||
export default {
|
||||
onLoad: function(option) {
|
||||
// 获取当前时间
|
||||
var currentDate = new Date();
|
||||
// 格式化为字符串(YYYY-MM-DD HH:mm:ss)
|
||||
var year = currentDate.getFullYear();
|
||||
var month = ("0" + (currentDate.getMonth() + 1)).slice(-2);
|
||||
var day = ("0" + currentDate.getDate()).slice(-2);
|
||||
var hours = ("0" + currentDate.getHours()).slice(-2);
|
||||
var minutes = ("0" + currentDate.getMinutes()).slice(-2);
|
||||
var seconds = ("0" + currentDate.getSeconds()).slice(-2);
|
||||
var formattedDate = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
||||
|
||||
// 将当前时间赋值给 formData.endTime
|
||||
this.formData.endTime = formattedDate;
|
||||
this.formData.way = '人工报工';
|
||||
this.formData.type = '不良品';
|
||||
if (option) {
|
||||
this.formData = JSON.parse(decodeURIComponent(option.formData));
|
||||
this.isPwoRoute = true;
|
||||
}
|
||||
getDicts("mes_job_report_defect").then(res => {
|
||||
this.reasonOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
// this.formData.createByName = this.$store.state.user.name;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isPwoRoute: false,
|
||||
formData: {
|
||||
pwoJobCode: null,
|
||||
pwoCode: null,
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
machineId: null,
|
||||
batchNo: null,
|
||||
createByName: null,
|
||||
createByCode: null,
|
||||
pieceNo: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
reportableNum: 0,
|
||||
radio: 0,
|
||||
pieceIn: [{
|
||||
text: '是',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
text: '否',
|
||||
value: 0
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
pwoJobCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入作业编码!'
|
||||
}]
|
||||
},
|
||||
createByCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入生产员工编码!'
|
||||
}]
|
||||
},
|
||||
reportNumber: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入报工数量!'
|
||||
}]
|
||||
},
|
||||
reason: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入不良原因!'
|
||||
}]
|
||||
},
|
||||
endTime: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入完工时间!'
|
||||
}]
|
||||
},
|
||||
// machineId: {
|
||||
// rules: [
|
||||
// { required: true, errorMessage:'请输入设备编码!' }
|
||||
// ]
|
||||
// },
|
||||
},
|
||||
reasonOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
//判断是否选择录入件号
|
||||
if (this.radio == 1) {
|
||||
//判断是否输入件号
|
||||
if (this.formData.pieceNo && this.formData.pieceNo != "") {
|
||||
this.$modal.loading('提交中')
|
||||
addReportEnterPiece(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("报工成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("请输入件号!");
|
||||
}
|
||||
} else {
|
||||
this.$modal.loading('提交中')
|
||||
addReport(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("报工成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.pwoJobCode) {
|
||||
listPwoJob({
|
||||
code: this.formData.pwoJobCode
|
||||
}).then(async res => {
|
||||
let jobs = res.rows;
|
||||
if (jobs.length == 0) {
|
||||
this.$modal.msg("未检索到该作业编码相关的信息!");
|
||||
} else {
|
||||
let job = jobs[0];
|
||||
this.formData.pwoCode = job.pwoCode;
|
||||
this.formData.ptNoTar = job.ptNoTar;
|
||||
this.formData.ptTitleTar = job.ptTitleTar;
|
||||
this.formData.opCode = job.opCode;
|
||||
this.formData.opTitle = job.opTitle;
|
||||
this.reportableNum = job.targetNum - job.finishQty;
|
||||
if (job.eqpId) {
|
||||
await getEquipment(job.eqpId).then(res => {
|
||||
this.formData.machineId = res.data.equipmentCode;
|
||||
})
|
||||
//调取最后一条转入记录的操作人
|
||||
let code = {
|
||||
powJobCode: this.formData.pwoJobCode
|
||||
}
|
||||
listConversion(code).then(async res => {
|
||||
if (res.rows[0].operateBy && res.rows[0].operateBy != "") {
|
||||
this.formData.createByName = res.rows[0].operateBy;
|
||||
let arry = {
|
||||
name: this.formData.createByName
|
||||
}
|
||||
listEmployee(arry).then(async res => {
|
||||
|
||||
this.formData.createByCode = res.rows[0]
|
||||
.empCode;
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
this.formData.batchNo = job.batchNo;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
scanBarCreateBy() {
|
||||
if (this.formData.createByCode) {
|
||||
let obj = {
|
||||
empCode: this.formData.createByCode
|
||||
}
|
||||
listEmployee(obj).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
this.formData.createByName = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员信息!");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoJobCode = res.result;
|
||||
_this.scanBarCode(_this.formData.pwoJobCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.createByCode = res.result;
|
||||
_this.scanBarCreateBy();
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarPieceNo() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pieceNo = res.result;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
81
pages/mes/jobReport/index.vue
Normal file
81
pages/mes/jobReport/index.vue
Normal file
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<view class="uni-padding-wrap uni-common-mt" >
|
||||
|
||||
<view class="grid-body">
|
||||
<uni-grid :column="3" :showBorder="false" @change="changeGrid1">
|
||||
<uni-grid-item :index="1" style="line-height: 100px;margin-top:100px;margin-left:37.5%;width: 100%;">
|
||||
<view class="grid-item-box">
|
||||
<uni-icons custom-prefix="iconfont" type="icon-tongguo" size="30"></uni-icons>
|
||||
<text class="text">合格品报工</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item :index="2" style="line-height: 100px;margin-left:37.5%;width: 100%;">
|
||||
<view class="grid-item-box">
|
||||
<uni-icons custom-prefix="iconfont" type="icon-shenhebutongguo" size="30"></uni-icons>
|
||||
<text class="text">不良品报工</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
<uni-grid-item :index="3" style="line-height: 100px;margin-left:37.5%;width: 100%;">
|
||||
<view class="grid-item-box">
|
||||
<uni-icons custom-prefix="iconfont" type="icon-tubiaozhizuomoban-134" size="30"></uni-icons>
|
||||
<text class="text">报废品报工</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <u-button type="primary" @click="$tab.navigateTo('/pages/mes/jobReport/pass')">合格品报工</u-button>
|
||||
|
||||
<u-button style="margin-top:100px; background-color:#ffff00;" @click="$tab.navigateTo('/pages/mes/jobReport/defect')">不良品报工</u-button>
|
||||
|
||||
<u-button style="margin-top:100px;;" type="warn" @click="$tab.navigateTo('/pages/mes/jobReport/scrap')">报废品报工</u-button>
|
||||
</view> -->
|
||||
<!-- </view> -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
onLoad: function() {
|
||||
},
|
||||
methods: {
|
||||
changeGrid1(e) {
|
||||
console.log(e.detail.index);
|
||||
if (e.detail.index == 1) {
|
||||
this.$tab.navigateTo('/pages/mes/jobReport/pass');
|
||||
} else if (e.detail.index == 2) {
|
||||
this.$tab.navigateTo('/pages/mes/jobReport/defect');
|
||||
} else if (e.detail.index == 3) {
|
||||
this.$tab.navigateTo('/pages/mes/jobReport/scrap');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 200rpx;
|
||||
width: 200rpx;
|
||||
margin-top: 200rpx;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.text-area {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
color: #8f8f94;
|
||||
}
|
||||
</style>
|
||||
324
pages/mes/jobReport/loss.vue
Normal file
324
pages/mes/jobReport/loss.vue
Normal file
@@ -0,0 +1,324 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="作业编码" :labelWidth='80' name="pwoJobCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" v-model="formData.pwoJobCode"
|
||||
@confirm="scanBarCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="工单" :labelWidth='80' name="pwoCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.pwoCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="产品编码" :labelWidth='80' name="ptNoTar">
|
||||
<uni-easyinput disabled type="text" v-model="formData.ptNoTar" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="产品名称" :labelWidth='80' name="ptTitleTar">
|
||||
<uni-easyinput disabled type="text" v-model="formData.ptTitleTar" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="设备编号" :labelWidth='80' name="machineId">
|
||||
<uni-easyinput disabled type="text" v-model="formData.machineId" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="批号" :labelWidth='80' name="batchNo">
|
||||
<uni-easyinput disabled type="text" v-model="formData.batchNo" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="制程编码" :labelWidth='80' name="opCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.opCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="制程名称" :labelWidth='80' name="opTitle">
|
||||
<uni-easyinput disabled disabled type="text" v-model="formData.opTitle" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="用时(s)" :labelWidth='80' name="timeTake">
|
||||
<uni-easyinput type="number" v-model="formData.timeTake" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="报工类型" :labelWidth='80' name="type">
|
||||
<uni-easyinput disabled disabled type="text" v-model="formData.type" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="报工数量" :labelWidth='80' name="reportNumber">
|
||||
<uni-easyinput type="number" :placeholder="'可报工数量:'+reportableNum"
|
||||
v-model="formData.reportNumber" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="损耗原因" :labelWidth='80' name="reason">
|
||||
<uni-data-select v-model="formData.reason" :localdata="reasonOptions"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产员工编码" :labelWidth='80' name="createByCode">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarCreateBy"
|
||||
v-model="formData.createByCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产员工" :labelWidth='80' name="createByName">
|
||||
<uni-easyinput disabled type="text" v-model="formData.createByName" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="开工时间" :labelWidth='90'>
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="datetime" v-model="formData.startTime" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="完工时间" :labelWidth='90' name="endTime">
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="datetime" v-model="formData.endTime" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit" v-if="!isPwoRoute">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listPwoJob,
|
||||
addReport,
|
||||
getEquipment,
|
||||
addReportEnterPiece
|
||||
} from "@/api/mes/jobReport.js";
|
||||
import {
|
||||
listEmpEqpHistory,
|
||||
listEmployee,
|
||||
listConversion
|
||||
} from "@/api/mes/jobIn.js";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
|
||||
export default {
|
||||
onLoad: function(option) {
|
||||
// 获取当前时间
|
||||
var currentDate = new Date();
|
||||
// 格式化为字符串(YYYY-MM-DD HH:mm:ss)
|
||||
var year = currentDate.getFullYear();
|
||||
var month = ("0" + (currentDate.getMonth() + 1)).slice(-2);
|
||||
var day = ("0" + currentDate.getDate()).slice(-2);
|
||||
var hours = ("0" + currentDate.getHours()).slice(-2);
|
||||
var minutes = ("0" + currentDate.getMinutes()).slice(-2);
|
||||
var seconds = ("0" + currentDate.getSeconds()).slice(-2);
|
||||
var formattedDate = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
||||
// 将当前时间赋值给 formData.endTime
|
||||
this.formData.endTime = formattedDate;
|
||||
this.formData.way = '人工报工';
|
||||
this.formData.type = '损耗';
|
||||
if (option) {
|
||||
this.formData = JSON.parse(decodeURIComponent(option.formData));
|
||||
this.isPwoRoute = true;
|
||||
}
|
||||
getDicts("mes_job_report_loss").then(res => {
|
||||
this.reasonOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
// this.formData.createByName = this.$store.state.user.name;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isPwoRoute: false,
|
||||
reasonOptions: [],
|
||||
formData: {
|
||||
pwoJobCode: null,
|
||||
pwoCode: null,
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
machineId: null,
|
||||
batchNo: null,
|
||||
createByName: null,
|
||||
createByCode: null,
|
||||
pieceNo: null,
|
||||
},
|
||||
radio: 0,
|
||||
reportableNum: 0,
|
||||
pieceIn: [{
|
||||
text: '是',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
text: '否',
|
||||
value: 0
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
pwoJobCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入作业编码!'
|
||||
}]
|
||||
},
|
||||
createByCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入生产员工编码!'
|
||||
}]
|
||||
},
|
||||
reportNumber: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入报工数量!'
|
||||
}]
|
||||
},
|
||||
reason: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入不良原因!'
|
||||
}]
|
||||
},
|
||||
endTime: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入完工时间!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
//判断是否选择录入件号
|
||||
if (this.radio == 1) {
|
||||
//判断是否输入件号
|
||||
if (this.formData.pieceNo && this.formData.pieceNo != "") {
|
||||
this.$modal.loading('提交中')
|
||||
addReportEnterPiece(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("报工成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("请输入件号!");
|
||||
}
|
||||
} else {
|
||||
this.$modal.loading('提交中')
|
||||
addReport(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("报工成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.pwoJobCode) {
|
||||
let obj = {
|
||||
code: this.formData.pwoJobCode
|
||||
}
|
||||
listPwoJob(obj).then(async res => {
|
||||
let jobs = res.rows;
|
||||
if (jobs.length == 0) {
|
||||
this.$modal.msg("未检索到该作业编码相关的信息!");
|
||||
} else {
|
||||
let job = jobs[0];
|
||||
this.formData.pwoCode = job.pwoCode;
|
||||
this.formData.ptNoTar = job.ptNoTar;
|
||||
this.formData.ptTitleTar = job.ptTitleTar;
|
||||
this.formData.opCode = job.opCode;
|
||||
this.formData.opTitle = job.opTitle;
|
||||
this.reportableNum = job.targetNum - job.finishQty;
|
||||
if (job.eqpId) {
|
||||
await getEquipment(job.eqpId).then(res => {
|
||||
this.formData.machineId = res.data.equipmentCode;
|
||||
})
|
||||
|
||||
//调取最后一条转入记录的操作人
|
||||
let code = {
|
||||
powJobCode: this.formData.pwoJobCode
|
||||
}
|
||||
listConversion(code).then(async res => {
|
||||
if (res.rows[0].operateBy && res.rows[0].operateBy != "") {
|
||||
this.formData.createByName = res.rows[0].operateBy;
|
||||
let arry = {
|
||||
name: this.formData.createByName
|
||||
}
|
||||
listEmployee(arry).then(async res => {
|
||||
this.formData.createByCode = res.rows[0]
|
||||
.empCode;
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
this.formData.batchNo = job.batchNo;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
scanBarCreateBy() {
|
||||
if (this.formData.createByCode) {
|
||||
let obj = {
|
||||
empCode: this.formData.createByCode
|
||||
}
|
||||
listEmployee(obj).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
this.formData.createByName = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员信息!");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoJobCode = res.result;
|
||||
_this.scanBarCode(_this.formData.pwoJobCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.createByCode = res.result;
|
||||
_this.scanBarCreateBy();
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarPieceNo() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pieceNo = res.result;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
400
pages/mes/jobReport/onceReport.vue
Normal file
400
pages/mes/jobReport/onceReport.vue
Normal file
@@ -0,0 +1,400 @@
|
||||
<template>
|
||||
<view style="background-color: #fff;">
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="作业编码" :labelWidth='80' name="pwoJobCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" v-model="formData.pwoJobCode"
|
||||
@confirm="scanBarCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="工单" :labelWidth='80' name="pwoCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.pwoCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="产品编码" :labelWidth='80' name="ptNoTar">
|
||||
<uni-easyinput disabled type="text" v-model="formData.ptNoTar" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="产品名称" :labelWidth='80' name="ptTitleTar">
|
||||
<uni-easyinput disabled type="text" v-model="formData.ptTitleTar" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="设备编号" :labelWidth='80' name="machineId">
|
||||
<uni-easyinput disabled type="text" v-model="formData.machineId" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="批号" :labelWidth='80' name="batchNo">
|
||||
<uni-easyinput disabled type="text" v-model="formData.batchNo" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="制程编码" :labelWidth='80' name="opCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.opCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="制程名称" :labelWidth='80' name="opTitle">
|
||||
<uni-easyinput disabled type="text" v-model="formData.opTitle" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="用时(s)" :labelWidth='80' name="timeTake">
|
||||
<uni-easyinput type="number" v-model="formData.timeTake" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产员工编码" :labelWidth='80' name="createByCode">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarCreateBy"
|
||||
v-model="formData.createByCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产员工" :labelWidth='80' name="createByName">
|
||||
<uni-easyinput disabled type="text" v-model="formData.createByName" />
|
||||
</uni-forms-item>
|
||||
<u-divider :text="'可报工数量:'+reportableNum"></u-divider>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="合格数量" :labelWidth='70' name="pass">
|
||||
<u-number-box button-size="36" inputWidth="120"
|
||||
v-model="formData.mesJobReportOnceRequestDTO.pass.reportNumber" min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="不良数量" :labelWidth='70' name="defect">
|
||||
<u-number-box button-size="36" inputWidth="120"
|
||||
v-model="formData.mesJobReportOnceRequestDTO.defect.reportNumber" min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="不良原因" :labelWidth='70' name="defectReason">
|
||||
<uni-data-select v-model="formData.mesJobReportOnceRequestDTO['defect'].reason"
|
||||
:localdata="defectReasonOptions"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="报废数量" :labelWidth='70' name="scrap">
|
||||
<u-number-box button-size="36" inputWidth="120"
|
||||
v-model="formData.mesJobReportOnceRequestDTO.scrap.reportNumber" min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="报废原因" :labelWidth='70' name="scrapReason">
|
||||
<uni-data-select v-model="formData.mesJobReportOnceRequestDTO['scrap'].reason"
|
||||
:localdata="scrapReasonOptions"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="损耗数量" :labelWidth='70' name="loss">
|
||||
<u-number-box button-size="36" inputWidth="120"
|
||||
v-model="formData.mesJobReportOnceRequestDTO.loss.reportNumber" min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="损耗原因" :labelWidth='70' name="lossReason">
|
||||
<uni-data-select v-model="formData.mesJobReportOnceRequestDTO['loss'].reason"
|
||||
:localdata="lossReasonOptions"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="开工时间" :labelWidth='90'>
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="datetime" v-model="formData.startTime" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="完工时间" :labelWidth='90' name="endTime">
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="datetime" v-model="formData.endTime" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
<!-- <u-button type="primary" @click="end">关闭</u-button> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listPwoJob,
|
||||
addReport,
|
||||
getEquipment,
|
||||
addReportOnce
|
||||
} from "@/api/mes/jobReport.js";
|
||||
import {
|
||||
listEmpEqpHistory,
|
||||
listEmployee,
|
||||
listConversion
|
||||
} from "@/api/mes/jobIn.js";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
// const serialPort = uni.requireNativePlugin('Fvv-UniSerialPort')
|
||||
export default {
|
||||
onLoad: function(option) {
|
||||
if (option.code) {
|
||||
this.isSearchRoute = true;
|
||||
this.formData.pwoJobCode = option.code;
|
||||
this.scanBarCode();
|
||||
}
|
||||
// 获取当前时间
|
||||
var currentDate = new Date();
|
||||
// 格式化为字符串(YYYY-MM-DD HH:mm:ss)
|
||||
var year = currentDate.getFullYear();
|
||||
var month = ("0" + (currentDate.getMonth() + 1)).slice(-2);
|
||||
var day = ("0" + currentDate.getDate()).slice(-2);
|
||||
var hours = ("0" + currentDate.getHours()).slice(-2);
|
||||
var minutes = ("0" + currentDate.getMinutes()).slice(-2);
|
||||
var seconds = ("0" + currentDate.getSeconds()).slice(-2);
|
||||
var formattedDate = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
||||
// 将当前时间赋值给 formData.endTime
|
||||
this.formData.endTime = formattedDate;
|
||||
this.formData.way = '人工报工';
|
||||
this.getOptions();
|
||||
// this.formData.type = '报废品';
|
||||
// this.formData.createByName = this.$store.state.user.name;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//判断是否从工单状态页面查询过来
|
||||
isSearchRoute: false,
|
||||
lossReasonOptions: [],
|
||||
scrapReasonOptions: [],
|
||||
defectReasonOptions: [],
|
||||
formData: {
|
||||
pwoJobCode: null,
|
||||
pwoCode: null,
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
machineId: null,
|
||||
batchNo: null,
|
||||
createByName: null,
|
||||
createByCode: null,
|
||||
mesJobReportOnceRequestDTO: {
|
||||
pass: {
|
||||
reportNumber: 0,
|
||||
reason: null
|
||||
},
|
||||
defect: {
|
||||
reportNumber: 0,
|
||||
reason: null
|
||||
},
|
||||
scrap: {
|
||||
reportNumber: 0,
|
||||
reason: null
|
||||
},
|
||||
loss: {
|
||||
reportNumber: 0,
|
||||
reason: null
|
||||
}
|
||||
},
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
reportableNum: 0,
|
||||
rules: {
|
||||
pwoJobCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入作业编码!'
|
||||
}]
|
||||
},
|
||||
createByCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入生产员工编码!'
|
||||
}]
|
||||
},
|
||||
endTime: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入完工时间!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
created: function(option) {
|
||||
// const self = this
|
||||
// serialPort.getAllDeviceList(res => {
|
||||
// console.log('//设备列表', res)
|
||||
// })
|
||||
// serialPort.getAllDevicePath(res => {
|
||||
// console.log('//路径列表', res)
|
||||
// }),
|
||||
// setTimeout(() => {
|
||||
// serialPort.setPath('/dev/ttyUSB0')
|
||||
// serialPort.setBaudRate(9600)
|
||||
// serialPort.open(res => {
|
||||
// if (!res.status) {
|
||||
// uni.showToast({
|
||||
// title: res.msg,
|
||||
// duration: 2000,
|
||||
// icon: "none"
|
||||
// });
|
||||
// return
|
||||
// }
|
||||
// serialPort.onMessage(rec => {
|
||||
// this.onMessage(rec);
|
||||
// }, send => {
|
||||
// console.log(send)
|
||||
// })
|
||||
// })
|
||||
// }, 10000)
|
||||
},
|
||||
methods: {
|
||||
test() {
|
||||
serialPort.sendHex("A00102A3")
|
||||
},
|
||||
end() {
|
||||
serialPort.sendHex("A00100A1")
|
||||
},
|
||||
getOptions() {
|
||||
getDicts("mes_job_report_defect").then(res => {
|
||||
this.defectReasonOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
getDicts("mes_job_report_scrap").then(res => {
|
||||
this.scrapReasonOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
getDicts("mes_job_report_loss").then(res => {
|
||||
this.lossReasonOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
this.formData.mesJobReportOnceRequestDTO.pass.reportNumber = Number(this.formData
|
||||
.mesJobReportOnceRequestDTO.pass.reportNumber);
|
||||
this.formData.mesJobReportOnceRequestDTO.defect.reportNumber = Number(this.formData
|
||||
.mesJobReportOnceRequestDTO.defect.reportNumber);
|
||||
this.formData.mesJobReportOnceRequestDTO.scrap.reportNumber = Number(this.formData
|
||||
.mesJobReportOnceRequestDTO.scrap.reportNumber);
|
||||
console.log(this.formData);
|
||||
this.$modal.loading('提交中')
|
||||
addReportOnce(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("报工成功!");
|
||||
if (this.isSearchRoute = true) {
|
||||
setTimeout(() => {
|
||||
this.$tab.navigateBack();
|
||||
}, 500);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.pwoJobCode) {
|
||||
let obj = {
|
||||
code: this.formData.pwoJobCode
|
||||
}
|
||||
listPwoJob(obj).then(async res => {
|
||||
let jobs = res.rows;
|
||||
if (jobs.length == 0) {
|
||||
this.$modal.msg("未检索到该作业编码相关的信息!");
|
||||
} else {
|
||||
let job = jobs[0];
|
||||
console.log(job);
|
||||
this.formData.pwoCode = job.pwoCode;
|
||||
this.formData.ptNoTar = job.ptNoTar;
|
||||
this.formData.ptTitleTar = job.ptTitleTar;
|
||||
this.formData.opCode = job.opCode;
|
||||
this.formData.opTitle = job.opTitle;
|
||||
this.reportableNum = job.targetNum - job.finishQty;
|
||||
if (job.eqpId) {
|
||||
await getEquipment(job.eqpId).then(res => {
|
||||
console.log(res);
|
||||
this.formData.machineId = res.data.equipmentCode;
|
||||
})
|
||||
|
||||
//调取最后一条转入记录的操作人
|
||||
let code = {
|
||||
powJobCode: this.formData.pwoJobCode
|
||||
}
|
||||
listConversion(code).then(async res => {
|
||||
if (res.rows[0].operateBy && res.rows[0].operateBy != "") {
|
||||
this.formData.createByName = res.rows[0].operateBy;
|
||||
let arry = {
|
||||
name: this.formData.createByName
|
||||
}
|
||||
listEmployee(arry).then(async res => {
|
||||
this.formData.createByCode = res.rows[0]
|
||||
.empCode;
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
this.formData.batchNo = job.batchNo;
|
||||
console.log(this.formData);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
scanBarCreateBy() {
|
||||
if (this.formData.createByCode) {
|
||||
let obj = {
|
||||
empCode: this.formData.createByCode
|
||||
}
|
||||
listEmployee(obj).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
this.formData.createByName = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员信息!");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoJobCode = res.result;
|
||||
_this.scanBarCode(_this.formData.pwoJobCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.createByCode = res.result;
|
||||
_this.scanBarCreateBy();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
315
pages/mes/jobReport/pass.vue
Normal file
315
pages/mes/jobReport/pass.vue
Normal file
@@ -0,0 +1,315 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="作业编码" :labelWidth='80' name="pwoJobCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" v-model="formData.pwoJobCode"
|
||||
@confirm="scanBarCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="工单" :labelWidth='80' name="pwoCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.pwoCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="产品编码" :labelWidth='80' name="ptNoTar">
|
||||
<uni-easyinput disabled type="text" v-model="formData.ptNoTar" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="产品名称" :labelWidth='80' name="ptTitleTar">
|
||||
<uni-easyinput disabled type="text" v-model="formData.ptTitleTar" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="设备编号" :labelWidth='80' name="machineId">
|
||||
<uni-easyinput disabled type="text" v-model="formData.machineId" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="批号" :labelWidth='80' name="batchNo">
|
||||
<uni-easyinput disabled type="text" v-model="formData.batchNo" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="制程编码" :labelWidth='80' name="opCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.opCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="制程名称" :labelWidth='80' name="opTitle">
|
||||
<uni-easyinput disabled type="text" v-model="formData.opTitle" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="用时(s)" :labelWidth='80' name="timeTake">
|
||||
<uni-easyinput type="number" v-model="formData.timeTake" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="报工类型" :labelWidth='80' name="type">
|
||||
<uni-easyinput disabled type="text" v-model="formData.type" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="报工数量" :labelWidth='80' name="reportNumber">
|
||||
<uni-easyinput type="number" :placeholder="'可报工数量:'+reportableNum"
|
||||
v-model="formData.reportNumber" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产员工编码" :labelWidth='80' name="createByCode">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarCreateBy"
|
||||
v-model="formData.createByCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产员工" :labelWidth='80' name="createByName">
|
||||
<uni-easyinput disabled type="text" v-model="formData.createByName" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="是否录入件号" :labelWidth='120'>
|
||||
<uni-data-checkbox v-model="radio" :localdata="pieceIn"></uni-data-checkbox>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<view v-show="radio==1">
|
||||
<uni-forms-item label="件号" :labelWidth='80' name="pieceNo">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarPieceNo" type="text"
|
||||
v-model="formData.pieceNo" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="开工时间" :labelWidth='90'>
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="datetime" v-model="formData.startTime" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="完工时间" :labelWidth='90' name="endTime">
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="datetime" v-model="formData.endTime" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit" v-if="!isPwoRoute">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listPwoJob,
|
||||
addReport,
|
||||
getEquipment,
|
||||
addReportEnterPiece
|
||||
} from "@/api/mes/jobReport.js";
|
||||
import {
|
||||
listEmpEqpHistory,
|
||||
listEmployee,
|
||||
listConversion
|
||||
} from "@/api/mes/jobIn.js";
|
||||
export default {
|
||||
onLoad: function(option) {
|
||||
|
||||
// 获取当前时间
|
||||
var currentDate = new Date();
|
||||
// 格式化为字符串(YYYY-MM-DD HH:mm:ss)
|
||||
var year = currentDate.getFullYear();
|
||||
var month = ("0" + (currentDate.getMonth() + 1)).slice(-2);
|
||||
var day = ("0" + currentDate.getDate()).slice(-2);
|
||||
var hours = ("0" + currentDate.getHours()).slice(-2);
|
||||
var minutes = ("0" + currentDate.getMinutes()).slice(-2);
|
||||
var seconds = ("0" + currentDate.getSeconds()).slice(-2);
|
||||
var formattedDate = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
||||
// 将当前时间赋值给 formData.endTime
|
||||
this.formData.endTime = formattedDate;
|
||||
this.formData.way = '人工报工';
|
||||
this.formData.type = '合格品';
|
||||
if (option) {
|
||||
this.formData = JSON.parse(decodeURIComponent(option.formData));
|
||||
this.isPwoRoute = true;
|
||||
}
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isPwoRoute: false,
|
||||
formData: {
|
||||
pwoJobCode: null,
|
||||
pwoCode: null,
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
machineId: null,
|
||||
batchNo: null,
|
||||
createByName: null,
|
||||
createByCode: null,
|
||||
pieceNo: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
reportableNum: 0,
|
||||
radio: 0,
|
||||
pieceIn: [{
|
||||
text: '是',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
text: '否',
|
||||
value: 0
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
pwoJobCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入作业编码!'
|
||||
}]
|
||||
},
|
||||
createByCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入生产员工编码!'
|
||||
}]
|
||||
},
|
||||
reportNumber: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入报工数量!'
|
||||
}]
|
||||
},
|
||||
endTime: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入完工时间!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
//判断是否选择录入件号
|
||||
if (this.radio == 1) {
|
||||
//判断是否输入件号
|
||||
if (this.formData.pieceNo && this.formData.pieceNo != "") {
|
||||
this.$modal.loading('提交中')
|
||||
addReportEnterPiece(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("报工成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("请输入件号!");
|
||||
}
|
||||
} else {
|
||||
this.$modal.loading('提交中')
|
||||
addReport(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("报工成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.pwoJobCode) {
|
||||
let obj = {
|
||||
code: this.formData.pwoJobCode
|
||||
}
|
||||
listPwoJob(obj).then(async res => {
|
||||
let jobs = res.rows;
|
||||
if (jobs.length == 0) {
|
||||
this.$modal.msg("未检索到该作业编码相关的信息!");
|
||||
} else {
|
||||
let job = jobs[0];
|
||||
this.formData.pwoCode = job.pwoCode;
|
||||
this.formData.ptNoTar = job.ptNoTar;
|
||||
this.formData.ptTitleTar = job.ptTitleTar;
|
||||
this.formData.opCode = job.opCode;
|
||||
this.formData.opTitle = job.opTitle;
|
||||
this.reportableNum = job.targetNum - job.finishQty;
|
||||
if (job.eqpId) {
|
||||
await getEquipment(job.eqpId).then(res => {
|
||||
console.log(res);
|
||||
this.formData.machineId = res.data.equipmentCode;
|
||||
})
|
||||
//调取最后一条转入记录的操作人
|
||||
let code = {
|
||||
powJobCode: this.formData.pwoJobCode
|
||||
}
|
||||
listConversion(code).then(async res => {
|
||||
if (res.rows[0].operateBy && res.rows[0].operateBy != "") {
|
||||
this.formData.createByName = res.rows[0].operateBy;
|
||||
let arry = {
|
||||
name: this.formData.createByName
|
||||
}
|
||||
listEmployee(arry).then(async res => {
|
||||
this.formData.createByCode = res.rows[0]
|
||||
.empCode;
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
this.formData.batchNo = job.batchNo;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
scanBarCreateBy() {
|
||||
if (this.formData.createByCode) {
|
||||
let obj = {
|
||||
empCode: this.formData.createByCode
|
||||
}
|
||||
listEmployee(obj).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
this.formData.createByName = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员信息!");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoJobCode = res.result;
|
||||
_this.scanBarCode(_this.formData.pwoJobCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.createByCode = res.result;
|
||||
_this.scanBarCreateBy();
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarPieceNo() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pieceNo = res.result;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
232
pages/mes/jobReport/pipelineReport.vue
Normal file
232
pages/mes/jobReport/pipelineReport.vue
Normal file
@@ -0,0 +1,232 @@
|
||||
<template>
|
||||
<view style="background-color: #fff;">
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="开始作业编码" :labelWidth='80' name="startPwoJobCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text"
|
||||
v-model="formData.startPwoJobCode" @confirm="scanBarStartCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="结束作业编码" :labelWidth='80' name="endPwoJobCode">
|
||||
<uni-combox-re labelKey="code" valueKey="id" :candidates="endPwoJobOptions" emptyTips="无"
|
||||
@input="scanBarEndCode" v-model="formData.endPwoJobCode"></uni-combox-re>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="合格数量" :labelWidth='80' name="passNum">
|
||||
<u-number-box button-size="36" v-model="formData.passNum" min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="缺陷数量" :labelWidth='80' name="defectNum">
|
||||
<u-number-box button-size="36" v-model="formData.defectNum" min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="报废数量" :labelWidth='80' name="scrapNum">
|
||||
<u-number-box button-size="36" v-model="formData.scrapNum" min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产员工编码" :labelWidth='80' name="createByCode">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarCreateBy"
|
||||
v-model="formData.createByCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产员工" :labelWidth='80' name="createByName">
|
||||
<uni-easyinput disabled type="text" v-model="formData.createByName" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<uni-card :is-shadow="false" is-full v-for="item in jobList" :key="item.id">
|
||||
<div><strong>工单</strong>:{{item.pwoCode}}</div>
|
||||
<div><strong>作业编码</strong>:{{item.code}}</div>
|
||||
<div><strong>目标产品编码</strong>:{{item.ptNoTar}}</div>
|
||||
<div><strong>目标产品名称</strong>:{{item.ptTitleTar}}</div>
|
||||
<div><strong>制程名称</strong>:{{item.opTitle}}</div>
|
||||
<div><strong>目标数量</strong>:{{item.planNum}}</div>
|
||||
<div><strong>完成数量</strong>:{{item.finishQty}}</div>
|
||||
<div><strong>开工状态</strong>:
|
||||
<uni-tag :text="jobtag(item.status)" type="success"></uni-tag>
|
||||
</div>
|
||||
</uni-card>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listPwoJob,
|
||||
addReport,
|
||||
getEquipment,
|
||||
addPipelineReport
|
||||
} from "@/api/mes/jobReport.js";
|
||||
import {
|
||||
listEmpEqpHistory,
|
||||
listEmployee,
|
||||
listConversion
|
||||
} from "@/api/mes/jobIn.js";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import uniComboxRe from "../../../uni_modules/uni-combox/components/uni-combox/uni-combox-re.vue"
|
||||
export default {
|
||||
components: {
|
||||
uniComboxRe
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
startPwoJobCode: null,
|
||||
endPwoJobCode: null,
|
||||
startPwoJobId: null,
|
||||
endPwoJobId: null,
|
||||
passNum: 0,
|
||||
defectNum: 0,
|
||||
scrapNum: 0,
|
||||
createByName: null,
|
||||
createByCode: null
|
||||
},
|
||||
endPwoJobOptions: [],
|
||||
pwojobList: [],
|
||||
jobList: [],
|
||||
rules: {
|
||||
startPwoJobCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入开始作业编码!'
|
||||
}]
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
listPwoJob().then((response) => {
|
||||
this.pwojobList = response.rows;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
scanBarCreateBy() {
|
||||
if (this.formData.createByCode) {
|
||||
let obj = {
|
||||
empCode: this.formData.createByCode
|
||||
}
|
||||
listEmployee(obj).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
this.formData.createByName = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员信息!");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.createByCode = res.result;
|
||||
_this.scanBarCreateBy();
|
||||
}
|
||||
});
|
||||
},
|
||||
jobtag(status) {
|
||||
switch (Number(status)) {
|
||||
case 1:
|
||||
return '计划中';
|
||||
break;
|
||||
case 2:
|
||||
return '材料转入';
|
||||
break;
|
||||
case 3:
|
||||
return '作业开工';
|
||||
break;
|
||||
case 4:
|
||||
return '作业暂停';
|
||||
break;
|
||||
case 5:
|
||||
return '作业完工';
|
||||
break;
|
||||
case 6:
|
||||
return '完成品转出';
|
||||
break;
|
||||
case 7:
|
||||
return '取消';
|
||||
break;
|
||||
default:
|
||||
return '无';
|
||||
break;
|
||||
}
|
||||
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
if (this.jobList.length == 0) {
|
||||
this.$modal.mesError("没有选择作业!");
|
||||
} else {
|
||||
this.$modal.loading('提交中')
|
||||
addPipelineReport(this.formData).then((resp) => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("报工成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
scanBarStartCode() {
|
||||
this.endPwoJobOptions = [];
|
||||
this.jobList = [];
|
||||
|
||||
listPwoJob({
|
||||
code: this.formData.startPwoJobCode
|
||||
}).then((response) => {
|
||||
if (response.total > 0) {
|
||||
//开始作业的工单id
|
||||
var pwoId = response.rows[0].pwoId;
|
||||
//开始作业id
|
||||
let id = this.formData.startPwoJobId = response.rows[0].id;
|
||||
for (let item of this.pwojobList) {
|
||||
if (pwoId == item.pwoId && id > item.id) {
|
||||
this.endPwoJobOptions.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
//选择结束作业后表单自动填充作业信息
|
||||
scanBarEndCode(e) {
|
||||
var startJobId = this.formData.startPwoJobId;
|
||||
this.formData.endPwoJobId = e;
|
||||
this.jobList = [];
|
||||
if (startJobId == null || e == null || e == "") {
|
||||
this.jobList = [];
|
||||
return;
|
||||
}
|
||||
for (let item of this.pwojobList) {
|
||||
if (item.id <= startJobId && item.id >= e) {
|
||||
this.jobList.push(item);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.startPwoJobCode = res.result;
|
||||
_this.scanBarStartCode(_this.formData.startPwoJobCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
240
pages/mes/jobReport/pwoReport.vue
Normal file
240
pages/mes/jobReport/pwoReport.vue
Normal file
@@ -0,0 +1,240 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="工单" :labelWidth='80' name="pwoCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.pwoCode"
|
||||
@confirm="scanBarCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="开始作业" :labelWidth='80' name="startPwoJobCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.startPwoJobCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="结束作业" :labelWidth='80' name="endPwoJobCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.endPwoJobCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="操作员" :labelWidth='80' name="operator">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarOperator" type="text"
|
||||
v-model="formData.operator" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-collapse-item title="工单报工列表" :open="true">
|
||||
<!-- <u-button type="primary" @click="addDetail">新增</u-button>
|
||||
<u-button type="primary" @click="submit">确认</u-button> -->
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :key="index" v-for="(item, index) in jobList"
|
||||
@click="(data) => clickDetail(index,data)" @change="swipChange">
|
||||
<uni-badge :text="index+1" type="primary"></uni-badge>
|
||||
<uni-forms-item label="作业编码" :labelWidth='90' :name="'jobList.'+ index +'.code'">
|
||||
<uni-easyinput type="text" v-model="item.code"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="目标产品编码" :labelWidth='90' :name="'jobList.'+ index +'.ptNoTar'">
|
||||
<uni-easyinput type="text" v-model="item.ptNoTar"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="目标产品名称" :labelWidth='90'
|
||||
:name="'jobList.'+ index +'.ptTitleTar'">
|
||||
<uni-easyinput type="text" v-model="item.ptTitleTar"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="制程名称" :labelWidth='90' :name="'jobList.'+ index +'.opTitle'">
|
||||
<uni-easyinput type="text" v-model="item.opTitle"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="目标数量" :labelWidth='90' :name="'jobList.'+ index +'.planNum'">
|
||||
<uni-easyinput type="text" v-model="item.planNum"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="完成数量" :labelWidth='90' :name="'jobList.'+ index +'.finishQty'">
|
||||
<uni-easyinput type="text" v-model="item.finishQty"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="合格数量" :labelWidth='80' name="passNum">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="formData.passNum"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="不良数量" :labelWidth='80' name="defectNum">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="formData.defectNum"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="报废数量" :labelWidth='80' name="scrapNum">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="formData.scrapNum"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<!-- <uni-table ref="table" border stripe emptyText="暂无更多数据">
|
||||
<uni-tr>
|
||||
<uni-th width="100" align="center">作业编码</uni-th>
|
||||
<uni-th width="150" align="center">产品编码</uni-th>
|
||||
<uni-th width="50" align="center">数量</uni-th>
|
||||
</uni-tr>
|
||||
<uni-tr v-for="(item, index) in jobList" :key="index">
|
||||
<uni-td align="center">{{ item.code }}</uni-td>
|
||||
<uni-td align="center">{{ item.ptNoTar }}</uni-td>
|
||||
<uni-td align="center">{{ item.planNum }}</uni-td>
|
||||
</uni-tr>
|
||||
</uni-table> -->
|
||||
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listPwoJob,
|
||||
addReport,
|
||||
getEquipment,
|
||||
addReportOnce,
|
||||
pwoReport
|
||||
} from "@/api/mes/jobReport.js";
|
||||
import {
|
||||
listEmpEqpHistory,
|
||||
listEmployee,
|
||||
listConversion
|
||||
} from "@/api/mes/jobIn.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
pwoJobCode: null,
|
||||
pwoCode: null,
|
||||
startPwoJobId: null,
|
||||
startPwoJobCode: null,
|
||||
endPwoJobId: null,
|
||||
endPwoJobCode: null,
|
||||
operator: null,
|
||||
passNum: 0,
|
||||
defectNum: 0,
|
||||
scrapNum: 0,
|
||||
},
|
||||
jobList: [],
|
||||
rules: {
|
||||
pwoCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入工单!'
|
||||
}]
|
||||
},
|
||||
operator: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入操作员工编码!'
|
||||
}]
|
||||
},
|
||||
passNum: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入合格数量!'
|
||||
}]
|
||||
},
|
||||
defectNum: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入不良数量!'
|
||||
}]
|
||||
},
|
||||
scrapNum: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入报废数量!'
|
||||
}]
|
||||
}
|
||||
// machineId: {
|
||||
// rules: [
|
||||
// { required: true, errorMessage:'请输入设备编码!' }
|
||||
// ]
|
||||
// },
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
if (this.jobList.length == 0) {
|
||||
this.$modal.mesError("没有作业可报工!");
|
||||
} else {
|
||||
//员工
|
||||
let emp = {
|
||||
empCode: this.formData.operator
|
||||
}
|
||||
listEmployee(emp).then(res => {
|
||||
if (res.rows.length != 0) {
|
||||
this.formData.operator = res.rows[0].id;
|
||||
}
|
||||
this.$modal.loading('提交中')
|
||||
pwoReport(this.formData).then(resp => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("报工成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.pwoCode) {
|
||||
var queryParams = {
|
||||
pwoCode: this.formData.pwoCode,
|
||||
};
|
||||
listPwoJob(queryParams).then(response => {
|
||||
// this.pwoJobOptionsDraft = response.rows;
|
||||
console.log(response);
|
||||
let total = response.total;
|
||||
if (total != 0) {
|
||||
this.jobList = response.rows;
|
||||
//编码用于前端显示
|
||||
this.formData.startPwoJobCode = this.jobList[0].code;
|
||||
this.formData.endPwoJobCode = this.jobList[total - 1].code;
|
||||
//id用于提交时传回给后端
|
||||
this.formData.startPwoJobId = this.jobList[0].id;
|
||||
this.formData.endPwoJobId = this.jobList[total - 1].id;
|
||||
console.log(this.formData);
|
||||
} else {
|
||||
this.jobList = response.rows;
|
||||
//编码用于前端显示
|
||||
this.formData.startPwoJobCode = "";
|
||||
this.formData.endPwoJobCode = "";
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoCode = res.result;
|
||||
_this.scanBarCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarOperator() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.operator = res.result;
|
||||
_
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
347
pages/mes/jobReport/scrap.vue
Normal file
347
pages/mes/jobReport/scrap.vue
Normal file
@@ -0,0 +1,347 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="作业编码" :labelWidth='80' name="pwoJobCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" v-model="formData.pwoJobCode"
|
||||
@confirm="scanBarCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="工单" :labelWidth='80' name="pwoCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.pwoCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="产品编码" :labelWidth='80' name="ptNoTar">
|
||||
<uni-easyinput disabled type="text" v-model="formData.ptNoTar" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="产品名称" :labelWidth='80' name="ptTitleTar">
|
||||
<uni-easyinput disabled type="text" v-model="formData.ptTitleTar" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="设备编号" :labelWidth='80' name="machineId">
|
||||
<uni-easyinput disabled type="text" v-model="formData.machineId" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="批号" :labelWidth='80' name="batchNo">
|
||||
<uni-easyinput disabled type="text" v-model="formData.batchNo" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="制程编码" :labelWidth='80' name="opCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.opCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="制程名称" :labelWidth='80' name="opTitle">
|
||||
<uni-easyinput disabled disabled type="text" v-model="formData.opTitle" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="用时(s)" :labelWidth='80' name="timeTake">
|
||||
<uni-easyinput type="number" v-model="formData.timeTake" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="报工类型" :labelWidth='80' name="type">
|
||||
<uni-easyinput disabled disabled type="text" v-model="formData.type" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="报工数量" :labelWidth='80' name="reportNumber">
|
||||
<uni-easyinput type="number" :placeholder="'可报工数量:'+reportableNum"
|
||||
v-model="formData.reportNumber" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="报废原因" :labelWidth='80' name="reason">
|
||||
<uni-data-select v-model="formData.reason" :localdata="reasonOptions"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产员工编码" :labelWidth='80' name="createByCode">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarCreateBy"
|
||||
v-model="formData.createByCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="生产员工" :labelWidth='80' name="createByName">
|
||||
<uni-easyinput disabled type="text" v-model="formData.createByName" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="是否录入件号" :labelWidth='120'>
|
||||
<uni-data-checkbox v-model="radio" :localdata="pieceIn"></uni-data-checkbox>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<view v-show="radio==1">
|
||||
<uni-forms-item label="件号" :labelWidth='80' name="pieceNo">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarPieceNo" type="text"
|
||||
v-model="formData.pieceNo" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="开工时间" :labelWidth='90'>
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="datetime" v-model="formData.startTime" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="完工时间" :labelWidth='90' name="endTime">
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="datetime" v-model="formData.endTime" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit" v-if="!isPwoRoute">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listPwoJob,
|
||||
addReport,
|
||||
getEquipment,
|
||||
addReportEnterPiece
|
||||
} from "@/api/mes/jobReport.js";
|
||||
import {
|
||||
listEmpEqpHistory,
|
||||
listEmployee,
|
||||
listConversion
|
||||
} from "@/api/mes/jobIn.js";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
|
||||
export default {
|
||||
onLoad: function(option) {
|
||||
// 获取当前时间
|
||||
var currentDate = new Date();
|
||||
// 格式化为字符串(YYYY-MM-DD HH:mm:ss)
|
||||
var year = currentDate.getFullYear();
|
||||
var month = ("0" + (currentDate.getMonth() + 1)).slice(-2);
|
||||
var day = ("0" + currentDate.getDate()).slice(-2);
|
||||
var hours = ("0" + currentDate.getHours()).slice(-2);
|
||||
var minutes = ("0" + currentDate.getMinutes()).slice(-2);
|
||||
var seconds = ("0" + currentDate.getSeconds()).slice(-2);
|
||||
var formattedDate = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
||||
// 将当前时间赋值给 formData.endTime
|
||||
this.formData.endTime = formattedDate;
|
||||
this.formData.way = '人工报工';
|
||||
this.formData.type = '报废品';
|
||||
if (option) {
|
||||
this.formData = JSON.parse(decodeURIComponent(option.formData));
|
||||
this.isPwoRoute = true;
|
||||
}
|
||||
getDicts("mes_job_report_scrap").then(res => {
|
||||
this.reasonOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
// this.formData.createByName = this.$store.state.user.name;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isPwoRoute: false,
|
||||
reasonOptions: [],
|
||||
formData: {
|
||||
pwoJobCode: null,
|
||||
pwoCode: null,
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
machineId: null,
|
||||
batchNo: null,
|
||||
createByName: null,
|
||||
createByCode: null,
|
||||
pieceNo: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
reportableNum: 0,
|
||||
radio: 0,
|
||||
pieceIn: [{
|
||||
text: '是',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
text: '否',
|
||||
value: 0
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
pwoJobCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入作业编码!'
|
||||
}]
|
||||
},
|
||||
createByCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入生产员工编码!'
|
||||
}]
|
||||
},
|
||||
reportNumber: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入报工数量!'
|
||||
}]
|
||||
},
|
||||
reason: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入不良原因!'
|
||||
}]
|
||||
},
|
||||
endTime: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入完工时间!'
|
||||
}]
|
||||
},
|
||||
// machineId: {
|
||||
// rules: [
|
||||
// { required: true, errorMessage:'请输入设备编码!' }
|
||||
// ]
|
||||
// },
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
//判断是否选择录入件号
|
||||
if (this.radio == 1) {
|
||||
//判断是否输入件号
|
||||
if (this.formData.pieceNo && this.formData.pieceNo != "") {
|
||||
this.$modal.loading('提交中')
|
||||
addReportEnterPiece(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("报工成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("请输入件号!");
|
||||
}
|
||||
} else {
|
||||
this.$modal.loading('提交中')
|
||||
addReport(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("报工成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.pwoJobCode) {
|
||||
let obj = {
|
||||
code: this.formData.pwoJobCode
|
||||
}
|
||||
listPwoJob(obj).then(async res => {
|
||||
let jobs = res.rows;
|
||||
if (jobs.length == 0) {
|
||||
this.$modal.msg("未检索到该作业编码相关的信息!");
|
||||
} else {
|
||||
let job = jobs[0];
|
||||
console.log(job);
|
||||
this.formData.pwoCode = job.pwoCode;
|
||||
this.formData.ptNoTar = job.ptNoTar;
|
||||
this.formData.ptTitleTar = job.ptTitleTar;
|
||||
this.formData.opCode = job.opCode;
|
||||
this.formData.opTitle = job.opTitle;
|
||||
this.reportableNum = job.targetNum - job.finishQty;
|
||||
if (job.eqpId) {
|
||||
await getEquipment(job.eqpId).then(res => {
|
||||
console.log(res);
|
||||
this.formData.machineId = res.data.equipmentCode;
|
||||
})
|
||||
|
||||
//调取最后一条转入记录的操作人
|
||||
let code = {
|
||||
powJobCode: this.formData.pwoJobCode
|
||||
}
|
||||
listConversion(code).then(async res => {
|
||||
if (res.rows[0].operateBy && res.rows[0].operateBy != "") {
|
||||
this.formData.createByName = res.rows[0].operateBy;
|
||||
let arry = {
|
||||
name: this.formData.createByName
|
||||
}
|
||||
listEmployee(arry).then(async res => {
|
||||
this.formData.createByCode = res.rows[0]
|
||||
.empCode;
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
this.formData.batchNo = job.batchNo;
|
||||
console.log(this.formData);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
scanBarCreateBy() {
|
||||
if (this.formData.createByCode) {
|
||||
let obj = {
|
||||
empCode: this.formData.createByCode
|
||||
}
|
||||
listEmployee(obj).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
this.formData.createByName = res.rows[0].name;
|
||||
} else {
|
||||
this.$modal.msg("未查询到该人员信息!");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoJobCode = res.result;
|
||||
_this.scanBarCode(_this.formData.pwoJobCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.createByCode = res.result;
|
||||
_this.scanBarCreateBy();
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBarPieceNo() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pieceNo = res.result;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
182
pages/mes/mesJobSingleReportSign/inEnsure.vue
Normal file
182
pages/mes/mesJobSingleReportSign/inEnsure.vue
Normal file
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-forms-item label="合并标签码" :labelWidth='90' name="singleReportSign">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="query"
|
||||
v-model="formData.singleReportSign" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="query">查询</u-button>
|
||||
<uni-collapse-item :open="true">
|
||||
<uni-card :is-shadow="false" is-full v-for="item,index in reportList" :key="item.id">
|
||||
<div><strong>合并标签号</strong>:{{item.singleReportSign}}</div>
|
||||
<div><strong>物料编码</strong>:{{item.ptNoTar}}</div>
|
||||
<div><strong>物料名称</strong>:{{item.ptTitleTar}}</div>
|
||||
<div><strong>物料规格</strong>:{{item.specification1}}</div>
|
||||
<div><strong>数量</strong>:{{item.reportNumber}}</div>
|
||||
<div><strong>仓库</strong>:{{item.whName?item.whName:item.whCode}}</div>
|
||||
<div><strong>状态</strong>:检验未入库</div>
|
||||
</uni-card>
|
||||
<!-- <u-checkbox-group v-model="checked" @change="getCheckedList" :borderBottom="true" placement="column"
|
||||
iconPlacement="right">
|
||||
<u-checkbox size="25" iconSize="25" activeColor="green" v-for="(item, index) in reportList"
|
||||
:key="index" :disabled="item.disabled" :name="item.id" :label="'\n'+' 序号 : '+(index+1)+'\n\n'+
|
||||
'合并标签号 : '+(item.singleReportSign? item.singleReportSign:'')+'\n\n'+
|
||||
'物料编码 : '+(item.ptNoTar?item.ptNoTar:'')+'\n\n'+
|
||||
'物料名称 : '+(item.ptTitleTar?item.ptTitleTar:'')+'\n\n'+
|
||||
'物料规格 : '+(item.specification1?item.specification1:'')+'\n\n'+
|
||||
'数量 : '+(item.reportNumber?item.reportNumber:'')+'\n\n'+
|
||||
'仓库 : '+(item.whCode?item.whCode:'')+'\n\n'+
|
||||
'状态 : '+returnStatus(item.status)+'\n\n'
|
||||
">
|
||||
</u-checkbox>
|
||||
</u-checkbox-group> -->
|
||||
</uni-collapse-item>
|
||||
<u-button type="primary" @click="submit" v-if="reportList.length>0">提交</u-button>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesJobSingleReportSign,
|
||||
advListMesJobSingleReportSign,
|
||||
getMesJobSingleReportSign,
|
||||
delMesJobSingleReportSign,
|
||||
addMesJobSingleReportSign,
|
||||
updateMesJobSingleReportSign,
|
||||
reportConfirm,
|
||||
qualityConfirm,
|
||||
whInConfirm
|
||||
} from "@/api/mes/mesJobSingleReportSign";
|
||||
import {
|
||||
listWarehouse
|
||||
} from "@/api/wms/pdcIn.js";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
export default {
|
||||
mounted() {
|
||||
getDicts("mes_job_single_report_sign_status").then(res => {
|
||||
this.mes_job_single_report_sign_status = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
listWarehouse().then(res => {
|
||||
this.whList = res.rows
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
whList: [],
|
||||
mes_job_single_report_sign_status: [],
|
||||
selectAllChecked: false,
|
||||
checked: [],
|
||||
reportList: [],
|
||||
formData: {
|
||||
singleReportSign: null
|
||||
},
|
||||
ids: [],
|
||||
rules: {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
returnStatus(i) {
|
||||
console.log(i)
|
||||
let obj = this.mes_job_single_report_sign_status.find(dict => dict.value == i)
|
||||
console.log(obj)
|
||||
if (obj)
|
||||
return obj.text
|
||||
else
|
||||
return ''
|
||||
},
|
||||
getCheckedList(e) {
|
||||
this.ids = e;
|
||||
// 判断当前选中的复选框数量,决定全选框的状态
|
||||
if (this.ids.length === this.reportList.length) {
|
||||
this.selectAllChecked = true;
|
||||
} else {
|
||||
this.selectAllChecked = false;
|
||||
}
|
||||
},
|
||||
//物料编码
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.singleReportSign = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
query() {
|
||||
listMesJobSingleReportSign(this.formData).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
if (res.rows[0].status != 2) {
|
||||
let text = this.returnStatus(res.rows[0].status)
|
||||
this.$modal.msg("查询的记录当前处于'" + text + "'状态!");
|
||||
} else {
|
||||
if (!res.rows[0].whCode) {
|
||||
this.reportList = res.rows
|
||||
} else {
|
||||
let obj = this.whList.find(item => item.warehouseCode == res.rows[0].whCode)
|
||||
if (obj) {
|
||||
console.log(obj)
|
||||
res.rows[0].whName = obj.warehouseName
|
||||
}
|
||||
this.reportList = res.rows
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
this.$modal.msg("未查询到相关记录!");
|
||||
}
|
||||
})
|
||||
},
|
||||
selectAll() {
|
||||
// 点击全选按钮时,更新所有复选框的选中状态
|
||||
if (this.checked.length === this.reportList.length) {
|
||||
this.checked = [];
|
||||
this.selectAllChecked = false; // 全选框不选中
|
||||
} else {
|
||||
this.checked = this.reportList.map(item => item.id);
|
||||
this.selectAllChecked = true; // 全选框选中
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该入库确认吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
_this.$modal.loading('提交中')
|
||||
whInConfirm([_this.reportList[0].id]).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("上传入库确认成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab(
|
||||
"/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
111
pages/mes/mesJobSingleReportSign/inFailRecord.vue
Normal file
111
pages/mes/mesJobSingleReportSign/inFailRecord.vue
Normal file
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<view style="background-color: #fff" v-if="reportList.length>0">
|
||||
<u-checkbox size="25" iconSize="25" activeColor="green" labelSize='40rpx' :label="'全选'" @change="selectAll"
|
||||
v-if="reportList.length>0" :checked="selectAllChecked">
|
||||
</u-checkbox>
|
||||
<u-checkbox-group v-model="checked" @change="getCheckedList" :borderBottom="true" placement="column"
|
||||
iconPlacement="right" style="height: 80vh;overflow: scroll;overflow-wrap:anywhere">
|
||||
<div v-for="(item, index) in reportList" :key="index">
|
||||
<u-checkbox size="25" iconSize="25" activeColor="green" :disabled="item.disabled" :name="item.id"
|
||||
:label="'\n'+' 序号 : '+(index+1)+'\n\n'+
|
||||
'物料编码 : '+(item.ptNoTar?item.ptNoTar:'')+'\n\n'+
|
||||
'物料名称 : '+(item.ptTitleTar?item.ptTitleTar:'')+'\n\n'+
|
||||
'物料规格 : '+(item.specification1?item.specification1:'')+'\n\n'+
|
||||
'数量 : '+(item.reportNumber?item.reportNumber:'')+'\n\n'+
|
||||
'仓库 : '+(item.whCode?item.whCode:'')+'\n\n'+
|
||||
'合并标签号 : '+(item.singleReportSign? item.singleReportSign:'')+'\n\n'+
|
||||
'失败原因 : '+(item.remark? item.remark:'')+'\n\n'
|
||||
">
|
||||
|
||||
</u-checkbox>
|
||||
<u-button type="success" @click="updateStatus(item)">强制入库</u-button>
|
||||
</div>
|
||||
|
||||
</u-checkbox-group>
|
||||
<u-button type="primary" @click="submit" v-if="reportList.length>0">提交</u-button>
|
||||
</view>
|
||||
<view v-else style="text-align: center;">
|
||||
查询无记录
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesJobSingleReportSign,
|
||||
advListMesJobSingleReportSign,
|
||||
getMesJobSingleReportSign,
|
||||
delMesJobSingleReportSign,
|
||||
addMesJobSingleReportSign,
|
||||
updateMesJobSingleReportSign,
|
||||
reportConfirm,
|
||||
qualityConfirm,
|
||||
whInConfirm
|
||||
} from "@/api/mes/mesJobSingleReportSign";
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
this.query()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectAllChecked: false,
|
||||
checked: [],
|
||||
ids: [],
|
||||
reportList: [],
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//强制入库
|
||||
updateStatus(item) {
|
||||
item.status = 3
|
||||
updateMesJobSingleReportSign(item).then(res => {
|
||||
this.$modal.msgSuccess("强制入库成功!");
|
||||
this.query()
|
||||
})
|
||||
},
|
||||
getCheckedList(e) {
|
||||
this.ids = e;
|
||||
// 判断当前选中的复选框数量,决定全选框的状态
|
||||
if (this.ids.length === this.reportList.length) {
|
||||
this.selectAllChecked = true;
|
||||
} else {
|
||||
this.selectAllChecked = false;
|
||||
}
|
||||
},
|
||||
selectAll() {
|
||||
// 点击全选按钮时,更新所有复选框的选中状态
|
||||
if (this.checked.length === this.reportList.length) {
|
||||
this.checked = [];
|
||||
this.selectAllChecked = false; // 全选框不选中
|
||||
} else {
|
||||
this.checked = this.reportList.map(item => item.id);
|
||||
this.selectAllChecked = true; // 全选框选中
|
||||
}
|
||||
},
|
||||
query() {
|
||||
listMesJobSingleReportSign({
|
||||
errStatus: 1,
|
||||
status: 2
|
||||
}).then(res => {
|
||||
this.reportList = res.rows
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
// let ids = this.reportList.map(item => item.id)
|
||||
whInConfirm(this.ids)
|
||||
this.$tab.switchTab(
|
||||
"/pages/work/index");
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
136
pages/mes/mesJobSingleReportSign/inQuery.vue
Normal file
136
pages/mes/mesJobSingleReportSign/inQuery.vue
Normal file
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-forms-item label="日期范围" :labelWidth='90' name="updateTime">
|
||||
<uni-datetime-picker v-model="formData.updateTime" type="daterange" rangeSeparator="至" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料编码" :labelWidth='90' name="ptNoTar">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.ptNoTar" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='90' name="ptTitleTar">
|
||||
<uni-easyinput v-model="formData.ptTitleTar" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料规格" :labelWidth='90' name="specification1">
|
||||
<uni-easyinput v-model="formData.specification1" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="仓库" :labelWidth='90' name="formData.whCode">
|
||||
<zxz-uni-data-select v-model="formData.whCode" :localdata="whOptions"
|
||||
:filterable="true"></zxz-uni-data-select>
|
||||
<!-- <uni-data-select v-model="formData.whCode" :localdata="whOptions"></uni-data-select> -->
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="query">查询</u-button>
|
||||
<uni-collapse-item :open="true">
|
||||
<uni-card :is-shadow="false" is-full v-for="item,index in reportList" :key="item.id">
|
||||
<div><strong>合并标签号</strong>:{{item.singleReportSign}}</div>
|
||||
<div><strong>物料编码</strong>:{{item.ptNoTar}}</div>
|
||||
<div><strong>物料名称</strong>:{{item.ptTitleTar}}</div>
|
||||
<div><strong>物料规格</strong>:{{item.specification1}}</div>
|
||||
<div><strong>数量</strong>:{{item.reportNumber}}</div>
|
||||
<div><strong>仓库</strong>:{{item.whName?item.whName:item.whCode}}</div>
|
||||
<div><strong>状态</strong>:入库完成</div>
|
||||
</uni-card>
|
||||
</uni-collapse-item>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesJobSingleReportSign,
|
||||
advListMesJobSingleReportSign,
|
||||
getMesJobSingleReportSign,
|
||||
delMesJobSingleReportSign,
|
||||
addMesJobSingleReportSign,
|
||||
updateMesJobSingleReportSign,
|
||||
reportConfirm,
|
||||
qualityConfirm,
|
||||
whInConfirm
|
||||
} from "@/api/mes/mesJobSingleReportSign";
|
||||
import {
|
||||
listWarehouse
|
||||
} from "@/api/wms/pdcIn.js";
|
||||
export default {
|
||||
mounted() {
|
||||
listWarehouse().then(res => {
|
||||
this.whList = res.rows;
|
||||
this.whOptions = res.rows.map(item => {
|
||||
return {
|
||||
text: item.warehouseCode + ':' + item.warehouseName,
|
||||
value: item.warehouseCode,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
whOptions: [],
|
||||
whList: [],
|
||||
datetimerange: [],
|
||||
reportList: [],
|
||||
formData: {
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
updateTime: [],
|
||||
specification1: null,
|
||||
whCode: null
|
||||
},
|
||||
rules: {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//物料编码
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.ptNoTar = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
query() {
|
||||
let obj = {
|
||||
['A.ptNoTar-0']: this.formData.ptNoTar,
|
||||
['A.ptNoTar-op']: 'ct',
|
||||
['A.ptTitleTar-0']: this.formData.ptTitleTar,
|
||||
['A.ptTitleTar-op']: 'ct',
|
||||
['A.specification1-0']: this.formData.specification1,
|
||||
['A.specification1-op']: 'ct',
|
||||
['A.updateTime-0']: this.formData.updateTime.length > 0 ? (this.formData.updateTime[0] +
|
||||
' 00:00:00') : null,
|
||||
['A.updateTime-1']: this.formData.updateTime.length > 0 ? (this.formData.updateTime[1] +
|
||||
' 00:00:00') : null,
|
||||
['A.updateTime-op']: 'bt',
|
||||
['A.whCode-0']: this.formData.whCode,
|
||||
['A.whCode-op']: 'eq',
|
||||
['A.status-op']: 'eq',
|
||||
['A.status-0']: 3,
|
||||
gexpr: 'A',
|
||||
pageNum: 0,
|
||||
pageSize: 100
|
||||
}
|
||||
console.log(obj)
|
||||
advListMesJobSingleReportSign(obj).then(res => {
|
||||
this.reportList = res.rows.map(item => {
|
||||
let obj = this.whList.find(i => i.warehouseCode == item.whCode)
|
||||
if (obj) {
|
||||
console.log(obj)
|
||||
item.whName = obj.warehouseName
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
145
pages/mes/mesJobSingleReportSign/notInQuery.vue
Normal file
145
pages/mes/mesJobSingleReportSign/notInQuery.vue
Normal file
@@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-forms-item label="物料编码" :labelWidth='90' name="ptNoTar">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.ptNoTar" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='90' name="ptTitleTar">
|
||||
<uni-easyinput v-model="formData.ptTitleTar" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料规格" :labelWidth='90' name="specification1">
|
||||
<uni-easyinput v-model="formData.specification1" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="状态" :labelWidth='90' name="status">
|
||||
<uni-data-select v-model="formData.status" :localdata="range"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="query">查询</u-button>
|
||||
<uni-collapse-item :open="true">
|
||||
<uni-card :is-shadow="false" is-full v-for="item,index in reportList" :key="item.id">
|
||||
<div><strong>合并标签号</strong>:{{item.singleReportSign}}</div>
|
||||
<div><strong>物料编码</strong>:{{item.ptNoTar}}</div>
|
||||
<div><strong>物料名称</strong>:{{item.ptTitleTar}}</div>
|
||||
<div><strong>物料规格</strong>:{{item.specification1}}</div>
|
||||
<div><strong>数量</strong>:{{item.reportNumber}}</div>
|
||||
<div><strong>仓库</strong>:{{item.whName?item.whName:item.whCode}}</div>
|
||||
<div><strong>状态</strong>:{{returnStatus(item.status)}}</div>
|
||||
</uni-card>
|
||||
</uni-collapse-item>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesJobSingleReportSign,
|
||||
advListMesJobSingleReportSign,
|
||||
getMesJobSingleReportSign,
|
||||
delMesJobSingleReportSign,
|
||||
addMesJobSingleReportSign,
|
||||
updateMesJobSingleReportSign,
|
||||
reportConfirm,
|
||||
qualityConfirm,
|
||||
whInConfirm
|
||||
} from "@/api/mes/mesJobSingleReportSign";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import {
|
||||
listWarehouse
|
||||
} from "@/api/wms/pdcIn.js";
|
||||
export default {
|
||||
mounted() {
|
||||
getDicts("mes_job_single_report_sign_status").then(res => {
|
||||
this.mes_job_single_report_sign_status = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
listWarehouse().then(res => {
|
||||
this.whList = res.rows
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
whList: [],
|
||||
mes_job_single_report_sign_status: [],
|
||||
datetimerange: [],
|
||||
reportList: [],
|
||||
formData: {
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
status: 1,
|
||||
specification1: null,
|
||||
},
|
||||
range: [{
|
||||
value: 1,
|
||||
text: "报工未检验"
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
text: "检验未入库"
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
returnStatus(i) {
|
||||
console.log(i)
|
||||
let obj = this.mes_job_single_report_sign_status.find(dict => dict.value == i)
|
||||
console.log(obj)
|
||||
if (obj)
|
||||
return obj.text
|
||||
else
|
||||
return ''
|
||||
},
|
||||
//物料编码
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.ptNoTar = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
query() {
|
||||
let obj = {
|
||||
['A.ptNoTar-0']: this.formData.ptNoTar,
|
||||
['A.ptTitleTar-0']: this.formData.ptTitleTar,
|
||||
['A.specification1-0']: this.formData.specification1,
|
||||
['A.status-0']: this.formData.status,
|
||||
['A.ptNoTar-op']: 'ct',
|
||||
['A.ptTitleTar-op']: 'ct',
|
||||
['A.specification1-op']: 'ct',
|
||||
['A.status-op']: 'eq',
|
||||
gexpr: 'A',
|
||||
pageNum: 0,
|
||||
pageSize: 100
|
||||
}
|
||||
advListMesJobSingleReportSign(obj).then(res => {
|
||||
this.reportList = res.rows.map(item => {
|
||||
let obj = this.whList.find(i => i.warehouseCode == item.whCode)
|
||||
if (obj) {
|
||||
console.log(obj)
|
||||
item.whName = obj.warehouseName
|
||||
}
|
||||
return item
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
161
pages/mes/mesJobSingleReportSign/qualityEnsure.vue
Normal file
161
pages/mes/mesJobSingleReportSign/qualityEnsure.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-forms-item label="物料编码" :labelWidth='90' name="ptNoTar">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.ptNoTar" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='90' name="ptTitleTar">
|
||||
<uni-easyinput v-model="formData.ptTitleTar" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料规格" :labelWidth='90' name="specification1">
|
||||
<uni-easyinput v-model="formData.specification1" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="仓库" :labelWidth='90' name="formData.whCode">
|
||||
<zxz-uni-data-select v-model="formData.whCode" :localdata="whOptions"
|
||||
:filterable="true"></zxz-uni-data-select>
|
||||
<!-- <uni-data-select v-model="formData.whCode" :localdata="whOptions"></uni-data-select> -->
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="query">查询</u-button>
|
||||
<uni-collapse-item :open="true">
|
||||
<u-checkbox size="25" iconSize="25" activeColor="green" labelSize='40rpx' :label="'全选'"
|
||||
@change="selectAll" v-if="reportList.length>0" :checked="selectAllChecked">
|
||||
</u-checkbox>
|
||||
<u-checkbox-group v-model="checked" @change="getCheckedList" :borderBottom="true" placement="column"
|
||||
iconPlacement="right" style="height: 50vh;overflow: scroll;">
|
||||
<u-checkbox size="25" iconSize="25" activeColor="green" v-for="(item, index) in reportList"
|
||||
:key="index" :disabled="item.disabled" :name="item.id" :label="'\n'+' 序号 : '+(index+1)+'\n\n'+
|
||||
'物料编码 : '+(item.ptNoTar?item.ptNoTar:'')+'\n\n'+
|
||||
'物料名称 : '+(item.ptTitleTar?item.ptTitleTar:'')+'\n\n'+
|
||||
'物料规格 : '+(item.specification1?item.specification1:'')+'\n\n'+
|
||||
'数量 : '+(item.reportNumber?item.reportNumber:'')+'\n\n'+
|
||||
'仓库 : '+(item.whCode?item.whCode:'')+'\n\n'+
|
||||
'合并标签号 : '+(item.singleReportSign? item.singleReportSign:'')+'\n'
|
||||
">
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</uni-collapse-item>
|
||||
<u-button type="primary" @click="submit" v-if="reportList.length>0">提交</u-button>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesJobSingleReportSign,
|
||||
advListMesJobSingleReportSign,
|
||||
getMesJobSingleReportSign,
|
||||
delMesJobSingleReportSign,
|
||||
addMesJobSingleReportSign,
|
||||
updateMesJobSingleReportSign,
|
||||
reportConfirm,
|
||||
qualityConfirm,
|
||||
whInConfirm
|
||||
} from "@/api/mes/mesJobSingleReportSign";
|
||||
import {
|
||||
listWarehouse
|
||||
} from "@/api/wms/pdcIn";
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
listWarehouse().then(res => {
|
||||
this.whOptions = res.rows.map(item => {
|
||||
return {
|
||||
text: item.warehouseCode + ':' + item.warehouseName,
|
||||
value: item.warehouseCode,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectAllChecked: false,
|
||||
checked: [],
|
||||
whOptions: [],
|
||||
reportList: [],
|
||||
formData: {
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
specification1: null,
|
||||
whCode: null,
|
||||
//报工未检验
|
||||
status: 1
|
||||
},
|
||||
ids: [],
|
||||
rules: {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCheckedList(e) {
|
||||
this.ids = e;
|
||||
console.log(this.ids)
|
||||
// 判断当前选中的复选框数量,决定全选框的状态
|
||||
if (this.ids.length === this.reportList.length) {
|
||||
this.selectAllChecked = true;
|
||||
} else {
|
||||
this.selectAllChecked = false;
|
||||
}
|
||||
},
|
||||
//物料编码
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.ptNoTar = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
query() {
|
||||
listMesJobSingleReportSign(this.formData).then(res => {
|
||||
this.reportList = res.rows
|
||||
})
|
||||
},
|
||||
selectAll() {
|
||||
// 点击全选按钮时,更新所有复选框的选中状态
|
||||
if (this.checked.length === this.reportList.length) {
|
||||
this.checked = [];
|
||||
this.ids = this.checked;
|
||||
this.selectAllChecked = false; // 全选框不选中
|
||||
} else {
|
||||
this.checked = this.reportList.map(item => item.id);
|
||||
this.ids = this.checked
|
||||
this.selectAllChecked = true; // 全选框选中
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该质检确认吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
_this.$modal.loading('提交中')
|
||||
console.log(_this.ids)
|
||||
qualityConfirm(_this.ids).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("上传质检确认成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab(
|
||||
"/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
173
pages/mes/mesJobSingleReportSign/reportContEnsure.vue
Normal file
173
pages/mes/mesJobSingleReportSign/reportContEnsure.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-forms-item label="物料编码" :labelWidth='90' name="ptNoTar">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.ptNoTar" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='90' name="ptTitleTar">
|
||||
<uni-easyinput v-model="formData.ptTitleTar" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料规格" :labelWidth='90' name="specification1">
|
||||
<uni-easyinput v-model="formData.specification1" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="仓库" :labelWidth='90' name="formData.whCode">
|
||||
<zxz-uni-data-select v-model="formData.whCode" :localdata="whOptions"
|
||||
:filterable="true"></zxz-uni-data-select>
|
||||
<!-- <uni-data-select v-model="formData.whCode" :localdata="whOptions"></uni-data-select> -->
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="query" style="margin-bottom: 10px;">查询</u-button>
|
||||
<!-- <uni-collapse-item :open="true"> -->
|
||||
<u-checkbox size="25" iconSize="25" activeColor="green" labelSize='40rpx' :label="'全选'" @change="selectAll"
|
||||
v-if="reportList.length>0" :checked="selectAllChecked">
|
||||
</u-checkbox>
|
||||
<u-checkbox-group v-model="checked" @change="getCheckedList" :borderBottom="true" placement="column"
|
||||
iconPlacement="right" style="height: 63vh;overflow: scroll;">
|
||||
<u-checkbox size="25" iconSize="25" activeColor="green" v-for="(item, index) in reportList" :key="index"
|
||||
:disabled="item.disabled" :name="item.id" :label="'\n'+' 序号 : '+(index+1)+'\n\n'+
|
||||
'物料编码 : '+(item.ptNoTar?item.ptNoTar:'')+'\n\n'+
|
||||
'物料名称 : '+(item.ptTitleTar?item.ptTitleTar:'')+'\n\n'+
|
||||
'物料规格 : '+(item.specification1?item.specification1:'')+'\n\n'+
|
||||
'数量 : '+(item.reportNumber?item.reportNumber:'')+'\n\n'+
|
||||
'仓库 : '+(item.whCode?item.whCode:'')+'\n\n'+
|
||||
'合并标签号 : '+(item.singleReportSign? item.singleReportSign:'')+'\n'
|
||||
">
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<!-- </uni-collapse-item> -->
|
||||
<u-button type="primary" @click="submit" v-if="reportList.length>0">提交</u-button>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesJobSingleReportSign,
|
||||
advListMesJobSingleReportSign,
|
||||
getMesJobSingleReportSign,
|
||||
delMesJobSingleReportSign,
|
||||
addMesJobSingleReportSign,
|
||||
updateMesJobSingleReportSign,
|
||||
reportConfirm,
|
||||
qualityConfirm,
|
||||
whInConfirm
|
||||
} from "@/api/mes/mesJobSingleReportSign";
|
||||
import {
|
||||
listWarehouse
|
||||
} from "@/api/wms/pdcIn";
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
listWarehouse().then(res => {
|
||||
this.whOptions = res.rows.map(item => {
|
||||
return {
|
||||
text: item.warehouseCode + ':' + item.warehouseName,
|
||||
value: item.warehouseCode,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectAllChecked: false,
|
||||
checked: [],
|
||||
whOptions: [],
|
||||
reportList: [],
|
||||
formData: {
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
specification1: null,
|
||||
whCode: null,
|
||||
status: 0
|
||||
},
|
||||
ids: [],
|
||||
rules: {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCheckedList(e) {
|
||||
this.ids = e;
|
||||
console.log(this.ids)
|
||||
// 判断当前选中的复选框数量,决定全选框的状态
|
||||
if (this.ids.length === this.reportList.length) {
|
||||
this.selectAllChecked = true;
|
||||
} else {
|
||||
this.selectAllChecked = false;
|
||||
}
|
||||
},
|
||||
//物料编码
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.ptNoTar = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
query() {
|
||||
listMesJobSingleReportSign(this.formData).then(res => {
|
||||
if (res.rows.length === 0) {
|
||||
this.$modal.msg("未查询到相关记录!");
|
||||
return;
|
||||
}
|
||||
|
||||
this.reportList = res.rows.map(item => {
|
||||
let obj = this.whOptions.find(item => item.warehouseCode == item.whCode)
|
||||
if (obj) {
|
||||
item.whName = obj.warehouseName
|
||||
}
|
||||
return item
|
||||
});
|
||||
|
||||
})
|
||||
},
|
||||
selectAll() {
|
||||
// 点击全选按钮时,更新所有复选框的选中状态
|
||||
if (this.checked.length === this.reportList.length) {
|
||||
this.checked = [];
|
||||
this.ids = this.checked;
|
||||
this.selectAllChecked = false; // 全选框不选中
|
||||
} else {
|
||||
this.checked = this.reportList.map(item => item.id);
|
||||
this.ids = this.checked
|
||||
this.selectAllChecked = true; // 全选框选中
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该质检确认吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log(_this.ids)
|
||||
// let ids = this.reportList.map(item => item.id)
|
||||
reportConfirm(_this.ids)
|
||||
_this.$modal.msg("报工确认已提交!");
|
||||
_this.formData = {
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
specification1: null,
|
||||
whCode: null,
|
||||
}
|
||||
_this.reportList = [];
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
157
pages/mes/mesJobSingleReportSign/reportEnsure.vue
Normal file
157
pages/mes/mesJobSingleReportSign/reportEnsure.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData">
|
||||
<uni-forms-item label="合并标签码" :labelWidth='90' name="singleReportSign">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.singleReportSign" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-swipe-action style="height: 88vh;overflow: scroll;">
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
@click="(data) => clickDetail(index,data)" v-for="(item, index) in reportList">
|
||||
<uni-card :is-shadow="false" is-full>
|
||||
<div><strong>物料编码</strong>:{{item.ptNoTar}}</div>
|
||||
<div><strong>物料名称</strong>:{{item.ptTitleTar}}</div>
|
||||
<div><strong>物料规格</strong>:{{item.specification1}}</div>
|
||||
<div><strong>数量</strong>:{{item.reportNumber}}</div>
|
||||
<div><strong>仓库</strong>:{{item.whName?item.whName:item.whCode}}</div>
|
||||
<div><strong>合并标签码</strong>:{{item.singleReportSign}}</div>
|
||||
</uni-card>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesJobSingleReportSign,
|
||||
advListMesJobSingleReportSign,
|
||||
getMesJobSingleReportSign,
|
||||
delMesJobSingleReportSign,
|
||||
addMesJobSingleReportSign,
|
||||
updateMesJobSingleReportSign,
|
||||
reportConfirm,
|
||||
qualityConfirm,
|
||||
whInConfirm
|
||||
} from "@/api/mes/mesJobSingleReportSign";
|
||||
import {
|
||||
listWarehouse
|
||||
} from "@/api/wms/pdcIn.js";
|
||||
export default {
|
||||
mounted() {
|
||||
listWarehouse().then(res => {
|
||||
this.whList = res.rows
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
whList: [],
|
||||
reportList: [],
|
||||
formData: {
|
||||
singleReportSign: null
|
||||
},
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
deleteDetail(index) {
|
||||
this.reportList.splice(index, 1);
|
||||
},
|
||||
clickDetail(itemIndex, {
|
||||
position,
|
||||
index
|
||||
}) {
|
||||
if (index == 0) {
|
||||
this.deleteDetail(itemIndex);
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
let ids = this.reportList.map(item => item.id)
|
||||
reportConfirm(ids)
|
||||
this.$modal.msg("报工确认已提交!");
|
||||
this.reportCode = null;
|
||||
this.reportList = [];
|
||||
},
|
||||
scanBarCode() {
|
||||
listMesJobSingleReportSign(this.formData).then(res => {
|
||||
if (res.rows.length === 0) {
|
||||
this.$modal.msg("未查询到相关记录!");
|
||||
return;
|
||||
}
|
||||
const row = res.rows[0];
|
||||
if (row.status !== 0) {
|
||||
this.$modal.msg("该记录当前不在'未上传报工'状态!");
|
||||
} else {
|
||||
if (this.reportList.some(item => item.id == row.id)) {
|
||||
this.$modal.msg("数据已存在,无需重复添加。");
|
||||
return;
|
||||
}
|
||||
|
||||
let obj = this.whList.find(item => item.warehouseCode == row.whCode)
|
||||
if (obj) {
|
||||
row.whName = obj.warehouseName
|
||||
}
|
||||
this.reportList.push(row);
|
||||
}
|
||||
this.formData.singleReportSign = null;
|
||||
})
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.singleReportSign = res.result;
|
||||
_this.scanBarCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
// 搜索框
|
||||
.search-bar {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
margin-top: 2%;
|
||||
}
|
||||
|
||||
.search-bar-box {
|
||||
display: flex;
|
||||
margin: 0 auto;
|
||||
width: 620rpx;
|
||||
height: 74rpx;
|
||||
border: 5rpx solid #00a8cc;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
|
||||
.search-text {
|
||||
width: 100%;
|
||||
margin-top: 10rpx;
|
||||
margin-left: 20rpx;
|
||||
font-size: 30rpx;
|
||||
color: #7f7f81;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
background-color: #00a8cc;
|
||||
/* Green */
|
||||
color: white;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
font-size: 35rpx;
|
||||
width: 240rpx;
|
||||
height: 70rpx;
|
||||
line-height: 65rpx;
|
||||
border-radius: 30rpx;
|
||||
letter-spacing: 3rpx;
|
||||
}
|
||||
</style>
|
||||
98
pages/mes/mesJobSingleReportSign/reportFailRecord.vue
Normal file
98
pages/mes/mesJobSingleReportSign/reportFailRecord.vue
Normal file
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<view style="background-color: #fff" v-if="reportList.length>0">
|
||||
<u-checkbox size="25" iconSize="25" activeColor="green" labelSize='40rpx' :label="'全选'" @change="selectAll"
|
||||
v-if="reportList.length>0" :checked="selectAllChecked">
|
||||
</u-checkbox>
|
||||
<u-checkbox-group v-model="checked" @change="getCheckedList" :borderBottom="true" placement="column"
|
||||
iconPlacement="right" style="height: 80vh;overflow: scroll;overflow-wrap:anywhere">
|
||||
<u-checkbox size="25" iconSize="25" activeColor="green" v-for="(item, index) in reportList" :key="index"
|
||||
:disabled="item.disabled" :name="item.id" :label="'\n'+' 序号 : '+(index+1)+'\n\n'+
|
||||
'物料编码 : '+(item.ptNoTar?item.ptNoTar:'')+'\n\n'+
|
||||
'物料名称 : '+(item.ptTitleTar?item.ptTitleTar:'')+'\n\n'+
|
||||
'物料规格 : '+(item.specification1?item.specification1:'')+'\n\n'+
|
||||
'数量 : '+(item.reportNumber?item.reportNumber:'')+'\n\n'+
|
||||
'仓库 : '+(item.whCode?item.whCode:'')+'\n\n'+
|
||||
'合并标签号 : '+(item.singleReportSign? item.singleReportSign:'')+'\n\n'+
|
||||
'失败原因 : '+(item.remark? item.remark:'')+'\n'
|
||||
">
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<u-button type="primary" @click="submit" v-if="reportList.length>0">提交</u-button>
|
||||
</view>
|
||||
<view v-else style="text-align: center;">
|
||||
查询无记录
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesJobSingleReportSign,
|
||||
advListMesJobSingleReportSign,
|
||||
getMesJobSingleReportSign,
|
||||
delMesJobSingleReportSign,
|
||||
addMesJobSingleReportSign,
|
||||
updateMesJobSingleReportSign,
|
||||
reportConfirm,
|
||||
qualityConfirm,
|
||||
whInConfirm
|
||||
} from "@/api/mes/mesJobSingleReportSign";
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
this.query()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectAllChecked: false,
|
||||
checked: [],
|
||||
ids: [],
|
||||
reportList: [],
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCheckedList(e) {
|
||||
this.ids = e;
|
||||
// 判断当前选中的复选框数量,决定全选框的状态
|
||||
if (this.ids.length === this.reportList.length) {
|
||||
this.selectAllChecked = true;
|
||||
} else {
|
||||
this.selectAllChecked = false;
|
||||
}
|
||||
},
|
||||
selectAll() {
|
||||
// 点击全选按钮时,更新所有复选框的选中状态
|
||||
if (this.checked.length === this.reportList.length) {
|
||||
this.checked = [];
|
||||
this.selectAllChecked = false; // 全选框不选中
|
||||
} else {
|
||||
this.checked = this.reportList.map(item => item.id);
|
||||
this.selectAllChecked = true; // 全选框选中
|
||||
}
|
||||
},
|
||||
query() {
|
||||
listMesJobSingleReportSign({
|
||||
errStatus: 1,
|
||||
status: 0
|
||||
}).then(res => {
|
||||
this.reportList = res.rows
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
// let ids = this.reportList.map(item => item.id)
|
||||
reportConfirm(this.ids)
|
||||
this.$tab.switchTab(
|
||||
"/pages/work/index");
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
131
pages/mes/mesJobSingleReportSign/statusQuery.vue
Normal file
131
pages/mes/mesJobSingleReportSign/statusQuery.vue
Normal file
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-forms-item label="合并标签码" :labelWidth='90' name="singleReportSign">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="query"
|
||||
v-model="formData.singleReportSign" type="text" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="query">查询</u-button>
|
||||
<uni-collapse-item :open="true">
|
||||
<uni-card :is-shadow="false" is-full v-for="item,index in reportList" :key="item.id">
|
||||
<div><strong>合并标签号</strong>:{{item.singleReportSign}}</div>
|
||||
<div><strong>物料编码</strong>:{{item.ptNoTar}}</div>
|
||||
<div><strong>物料名称</strong>:{{item.ptTitleTar}}</div>
|
||||
<div><strong>物料规格</strong>:{{item.specification1}}</div>
|
||||
<div><strong>数量</strong>:{{item.reportNumber}}</div>
|
||||
<div><strong>仓库</strong>:{{item.whName?item.whName:item.whCode}}</div>
|
||||
<div><strong>失败原因</strong>:{{item.remark?item.remark:''}}</div>
|
||||
<div><strong>状态</strong>:{{returnStatus(item.status)}}</div>
|
||||
</uni-card>
|
||||
</uni-collapse-item>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesJobSingleReportSign,
|
||||
advListMesJobSingleReportSign,
|
||||
getMesJobSingleReportSign,
|
||||
delMesJobSingleReportSign,
|
||||
addMesJobSingleReportSign,
|
||||
updateMesJobSingleReportSign,
|
||||
reportConfirm,
|
||||
qualityConfirm,
|
||||
whInConfirm
|
||||
} from "@/api/mes/mesJobSingleReportSign";
|
||||
import {
|
||||
listWarehouse
|
||||
} from "@/api/wms/pdcIn.js";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
export default {
|
||||
mounted() {
|
||||
getDicts("mes_job_single_report_sign_status").then(res => {
|
||||
this.mes_job_single_report_sign_status = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
listWarehouse().then(res => {
|
||||
this.whList = res.rows
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
whList: [],
|
||||
mes_job_single_report_sign_status: [],
|
||||
reportList: [],
|
||||
formData: {
|
||||
singleReportSign: null
|
||||
},
|
||||
rules: {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
returnStatus(i) {
|
||||
console.log(i)
|
||||
let obj = this.mes_job_single_report_sign_status.find(dict => dict.value == i)
|
||||
console.log(obj)
|
||||
if (obj)
|
||||
return obj.text
|
||||
else
|
||||
return ''
|
||||
},
|
||||
//合并标签编码
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.singleReportSign = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
query() {
|
||||
let obj = {
|
||||
['A.singleReportSign-0']: this.formData.singleReportSign,
|
||||
['A.singleReportSign-op']: 'ct',
|
||||
gexpr: 'A'
|
||||
}
|
||||
advListMesJobSingleReportSign(obj).then(res => {
|
||||
this.reportList = res.rows.map(item => {
|
||||
let obj = this.whList.find(i => i.warehouseCode == item.whCode)
|
||||
if (obj) {
|
||||
console.log(obj)
|
||||
item.whName = obj.warehouseName
|
||||
}
|
||||
return item
|
||||
})
|
||||
})
|
||||
// listMesJobSingleReportSign(this.formData).then(res => {
|
||||
// if (res.rows.length > 0) {
|
||||
// if (!res.rows[0].whCode) {
|
||||
// this.reportList = res.rows
|
||||
// } else {
|
||||
// let obj = this.whList.find(item => item.warehouseCode == res.rows[0].whCode)
|
||||
// if (obj) {
|
||||
// console.log(obj)
|
||||
// res.rows[0].whName = obj.warehouseName
|
||||
// }
|
||||
// this.reportList = res.rows
|
||||
// }
|
||||
// } else {
|
||||
// this.$modal.msg("未查询到相关记录!");
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
140
pages/mes/mouldShareGroup/addMouldShareGroup.vue
Normal file
140
pages/mes/mouldShareGroup/addMouldShareGroup.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="共模作业组编码" :labelWidth='80' name="shareMouldJobGroupCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" type="text"
|
||||
v-model="formData.shareMouldJobGroupCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="共模组编码" :labelWidth='80' name="shareMouldGroupCode">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar2"
|
||||
v-model="formData.shareMouldGroupCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="模具编码" :labelWidth='80' name="mouldUuid">
|
||||
<uni-easyinput type="text" v-model="formData.mouldUuid" @focus="show=!show" />
|
||||
<u-picker :show="show" @cancel="showClose" @close="showClose" closeOnClickOverlay
|
||||
:columns="mouldUuidList" @confirm="showConfirm" keyName="label">
|
||||
</u-picker>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="备注" :labelWidth='80' name="remark">
|
||||
<uni-easyinput type="textarea" v-model="formData.remark" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesMouldShareGroup,
|
||||
getMesMouldShareGroup,
|
||||
delMesMouldShareGroup,
|
||||
addMesMouldShareGroup,
|
||||
updateMesMouldShareGroup,
|
||||
listMould
|
||||
} from "@/api/mes/mouldShareGroup";
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
mouldUuidList: [],
|
||||
show: false,
|
||||
formData: {
|
||||
shareMouldJobGroupCode: null,
|
||||
shareMouldGroupCode: null,
|
||||
mouldUuid: null,
|
||||
mouldCode: null,
|
||||
remark: null,
|
||||
type: null,
|
||||
status: 0,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delStatus: "0"
|
||||
},
|
||||
rules: {
|
||||
shareMouldJobGroupCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入共模作业组编码!'
|
||||
}]
|
||||
},
|
||||
// shareMouldGroupCode: {
|
||||
// rules: [{
|
||||
// required: true,
|
||||
// errorMessage: '请输入共模组编码!'
|
||||
// }]
|
||||
// }
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
listMould().then(res => {
|
||||
this.mouldUuidList.push(res.rows.map(item => {
|
||||
item.label = item.mouldUuid + ':' + item.mouldName;
|
||||
return item
|
||||
}))
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
showConfirm(e) {
|
||||
console.log(e)
|
||||
this.formData.mouldCode = e.value[0].mouldCode;
|
||||
this.formData.mouldUuid = e.value[0].mouldUuid;
|
||||
this.show = false
|
||||
},
|
||||
showClose() {
|
||||
this.show = false
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定添加该共模作业组吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
_this.$modal.loading('提交中')
|
||||
addMesMouldShareGroup(_this.formData).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("添加共模作业组成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.shareMouldJobGroupCode = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar2() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.shareMouldGroupCode = res.result;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
299
pages/mes/mouldShareGroup/addMouldShareGroupDetail.vue
Normal file
299
pages/mes/mouldShareGroup/addMouldShareGroupDetail.vue
Normal file
@@ -0,0 +1,299 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-collapse-item title="共模作业组单" :open="true">
|
||||
<uni-forms-item label="共模作业组编码" :labelWidth='80' name="shareMouldJobGroupCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode" type="text"
|
||||
v-model="formData.shareMouldJobGroupCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="共模组编码" :labelWidth='80' name="shareMouldGroupCode">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar2"
|
||||
v-model="formData.shareMouldGroupCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="模具编码" :labelWidth='80' name="mouldUuid">
|
||||
<uni-easyinput type="text" v-model="formData.mouldUuid" @focus="showmould=!showmould" />
|
||||
<u-picker :show="showmould" @cancel="showmouldClose" @close="showmouldClose" closeOnClickOverlay
|
||||
:columns="mouldUuidList" @confirm="showmouldConfirm" keyName="label">
|
||||
</u-picker>
|
||||
</uni-forms-item>
|
||||
<uni-row :gutter="20">
|
||||
<uni-col :span="12" style="text-align: center;">
|
||||
<button type="primary" size="mini" @click="addDetail">添加</button>
|
||||
</uni-col>
|
||||
<uni-col :span="12" style="text-align: center;">
|
||||
<button type="success" size="mini" @click="reset">重置</button>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="共模作业组单明细" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
v-for="(item, index) in formData.mesMouldShareGroupDetailList"
|
||||
@click="(data) => clickDetail(index,data)">
|
||||
<uni-badge :text="index+1" type="primary"></uni-badge>
|
||||
<uni-card :is-shadow="false" is-full>
|
||||
<div><strong>作业</strong>:{{item.jobCode}}</div>
|
||||
<div><strong>制程序号</strong>:{{item.opNo}}</div>
|
||||
<div><strong>制程编码</strong>:{{item.opCode}}</div>
|
||||
<div><strong>目标产品</strong>:{{item.ptNoTar}}</div>
|
||||
<div><strong>生产版本</strong>:{{item.productionVersion}}</div>
|
||||
<div><strong>单模产出数量</strong>:{{item.singleMouldNum}}</div>
|
||||
<div><strong>备注</strong>:{{item.remark}}</div>
|
||||
</uni-card>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
|
||||
<u-popup :show="show" @close="close">
|
||||
<div style="min-height: 50vh;">
|
||||
<div style="font-size: 16px;color:#606266; margin-top: 10px;">作业编码</div>
|
||||
<uni-easyinput style="margin-top: 10px;" suffixIcon="scan" @iconClick="scanBar1" type="text" focus
|
||||
v-model="jobCode" @confirm="scanBarJobCode" />
|
||||
<uni-card :is-shadow="false" is-full v-for="item in jobList" :key="item.id" :border="false">
|
||||
<div><strong>制程序号</strong>:{{item.opNo}}</div>
|
||||
<div><strong>制程编码</strong>:{{item.opCode}}</div>
|
||||
<div><strong>目标产品</strong>:{{item.ptNoTar}}</div>
|
||||
<div><strong>生产版本</strong>:{{item.productionVersion}}</div>
|
||||
<div><strong>单模产出数量</strong>:<u-number-box button-size="36" inputWidth="120"
|
||||
v-model="item.singleMouldNum" min="0"></u-number-box></div>
|
||||
<div><strong>备注</strong>:<uni-easyinput type="textarea" v-model="item.remark" /></div>
|
||||
</uni-card>
|
||||
<u-button type="primary" v-show="jobList.length>0" @click="pickJob">选中</u-button>
|
||||
</div>
|
||||
|
||||
</u-popup>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesMouldShareGroupDetail,
|
||||
getMesMouldShareGroupDetail,
|
||||
addMesMouldShareGroupDetail,
|
||||
updateMesMouldShareGroupDetail,
|
||||
delMesMouldShareGroupDetail
|
||||
} from "@/api/mes/mouldShareGroupDetail";
|
||||
import {
|
||||
listMesMouldShareGroup,
|
||||
getMesMouldShareGroup,
|
||||
delMesMouldShareGroup,
|
||||
addMesMouldShareGroup,
|
||||
updateMesMouldShareGroup,
|
||||
listMould
|
||||
} from "@/api/mes/mouldShareGroup";
|
||||
import {
|
||||
listPwoJob
|
||||
} from "@/api/mes/jobReport.js";
|
||||
export default {
|
||||
mounted() {
|
||||
listMould().then(res => {
|
||||
this.mouldUuidList.push(res.rows.map(item => {
|
||||
item.label = item.mouldUuid + ':' + item.mouldName;
|
||||
return item
|
||||
}))
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mouldUuidList: [],
|
||||
show: false,
|
||||
jobList: [],
|
||||
showmould: false,
|
||||
jobCode: null,
|
||||
formData: {
|
||||
id: null,
|
||||
shareMouldJobGroupCode: null,
|
||||
shareMouldGroupCode: null,
|
||||
mesMouldShareGroupDetailList: [],
|
||||
},
|
||||
oldmesMouldShareGroupDetailList: [],
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
shareMouldJobGroupCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入共模作业组编码!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showmouldConfirm(e) {
|
||||
console.log(e)
|
||||
this.formData.mouldCode = e.value[0].mouldCode;
|
||||
this.formData.mouldUuid = e.value[0].mouldUuid;
|
||||
this.showmould = false
|
||||
},
|
||||
showmouldClose() {
|
||||
this.showmould = false
|
||||
},
|
||||
reset() {
|
||||
this.formData.mesMouldShareGroupDetailList = this.oldmesMouldShareGroupDetailList;
|
||||
},
|
||||
deleteDetail(index) {
|
||||
this.formData.mesMouldShareGroupDetailList.splice(index, 1);
|
||||
},
|
||||
clickDetail(itemIndex, {
|
||||
position,
|
||||
index
|
||||
}) {
|
||||
if (index == 0) {
|
||||
this.deleteDetail(itemIndex);
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.jobCode = null;
|
||||
this.jobList = [];
|
||||
this.show = false;
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.shareMouldJobGroupCode) {
|
||||
let obj = {
|
||||
shareMouldJobGroupCode: this.formData.shareMouldJobGroupCode
|
||||
}
|
||||
listMesMouldShareGroup(obj).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
this.formData = res.rows[0];
|
||||
listMesMouldShareGroupDetail({
|
||||
shareMouldJobGroupId: this.formData.id
|
||||
}).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
this.oldmesMouldShareGroupDetailList = res.rows;
|
||||
this.$set(this.formData, 'mesMouldShareGroupDetailList', [...
|
||||
res.rows
|
||||
])
|
||||
} else {
|
||||
this.formData.mesMouldShareGroupDetailList = [];
|
||||
this.$modal.msg("该共模作业组查无明细!");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("未查到该共模作业组!");
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("请输入共模作业组编码!");
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.shareMouldJobGroupCode = res.result;
|
||||
_this.scanBarCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.pwoCode = res.result;
|
||||
_this.scanBarPwoCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
addcancel() {
|
||||
this.addshow = false;
|
||||
},
|
||||
pickJob() {
|
||||
const _this = this;
|
||||
if (_this.jobList.length > 0) {
|
||||
if (_this.formData.id && _this.formData.shareMouldJobGroupCode && _this.jobList[0].singleMouldNum) {
|
||||
let obj = {
|
||||
shareMouldJobGroupCode: _this.formData.shareMouldJobGroupCode,
|
||||
shareMouldJobGroupId: _this.formData.id,
|
||||
jobId: _this.jobList[0].id,
|
||||
jobCode: _this.jobList[0].code,
|
||||
opCode: _this.jobList[0].opCode,
|
||||
opNo: _this.jobList[0].opNo,
|
||||
ptNoTar: _this.jobList[0].ptNoTar,
|
||||
productionVersion: _this.jobList[0].productionVersion,
|
||||
singleMouldNum: _this.jobList[0].singleMouldNum,
|
||||
status: 0
|
||||
}
|
||||
addMesMouldShareGroupDetail(obj).then(async res => {
|
||||
_this.$modal.msgSuccess("添加共模作业组明细成功!");
|
||||
_this.scanBarCode();
|
||||
_this.jobCode = null;
|
||||
_this.jobList = [];
|
||||
_this.show = false;
|
||||
});
|
||||
} else {
|
||||
_this.$modal.msg("请先输入共模作业组编码并查询明细!")
|
||||
}
|
||||
} else {
|
||||
_this.$modal.msg("请先输入作业编码并查询!")
|
||||
}
|
||||
},
|
||||
scanBarJobCode() {
|
||||
if (this.jobCode) {
|
||||
let obj = {
|
||||
code: this.jobCode
|
||||
}
|
||||
listPwoJob(obj).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.jobList = res.rows
|
||||
} else {
|
||||
this.$modal.msg("未找到该作业!")
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
addDetail() {
|
||||
if (this.formData.shareMouldJobGroupCode && this.formData.shareMouldJobGroupCode != '' && this.formData
|
||||
.id) {
|
||||
this.show = true;
|
||||
} else {
|
||||
this.$modal.msg("请先输入共模作业组编码并查询明细!")
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定修改该共模作业组吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
if (_this.formData.id && _this.formData.shareMouldJobGroupCode) {
|
||||
console.log(_this.formData)
|
||||
_this.$modal.loading('提交中')
|
||||
updateMesMouldShareGroup(_this.formData).then(async res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("修改共模作业组成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab(
|
||||
"/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else {
|
||||
_this.$modal.msg("请先输入共模作业组编码并查询明细!")
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
100
pages/mes/productSuit/addSuit.vue
Normal file
100
pages/mes/productSuit/addSuit.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="套装编码" :labelWidth='80' name="suitCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" v-model="formData.suitCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="套装名称" :labelWidth='80' name="suitName">
|
||||
<uni-easyinput type="text" v-model="formData.suitName" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="备注" :labelWidth='80' name="remark">
|
||||
<uni-easyinput type="textarea" v-model="formData.remark" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesProductSuit,
|
||||
getMesProductSuit,
|
||||
delMesProductSuit,
|
||||
addMesProductSuit,
|
||||
updateMesProductSuit
|
||||
} from "@/api/mes/productSuit";
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
suitCode: null,
|
||||
suitName: null,
|
||||
remark: null,
|
||||
type: null,
|
||||
status: 0,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delStatus: "0"
|
||||
},
|
||||
rules: {
|
||||
suitCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入套装编码!'
|
||||
}]
|
||||
},
|
||||
suitName: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入套装名称!'
|
||||
}]
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定添加该套装吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
// cons
|
||||
_this.$modal.loading('提交中')
|
||||
addMesProductSuit(_this.formData).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("添加套装成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.suitCode = res.result;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
313
pages/mes/productSuit/addSuitDetail.vue
Normal file
313
pages/mes/productSuit/addSuitDetail.vue
Normal file
@@ -0,0 +1,313 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-collapse-item title="套装明细单" :open="true">
|
||||
<uni-forms-item label="套装编码" :labelWidth='80' name="suitCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode" type="text"
|
||||
v-model="formData.suitCode" />
|
||||
</uni-forms-item>
|
||||
<uni-row :gutter="20">
|
||||
<uni-col :span="12" style="text-align: center;">
|
||||
<button type="primary" size="mini" @click="addDetail">添加</button>
|
||||
</uni-col>
|
||||
<uni-col :span="12" style="text-align: center;">
|
||||
<button type="success" size="mini" @click="reset">重置</button>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-collapse-item>
|
||||
|
||||
<uni-collapse-item title="套装明细项信息" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
v-for="(item, index) in formData.mesProductSuitDetailList"
|
||||
@click="(data) => clickDetail(index,data)">
|
||||
<uni-badge :text="index+1" type="primary"></uni-badge>
|
||||
<uni-card :is-shadow="false" is-full>
|
||||
<div><strong>物料编码</strong>:{{item.materialCode}}</div>
|
||||
<div><strong>物料名称</strong>:{{item.materialName}}</div>
|
||||
<div><strong>批号</strong>:{{item.batchNo}}</div>
|
||||
<div><strong>箱号</strong>:{{item.lotNo}}</div>
|
||||
<div><strong>件号</strong>:{{item.pieceNo}}</div>
|
||||
<div><strong>数量</strong>:{{item.num}}</div>
|
||||
<div><strong>单位</strong>:{{item.unitId}}</div>
|
||||
<div><strong>备注</strong>:{{item.remark}}</div>
|
||||
</uni-card>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
|
||||
<u-popup :show="show" @close="close">
|
||||
<div style="min-height: 50vh;">
|
||||
<div style="font-size: 16px;color:#606266; margin-top: 10px;">工单</div>
|
||||
<uni-easyinput style="margin-top: 10px;" suffixIcon="scan" @iconClick="scanBar1" type="text" focus
|
||||
v-model="pwoCode" @confirm="scanBarPwoCode" />
|
||||
<uni-card :is-shadow="false" is-full v-for="item in pwoList" :key="item.id" :border="false">
|
||||
<div><strong>目标产品编码</strong>:{{item.ptNoTar}}</div>
|
||||
<div><strong>目标产品名称</strong>:{{item.ptTitleTar}}</div>
|
||||
<div><strong>批号</strong>:{{item.batchNo}}</div>
|
||||
<div><strong>数量</strong>:{{item.num}}</div>
|
||||
<div><strong>状态</strong>:<uni-tag :text="pwotag(item.status)" type="warning"></uni-tag></div>
|
||||
</uni-card>
|
||||
<u-button type="primary" v-show="pwoList.length>0" @click="pickPwo">选中</u-button>
|
||||
</div>
|
||||
|
||||
</u-popup>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesProductSuitDetail,
|
||||
getMesProductSuitDetail,
|
||||
delMesProductSuitDetail,
|
||||
addMesProductSuitDetail,
|
||||
updateMesProductSuitDetail
|
||||
} from "@/api/mes/productSuitDetail";
|
||||
import {
|
||||
getPwo,
|
||||
listPwo,
|
||||
pwoAtificialClose,
|
||||
handleIn,
|
||||
listCirculateBalance
|
||||
} from "@/api/mes/pwoDraw.js";
|
||||
import {
|
||||
listMesProductSuit,
|
||||
getMesProductSuit,
|
||||
delMesProductSuit,
|
||||
addMesProductSuit,
|
||||
updateMesProductSuit
|
||||
} from "@/api/mes/productSuit";
|
||||
export default {
|
||||
mounted() {},
|
||||
data() {
|
||||
return {
|
||||
pwoList: [],
|
||||
show: false,
|
||||
pwoCode: null,
|
||||
formData: {
|
||||
id: null,
|
||||
suitCode: null,
|
||||
mesProductSuitDetailList: [],
|
||||
},
|
||||
oldmesProductSuitDetailList: [],
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
suitCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入套装编码!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reset() {
|
||||
this.formData.mesProductSuitDetailList = this.oldmesProductSuitDetailList;
|
||||
},
|
||||
deleteDetail(index) {
|
||||
this.formData.mesProductSuitDetailList.splice(index, 1);
|
||||
},
|
||||
clickDetail(itemIndex, {
|
||||
position,
|
||||
index
|
||||
}) {
|
||||
if (index == 0) {
|
||||
this.deleteDetail(itemIndex);
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.pwoCode = null;
|
||||
this.pwoList = [];
|
||||
this.show = false;
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.suitCode) {
|
||||
let obj = {
|
||||
suitCode: this.formData.suitCode
|
||||
}
|
||||
listMesProductSuit(obj).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
this.formData.id = res.rows[0].id;
|
||||
listMesProductSuitDetail({
|
||||
suitId: this.formData.id
|
||||
}).then(async res => {
|
||||
if (res.rows.length != 0) {
|
||||
this.oldmesProductSuitDetailList = res.rows;
|
||||
this.formData.mesProductSuitDetailList = [...res.rows]
|
||||
} else {
|
||||
this.formData.mesProductSuitDetailList = [];
|
||||
this.$modal.msg("该套装查无明细!");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("未查到该套装!");
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$modal.msg("请输入套装编码!");
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.suitCode = res.result;
|
||||
_this.scanBarCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.pwoCode = res.result;
|
||||
_this.scanBarPwoCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
addcancel() {
|
||||
this.addshow = false;
|
||||
},
|
||||
pickPwo() {
|
||||
const _this = this;
|
||||
if (_this.pwoList.length > 0) {
|
||||
|
||||
if (_this.formData.id && _this.formData.suitCode) {
|
||||
|
||||
let obj = {
|
||||
suitId: _this.formData.id,
|
||||
suitCode: _this.formData.suitCode,
|
||||
materialCode: _this.pwoList[0].ptNoTar,
|
||||
materialName: _this.pwoList[0].ptTitleTar,
|
||||
batchNo: _this.pwoList[0].batchNo,
|
||||
num: _this.pwoList[0].planNum
|
||||
}
|
||||
addMesProductSuitDetail(obj).then(async res => {
|
||||
_this.$modal.msgSuccess("添加套装明细成功!");
|
||||
_this.scanBarCode();
|
||||
_this.pwoCode = null;
|
||||
_this.pwoList = [];
|
||||
_this.show = false;
|
||||
});
|
||||
} else {
|
||||
_this.$modal.msg("请先输入套装编码并查询明细!")
|
||||
}
|
||||
} else {
|
||||
_this.$modal.msg("请先输入工单并查询!")
|
||||
}
|
||||
},
|
||||
scanBarPwoCode() {
|
||||
if (this.pwoCode) {
|
||||
let obj = {
|
||||
pwoCode: this.pwoCode
|
||||
}
|
||||
listPwo(obj).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.pwoList = res.rows
|
||||
} else {
|
||||
this.$modal.msg("未找到该工单!")
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
addDetail() {
|
||||
if (this.formData.suitCode && this.formData.suitCode != '' && this.formData.id) {
|
||||
this.show = true;
|
||||
} else {
|
||||
this.$modal.msg("请先输入套装编码并查询明细!")
|
||||
}
|
||||
},
|
||||
pwotag(status) {
|
||||
switch (Number(status)) {
|
||||
case 1:
|
||||
return '计划中';
|
||||
break;
|
||||
case 2:
|
||||
return '已生成作业';
|
||||
break;
|
||||
case 3:
|
||||
return '已投料';
|
||||
break;
|
||||
case 4:
|
||||
return '已领料';
|
||||
break;
|
||||
case 5:
|
||||
return '已开工';
|
||||
break;
|
||||
case 6:
|
||||
return '暂停';
|
||||
break;
|
||||
case 7:
|
||||
return '已完成';
|
||||
break;
|
||||
case 8:
|
||||
return '结案';
|
||||
break;
|
||||
case 9:
|
||||
return '取消';
|
||||
break;
|
||||
case 10:
|
||||
return '待入库';
|
||||
break;
|
||||
case 11:
|
||||
return '待转出';
|
||||
break;
|
||||
case 12:
|
||||
return '已转出';
|
||||
break;
|
||||
case 13:
|
||||
return '其他';
|
||||
break;
|
||||
default:
|
||||
return '无';
|
||||
break;
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定修改该套装吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
if (_this.formData.id && _this.formData.suitCode) {
|
||||
_this.$modal.loading('提交中')
|
||||
updateMesProductSuitDetail(_this.formData).then(async res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("修改套装成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab(
|
||||
"/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else {
|
||||
_this.$modal.msg("请先输入套装编码并查询明细!")
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
129
pages/mes/pwoRecord/badRecord.vue
Normal file
129
pages/mes/pwoRecord/badRecord.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<uni-card :is-shadow="false" is-full>
|
||||
<h2 style="margin-bottom: 10px;">报工信息</h2>
|
||||
<view><strong>工单编码:</strong>{{formData.pwoCode}}</view>
|
||||
<view><strong>作业编码:</strong>{{formData.pwoJobCode}}</view>
|
||||
<view><strong>物料编码:</strong>{{formData.ptNoTar}}</view>
|
||||
<view><strong>物料名称:</strong>{{formData.ptTitleTar}}</view>
|
||||
<view><strong>物料规格:</strong>{{formData.specification1}}</view>
|
||||
<view><strong>制程:</strong>{{formData.opCode+':'+formData.opTitle}}</view>
|
||||
<view><strong>设备编码:</strong>{{formData.eqpCode}}</view>
|
||||
<view><strong>报工数量:</strong>{{formData.reportNumber}}</view>
|
||||
<view><strong>加工人员:</strong>{{formData.createByName}}</view>
|
||||
<view><strong>报工时间:</strong>{{formData.reportcreateTime}}</view>
|
||||
<h2 style="margin-top: 10px;">不良原因</h2>
|
||||
<view v-for="item in reasonOptions">
|
||||
<uni-row style="margin-top: 10px;">
|
||||
<uni-col :span="12">
|
||||
<span>{{item.defectReason}}</span>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<u-number-box button-size="36" inputWidth="120" v-model="item.number" min="0"></u-number-box>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</uni-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import {
|
||||
listMesPwoRecordrecord,
|
||||
getMesPwoRecordrecord,
|
||||
delMesPwoRecordrecord,
|
||||
addMesPwoRecordrecord,
|
||||
updateMesPwoRecordrecord
|
||||
} from "@/api/mes/mesPwoRecordrecord";
|
||||
import {
|
||||
listMesPwoRecordDetail,
|
||||
getMesPwoRecordDetail,
|
||||
delMesPwoRecordDetail,
|
||||
addMesPwoRecordDetail,
|
||||
updateMesPwoRecordDetail,
|
||||
} from "@/api/mes/mesPwoRecordDetail";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn.js";
|
||||
export default {
|
||||
onLoad: function(option) {
|
||||
getDicts("mes_pwo_record_defect_reason").then(res => {
|
||||
this.reasonOptions = res.data.map(dict => {
|
||||
return {
|
||||
defectReason: dict.dictLabel,
|
||||
number: 0,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
listEmployee().then(res => {
|
||||
this.empList = res.rows
|
||||
});
|
||||
if (option) {
|
||||
this.formData = JSON.parse(decodeURIComponent(
|
||||
option.reportForm));
|
||||
console.log(this.formData)
|
||||
// this.formData = option.badRecord
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
data() {
|
||||
return {
|
||||
empList: [],
|
||||
reasonOptions: [],
|
||||
formData: {
|
||||
pwoCode: null,
|
||||
pwoJobCode: null,
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
specification1: null,
|
||||
reportNumber: null,
|
||||
createByName: null,
|
||||
createTime: null,
|
||||
eqpCode: null,
|
||||
qualityCode: null
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.reasonOptions.filter(item => item.number > 0).map(item => {
|
||||
item.ptNoTar = this.formData.ptNoTar.split("@")[0];
|
||||
item.ptTitleTar = this.formData.ptTitleTar.split("@")[0];
|
||||
item.pwoCode = this.formData.pwoCode;
|
||||
item.opCode = this.formData.opCode;
|
||||
item.pwoJobCode = this.formData.pwoJobCode;
|
||||
item.specification1 = this.formData.specification1;
|
||||
item.eqpCode = this.formData.eqpCode;
|
||||
let obj = this.empList.find(obj => obj.name == this.formData.createByName)
|
||||
if (obj) {
|
||||
item.empCode = obj.empCode
|
||||
}
|
||||
item.dateTime = this.formData.reportcreateTime;
|
||||
return item
|
||||
})
|
||||
addMesPwoRecordrecord({
|
||||
pwoRecordName: '不良记录单',
|
||||
relOrderCode: this.formData.qualityCode
|
||||
}).then(res => {
|
||||
for (var i in this.reasonOptions) {
|
||||
this.reasonOptions[i] = JSON.stringify(this.reasonOptions[i])
|
||||
addMesPwoRecordDetail({
|
||||
pwoRecordCode: res.data.pwoRecordCode,
|
||||
pwoRecordId: res.data.id,
|
||||
dataInfo: this.reasonOptions[i]
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("新增成功!");
|
||||
}).catch(() => {});
|
||||
}
|
||||
this.$tab.navigateBack();
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
107
pages/mes/pwoRecord/badRecordList.vue
Normal file
107
pages/mes/pwoRecord/badRecordList.vue
Normal file
@@ -0,0 +1,107 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData">
|
||||
<uni-collapse-item title="不良记录单" :open="true">
|
||||
<uni-forms-item label="记录单编码" :labelWidth='90' name="pwoRecordCode">
|
||||
<uni-easyinput v-model="formData.pwoRecordCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="记录单名称" :labelWidth='90' name="pwoRecordName">
|
||||
<uni-easyinput v-model="formData.pwoRecordName" />
|
||||
</uni-forms-item>
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="不良记录单明细" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :key="index" v-for="(item, index) in formData.mesPwoRecordDetailList">
|
||||
<uni-badge :text="index+1" type="primary"></uni-badge>
|
||||
<uni-forms-item label="作业编码" :labelWidth='90'>
|
||||
<uni-easyinput disabled type="text" v-model="item.dataInfo.pwoJobCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="维修工单" :labelWidth='90'>
|
||||
<uni-easyinput disabled type="text" v-model="item.dataInfo.pwoCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="制程" :labelWidth='90'>
|
||||
<uni-easyinput disabled type="text" v-model="item.dataInfo.opCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="维修产品编码" :labelWidth='90'>
|
||||
<uni-easyinput disabled type="text" v-model="item.dataInfo.ptNoTar" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="维修产品名称" :labelWidth='90'>
|
||||
<uni-easyinput disabled type="text" v-model="item.dataInfo.ptTitleTar" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料规格" :labelWidth='90'>
|
||||
<uni-easyinput disabled type="text" v-model="item.dataInfo.specification1" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="记录人员" :labelWidth='90'>
|
||||
<uni-easyinput disabled type="text" v-model="item.dataInfo.empCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="不良原因" :labelWidth='90'>
|
||||
<uni-easyinput disabled type="text" v-model="item.dataInfo.defectReason" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="维修数量" :labelWidth='90'>
|
||||
<uni-easyinput type="number" v-model="item.dataInfo.number" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="维修时间" :labelWidth='90'>
|
||||
<uni-easyinput disabled type="text" v-model="item.dataInfo.dateTime" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备" :labelWidth='90'>
|
||||
<uni-easyinput disabled type="text" v-model="item.dataInfo.eqpCode" />
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesPwoRecordrecord,
|
||||
getMesPwoRecordrecord,
|
||||
delMesPwoRecordrecord,
|
||||
addMesPwoRecordrecord,
|
||||
updateMesPwoRecordrecord
|
||||
} from "@/api/mes/mesPwoRecordrecord";
|
||||
import {
|
||||
listMesPwoRecordDetail,
|
||||
getMesPwoRecordDetail,
|
||||
delMesPwoRecordDetail,
|
||||
addMesPwoRecordDetail,
|
||||
updateMesPwoRecordDetail,
|
||||
} from "@/api/mes/mesPwoRecordDetail";
|
||||
export default {
|
||||
onLoad(option) {
|
||||
this.formData = JSON.parse(option.formData);
|
||||
console.log(this.formData)
|
||||
},
|
||||
mounted() {},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
pwoRecordCode: null,
|
||||
pwoRecordName: null,
|
||||
mesPwoRecordDetailList: []
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
for (var i in this.formData.mesPwoRecordDetailList) {
|
||||
this.formData.mesPwoRecordDetailList[i].dataInfo = JSON.stringify(this.formData.mesPwoRecordDetailList[
|
||||
i].dataInfo);
|
||||
updateMesPwoRecordDetail(this.formData.mesPwoRecordDetailList[i]).then(res => {
|
||||
this.$modal.msgSuccess("修改成功!");
|
||||
})
|
||||
this.formData.mesPwoRecordDetailList[i].dataInfo = JSON.parse(this.formData.mesPwoRecordDetailList[
|
||||
i].dataInfo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
440
pages/mes/pwoRecord/pwoRecordAdd.vue
Normal file
440
pages/mes/pwoRecord/pwoRecordAdd.vue
Normal file
@@ -0,0 +1,440 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-collapse-item title="不良记录单新增" :open="true">
|
||||
<uni-forms-item label="记录单编码" :labelWidth='90' name="pwoRecordCode">
|
||||
<uni-easyinput v-model="formData.pwoRecordCode" type="text" disabled />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="记录单名称" :labelWidth='90' name="pwoRecordName">
|
||||
<uni-easyinput v-model="formData.pwoRecordName"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="不良原因" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item v-for="(item, index) in dataList" :key="index"
|
||||
:rightOptions="rightOptions" @click="(data) => clickDetail(index,data)">
|
||||
<uni-badge :text="index+1" type="primary"></uni-badge>
|
||||
<uni-forms-item label="作业编码" :labelWidth='90'>
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarPwoJobCode(index)"
|
||||
@confirm="confirmPwoJobCode(index)" type="text" v-model="item.pwoJobCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="维修工单" :labelWidth='90'>
|
||||
{{item.pwoCode}}
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="制程" :labelWidth='90'>
|
||||
{{item.opCode?(item.opCode+':'+item.opTitle):''}}
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="维修产品编码" :labelWidth='90'>
|
||||
{{item.ptNoTar}}
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="维修产品名称" :labelWidth='90'>
|
||||
{{item.ptTitleTar}}
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料规格" :labelWidth='90'>
|
||||
{{item.specification1}}
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="记录人员" :labelWidth='90'>
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBarEmpCode(index)"
|
||||
v-model="item.empCode" @confirm="(data) => isEmp(index,data)" />
|
||||
<uni-data-picker popup-title="请选择记录人员" :localdata="dataTree"
|
||||
@change="(e) => onchange(e, index)" @nodeclick="(e) => onnodeclick(e, index)"
|
||||
@popupopened="onpopupopened" @popupclosed="onpopupclosed" style="margin-top: 5px;"
|
||||
:preload="true">
|
||||
</uni-data-picker>
|
||||
<!-- <uni-data-select style="margin-top: 10px;" v-model="item.empCode"
|
||||
@change="(data) => selectEmp(index,data)" :localdata="empList"></uni-data-select> -->
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="不良原因" :labelWidth='90' name="defectReason">
|
||||
<uni-data-select style="margin-top: 10px;" v-model="item.defectReason"
|
||||
:localdata="reasonOptions"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="维修数量" :labelWidth='90' name="number">
|
||||
<u-number-box button-size="36" inputWidth="120" v-model="item.number"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="用时" :labelWidth='90'>
|
||||
<uni-easyinput type="number" v-model="item.timeTake" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="维修时间" :labelWidth='90'>
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="datetime" v-model="item.dateTime" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备" :labelWidth='90'>
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarEqpCode(index)"
|
||||
@confirm="(data) => isEqp(index,data)" type="text" v-model="item.eqpCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="备注" :labelWidth='90'>
|
||||
<uni-easyinput autoHeight type="textarea" v-model="item.remark"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
<button @click="handleAddDataList" size="mini" type="primary" plain="true"
|
||||
style="text-align: center;font-size: 18px;width: 50%;margin-bottom: 10px;display: block;margin-top: 10px;"
|
||||
v-if="formData.pwoRecordId">添加</button>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<uni-row :gutter="10">
|
||||
<uni-col :span="12">
|
||||
<u-button type="success" @click="savesubmit" :disabled="formData.pwoRecordId">保存</u-button>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<u-button type="primary" :disabled="!formData.pwoRecordId" @click="submit">提交</u-button>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMesPwoRecordrecord,
|
||||
getMesPwoRecordrecord,
|
||||
delMesPwoRecordrecord,
|
||||
addMesPwoRecordrecord,
|
||||
updateMesPwoRecordrecord
|
||||
} from "@/api/mes/mesPwoRecordrecord";
|
||||
import {
|
||||
listMesPwoRecordDetail,
|
||||
getMesPwoRecordDetail,
|
||||
delMesPwoRecordDetail,
|
||||
addMesPwoRecordDetail,
|
||||
updateMesPwoRecordDetail,
|
||||
} from "@/api/mes/mesPwoRecordDetail";
|
||||
import {
|
||||
listPwoJob,
|
||||
addReport,
|
||||
getEquipment,
|
||||
addReportEnterPiece,
|
||||
listEquipment
|
||||
} from "@/api/mes/jobReport.js";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn.js";
|
||||
import {
|
||||
listDepartment
|
||||
} from "@/api/basic/department";
|
||||
export default {
|
||||
onLoad: function(option) {
|
||||
getDicts("mes_pwo_record_defect_reason").then(res => {
|
||||
this.reasonOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictLabel,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
listEmployee().then((res) => {
|
||||
this.empList = res.rows
|
||||
})
|
||||
listDepartment().then((res) => {
|
||||
this.dptList = res.rows
|
||||
})
|
||||
},
|
||||
|
||||
mounted() {},
|
||||
data() {
|
||||
return {
|
||||
reasonOptions: [],
|
||||
item: '',
|
||||
dataTree: [],
|
||||
pickerData: '',
|
||||
dptList: [],
|
||||
empList: [],
|
||||
formData: {
|
||||
pwoRecordCode: null,
|
||||
pwoRecordName: '不良记录单',
|
||||
},
|
||||
dataList: [],
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
formData: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入记录单名称!'
|
||||
}]
|
||||
},
|
||||
// rulesName:{
|
||||
// rules:[{
|
||||
// required:true,
|
||||
// errorMessage: '请输入记录人员!'
|
||||
// }]
|
||||
// },
|
||||
// defectReason:{
|
||||
// rules:[{
|
||||
// required:true,
|
||||
// errorMessage: '请输入记录不良原因!'
|
||||
// }]
|
||||
// },
|
||||
// number:{
|
||||
// rules:[{
|
||||
// required:true,
|
||||
// errorMessage: '请输入数量!'
|
||||
// }]
|
||||
// },
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
selectEmp(i, e) {
|
||||
this.dataList[i].empName = this.empList.find(item => item.value == e).text
|
||||
},
|
||||
deleteDetail(index) {
|
||||
this.dataList.splice(index, 1);
|
||||
},
|
||||
clickDetail(itemIndex, {
|
||||
position,
|
||||
index
|
||||
}) {
|
||||
if (index == 0) {
|
||||
this.deleteDetail(itemIndex);
|
||||
}
|
||||
},
|
||||
onnodeclick(e, index) {
|
||||
console.log(e);
|
||||
this.item = e;
|
||||
this.onchange(this.item, index); // 传递 e 和 index 给 onchange 方法
|
||||
},
|
||||
|
||||
onpopupopened(e) {
|
||||
this.dataTree = []
|
||||
|
||||
this.empList.filter(item => item.deptId).forEach(item => {
|
||||
item.departmentTitle = this.dptList.find(item2 => item2.id == item.deptId).departmentTitle
|
||||
// 检查dataTree中是否已存在相同部门
|
||||
let existingDept = this.dataTree.find(dept => dept.value === item.deptId);
|
||||
if (existingDept) {
|
||||
// 如果已存在相同部门,则将员工信息push进该部门的children数组
|
||||
existingDept.children.push({
|
||||
text: item.name,
|
||||
value: item.empCode
|
||||
});
|
||||
} else {
|
||||
// 如果不存在相同部门,则创建一个新部门对象,包括children数组,并将员工信息push进去
|
||||
let newDept = {
|
||||
text: item.departmentTitle,
|
||||
value: item.deptId,
|
||||
children: [{
|
||||
text: item.name,
|
||||
value: item.empCode
|
||||
}]
|
||||
};
|
||||
this.dataTree.push(newDept);
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
onpopupclosed() {
|
||||
//处理不同步
|
||||
// this.$nextTick(() => {
|
||||
// this.pickerData = this.item.value;
|
||||
// this.formData.pickerData = this.item.value;
|
||||
// if (!this.item) return
|
||||
// this.onchange(this.item)
|
||||
// });
|
||||
},
|
||||
onchange(e, index) {
|
||||
console.log(e)
|
||||
this.dataList[index].empCode = null
|
||||
this.$set(this.dataList[index], 'empCode', e.value.split('/')[0]);
|
||||
},
|
||||
scanBarPwoJobCode(i) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
// _this.$set(_this.dataList[i], "pwoJobCode", res
|
||||
// .result);
|
||||
_this.dataList[i].pwoJobCode = res.result;
|
||||
_this.confirmPwoJobCode(i);
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmPwoJobCode(i) {
|
||||
listPwoJob({
|
||||
code: this.dataList[i].pwoJobCode
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.dataList[i].pwoCode = res.rows[0].pwoCode;
|
||||
this.dataList[i].opCode = res.rows[0].opCode;
|
||||
this.dataList[i].opTitle = res.rows[0].opTitle;
|
||||
this.dataList[i].ptNoTar = res.rows[0].ptNoTar.split("@")[0];
|
||||
this.dataList[i].ptTitleTar = res.rows[0].ptTitleTar.split("@")[0];
|
||||
this.dataList[i].specification1 = res.rows[0].specification1;
|
||||
if (res.rows[0].eqpId) {
|
||||
getEquipment(res.rows[0].eqpId).then(resp => {
|
||||
if (resp.data) {
|
||||
this.dataList[i].eqpCode = resp.data.equipmentCode;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarEmpCode(i) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.dataList[i].empCode = res
|
||||
.result;
|
||||
_this.isEmp(i, res
|
||||
.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
//验证是否为员工
|
||||
isEmp(i, code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(res => {
|
||||
if (res.total == 0) {
|
||||
this.$modal.msg("未查询到该员工!");
|
||||
this.dataList[i].empCode = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarEqpCode(i) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.dataList[i].eqpCode = res
|
||||
.result;
|
||||
_this.isEqp(i, res
|
||||
.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
//验证是否为设备
|
||||
isEqp(i, code) {
|
||||
listEquipment({
|
||||
equipmentCode: code
|
||||
}).then(res => {
|
||||
if (res.total == 0) {
|
||||
this.$modal.msg("未查询到该设备!");
|
||||
this.dataList[i].eqpCode = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
handleAddDataList() {
|
||||
let obj = {}
|
||||
obj.pwoJobCode = null;
|
||||
//目前仅支持合格品
|
||||
obj.pwoCode = null;
|
||||
obj.opCode = null;
|
||||
obj.opTitle = null;
|
||||
obj.ptNoTar = null;
|
||||
obj.ptTitleTar = null;
|
||||
obj.specification1 = null;
|
||||
obj.empCode = null;
|
||||
obj.empName = null;
|
||||
obj.number = null;
|
||||
obj.timeTake = null;
|
||||
obj.dateTime = null;
|
||||
obj.eqpCode = null;
|
||||
this.dataList.push(obj);
|
||||
},
|
||||
savesubmit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定新增该维修单吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
addMesPwoRecordrecord(_this.formData).then(res => {
|
||||
_this.$modal.msgSuccess("新增成功!");
|
||||
console.log(res.data)
|
||||
_this.formData.pwoRecordCode = res.data.pwoRecordCode;
|
||||
_this.formData.pwoRecordId = res.data.id
|
||||
}).catch(() => {});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
console.log(_this.dataList, this.dataTree, "dataListdataList");
|
||||
_this.dataList.forEach(item => {
|
||||
_this.dataTree.forEach(department => {
|
||||
if (department.children) {
|
||||
department.children.forEach(employee => {
|
||||
if (employee.value === item.empCode) {
|
||||
item.empName = employee.text;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定新增该维修单明细吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
let promises = [];
|
||||
|
||||
for (var i in _this.dataList) {
|
||||
if (!_this.dataList[i].pwoCode) {
|
||||
_this.$modal.msg("作业必填!");
|
||||
return;
|
||||
}
|
||||
if (!_this.dataList[i].defectReason) {
|
||||
_this.$modal.msg("不良原因必填!");
|
||||
return;
|
||||
}
|
||||
if (!_this.dataList[i].empCode) {
|
||||
_this.$modal.msg("记录人员必填!");
|
||||
return;
|
||||
}
|
||||
if (!_this.dataList[i].number) {
|
||||
_this.$modal.msg("数量必填!");
|
||||
return;
|
||||
}
|
||||
_this.formData.dataInfo = _this.dataList[i];
|
||||
_this.formData.dataInfo = JSON.stringify(_this.formData.dataInfo);
|
||||
console.log(_this.formData);
|
||||
|
||||
// 将addMesPwoRecordDetail的Promise加入数组
|
||||
promises.push(addMesPwoRecordDetail(_this.formData)
|
||||
.then(() => {
|
||||
_this.$modal.msgSuccess("新增成功!");
|
||||
})
|
||||
.catch(() => {}));
|
||||
}
|
||||
|
||||
// 等所有Promise完成后执行
|
||||
Promise.all(promises).then(() => {
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
75
pages/mine/about/index.vue
Normal file
75
pages/mine/about/index.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<view class="about-container">
|
||||
<view class="header-section text-center">
|
||||
<image style="width: 150rpx;height: 150rpx;" src="/static/logo200.png" mode="widthFix">
|
||||
</image>
|
||||
<uni-title type="h2" title="若依移动端"></uni-title>
|
||||
</view>
|
||||
|
||||
<view class="content-section">
|
||||
<view class="menu-list">
|
||||
<view class="list-cell list-cell-arrow">
|
||||
<view class="menu-item-box">
|
||||
<view>版本信息</view>
|
||||
<view class="text-right">v{{version}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow">
|
||||
<view class="menu-item-box">
|
||||
<view>官方邮箱</view>
|
||||
<view class="text-right">ruoyi@xx.com</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow">
|
||||
<view class="menu-item-box">
|
||||
<view>服务热线</view>
|
||||
<view class="text-right">400-999-9999</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow">
|
||||
<view class="menu-item-box">
|
||||
<view>公司网站</view>
|
||||
<view class="text-right">
|
||||
<uni-link :href="url" :text="url" showUnderLine="false"></uni-link>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="copyright">
|
||||
<view>Copyright © 2022 ruoyi.vip All Rights Reserved.</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
url: getApp().globalData.config.appInfo.site_url,
|
||||
version: getApp().globalData.config.appInfo.version
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
margin-top: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.header-section {
|
||||
display: flex;
|
||||
padding: 30rpx 0 0;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
662
pages/mine/avatar/index.vue
Normal file
662
pages/mine/avatar/index.vue
Normal file
@@ -0,0 +1,662 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="page-body uni-content-info">
|
||||
<view class='cropper-content'>
|
||||
<view v-if="isShowImg" class="uni-corpper"
|
||||
:style="'width:'+cropperInitW+'px;height:'+cropperInitH+'px;background:#000'">
|
||||
<view class="uni-corpper-content"
|
||||
:style="'width:'+cropperW+'px;height:'+cropperH+'px;left:'+cropperL+'px;top:'+cropperT+'px'">
|
||||
<image :src="imageSrc" :style="'width:'+cropperW+'px;height:'+cropperH+'px'"></image>
|
||||
<view class="uni-corpper-crop-box" @touchstart.stop="contentStartMove"
|
||||
@touchmove.stop="contentMoveing" @touchend.stop="contentTouchEnd"
|
||||
:style="'left:'+cutL+'px;top:'+cutT+'px;right:'+cutR+'px;bottom:'+cutB+'px'">
|
||||
<view class="uni-cropper-view-box">
|
||||
<view class="uni-cropper-dashed-h"></view>
|
||||
<view class="uni-cropper-dashed-v"></view>
|
||||
<view class="uni-cropper-line-t" data-drag="top" @touchstart.stop="dragStart"
|
||||
@touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-line-r" data-drag="right" @touchstart.stop="dragStart"
|
||||
@touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-line-b" data-drag="bottom" @touchstart.stop="dragStart"
|
||||
@touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-line-l" data-drag="left" @touchstart.stop="dragStart"
|
||||
@touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-point point-t" data-drag="top" @touchstart.stop="dragStart"
|
||||
@touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-point point-tr" data-drag="topTight"></view>
|
||||
<view class="uni-cropper-point point-r" data-drag="right" @touchstart.stop="dragStart"
|
||||
@touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-point point-rb" data-drag="rightBottom"
|
||||
@touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-point point-b" data-drag="bottom" @touchstart.stop="dragStart"
|
||||
@touchmove.stop="dragMove" @touchend.stop="dragEnd"></view>
|
||||
<view class="uni-cropper-point point-bl" data-drag="bottomLeft"></view>
|
||||
<view class="uni-cropper-point point-l" data-drag="left" @touchstart.stop="dragStart"
|
||||
@touchmove.stop="dragMove"></view>
|
||||
<view class="uni-cropper-point point-lt" data-drag="leftTop"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='cropper-config'>
|
||||
<u-button type="primary" @click="getImage" style='margin-top: 30rpx;'> 选择头像 </u-button>
|
||||
<u-button type="warning" @click="getImageInfo" style='margin-top: 30rpx;'> 提交 </u-button>
|
||||
</view>
|
||||
<canvas canvas-id="myCanvas"
|
||||
:style="'position:absolute;border: 1px solid red; width:'+imageW+'px;height:'+imageH+'px;top:-9999px;left:-9999px;'"></canvas>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from '@/config'
|
||||
import store from "@/store"
|
||||
import {
|
||||
uploadAvatar
|
||||
} from "@/api/system/user"
|
||||
|
||||
const baseUrl = config.baseUrl
|
||||
let sysInfo = uni.getSystemInfoSync()
|
||||
let SCREEN_WIDTH = sysInfo.screenWidth
|
||||
let PAGE_X, // 手按下的x位置
|
||||
PAGE_Y, // 手按下y的位置
|
||||
PR = sysInfo.pixelRatio, // dpi
|
||||
T_PAGE_X, // 手移动的时候x的位置
|
||||
T_PAGE_Y, // 手移动的时候Y的位置
|
||||
CUT_L, // 初始化拖拽元素的left值
|
||||
CUT_T, // 初始化拖拽元素的top值
|
||||
CUT_R, // 初始化拖拽元素的
|
||||
CUT_B, // 初始化拖拽元素的
|
||||
CUT_W, // 初始化拖拽元素的宽度
|
||||
CUT_H, // 初始化拖拽元素的高度
|
||||
IMG_RATIO, // 图片比例
|
||||
IMG_REAL_W, // 图片实际的宽度
|
||||
IMG_REAL_H, // 图片实际的高度
|
||||
DRAFG_MOVE_RATIO = 1, //移动时候的比例,
|
||||
INIT_DRAG_POSITION = 100, // 初始化屏幕宽度和裁剪区域的宽度之差,用于设置初始化裁剪的宽度
|
||||
DRAW_IMAGE_W = sysInfo.screenWidth // 设置生成的图片宽度
|
||||
|
||||
export default {
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data() {
|
||||
return {
|
||||
imageSrc: store.getters.avatar,
|
||||
isShowImg: false,
|
||||
// 初始化的宽高
|
||||
cropperInitW: SCREEN_WIDTH,
|
||||
cropperInitH: SCREEN_WIDTH,
|
||||
// 动态的宽高
|
||||
cropperW: SCREEN_WIDTH,
|
||||
cropperH: SCREEN_WIDTH,
|
||||
// 动态的left top值
|
||||
cropperL: 0,
|
||||
cropperT: 0,
|
||||
|
||||
transL: 0,
|
||||
transT: 0,
|
||||
|
||||
// 图片缩放值
|
||||
scaleP: 0,
|
||||
imageW: 0,
|
||||
imageH: 0,
|
||||
|
||||
// 裁剪框 宽高
|
||||
cutL: 0,
|
||||
cutT: 0,
|
||||
cutB: SCREEN_WIDTH,
|
||||
cutR: '100%',
|
||||
qualityWidth: DRAW_IMAGE_W,
|
||||
innerAspectRadio: DRAFG_MOVE_RATIO
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function() {
|
||||
this.loadImage()
|
||||
},
|
||||
methods: {
|
||||
setData: function(obj) {
|
||||
let that = this
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
that.$set(that.$data, key, obj[key])
|
||||
})
|
||||
},
|
||||
getImage: function() {
|
||||
var _this = this
|
||||
uni.chooseImage({
|
||||
success: function(res) {
|
||||
_this.setData({
|
||||
imageSrc: res.tempFilePaths[0],
|
||||
})
|
||||
_this.loadImage()
|
||||
},
|
||||
})
|
||||
},
|
||||
loadImage: function() {
|
||||
var _this = this
|
||||
|
||||
uni.getImageInfo({
|
||||
src: _this.imageSrc,
|
||||
success: function success(res) {
|
||||
IMG_RATIO = 1 / 1
|
||||
if (IMG_RATIO >= 1) {
|
||||
IMG_REAL_W = SCREEN_WIDTH
|
||||
IMG_REAL_H = SCREEN_WIDTH / IMG_RATIO
|
||||
} else {
|
||||
IMG_REAL_W = SCREEN_WIDTH * IMG_RATIO
|
||||
IMG_REAL_H = SCREEN_WIDTH
|
||||
}
|
||||
let minRange = IMG_REAL_W > IMG_REAL_H ? IMG_REAL_W : IMG_REAL_H
|
||||
INIT_DRAG_POSITION = minRange > INIT_DRAG_POSITION ? INIT_DRAG_POSITION : minRange
|
||||
// 根据图片的宽高显示不同的效果 保证图片可以正常显示
|
||||
if (IMG_RATIO >= 1) {
|
||||
let cutT = Math.ceil((SCREEN_WIDTH / IMG_RATIO - (SCREEN_WIDTH / IMG_RATIO -
|
||||
INIT_DRAG_POSITION)) / 2)
|
||||
let cutB = cutT
|
||||
let cutL = Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH + INIT_DRAG_POSITION) / 2)
|
||||
let cutR = cutL
|
||||
_this.setData({
|
||||
cropperW: SCREEN_WIDTH,
|
||||
cropperH: SCREEN_WIDTH / IMG_RATIO,
|
||||
// 初始化left right
|
||||
cropperL: Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH) / 2),
|
||||
cropperT: Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH / IMG_RATIO) / 2),
|
||||
cutL: cutL,
|
||||
cutT: cutT,
|
||||
cutR: cutR,
|
||||
cutB: cutB,
|
||||
// 图片缩放值
|
||||
imageW: IMG_REAL_W,
|
||||
imageH: IMG_REAL_H,
|
||||
scaleP: IMG_REAL_W / SCREEN_WIDTH,
|
||||
qualityWidth: DRAW_IMAGE_W,
|
||||
innerAspectRadio: IMG_RATIO
|
||||
})
|
||||
} else {
|
||||
let cutL = Math.ceil((SCREEN_WIDTH * IMG_RATIO - (SCREEN_WIDTH * IMG_RATIO)) /
|
||||
2)
|
||||
let cutR = cutL
|
||||
let cutT = Math.ceil((SCREEN_WIDTH - INIT_DRAG_POSITION) / 2)
|
||||
let cutB = cutT
|
||||
_this.setData({
|
||||
cropperW: SCREEN_WIDTH * IMG_RATIO,
|
||||
cropperH: SCREEN_WIDTH,
|
||||
// 初始化left right
|
||||
cropperL: Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH * IMG_RATIO) / 2),
|
||||
cropperT: Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH) / 2),
|
||||
|
||||
cutL: cutL,
|
||||
cutT: cutT,
|
||||
cutR: cutR,
|
||||
cutB: cutB,
|
||||
// 图片缩放值
|
||||
imageW: IMG_REAL_W,
|
||||
imageH: IMG_REAL_H,
|
||||
scaleP: IMG_REAL_W / SCREEN_WIDTH,
|
||||
qualityWidth: DRAW_IMAGE_W,
|
||||
innerAspectRadio: IMG_RATIO
|
||||
})
|
||||
}
|
||||
_this.setData({
|
||||
isShowImg: true
|
||||
})
|
||||
uni.hideLoading()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 拖动时候触发的touchStart事件
|
||||
contentStartMove(e) {
|
||||
PAGE_X = e.touches[0].pageX
|
||||
PAGE_Y = e.touches[0].pageY
|
||||
},
|
||||
|
||||
// 拖动时候触发的touchMove事件
|
||||
contentMoveing(e) {
|
||||
var _this = this
|
||||
var dragLengthX = (PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO
|
||||
var dragLengthY = (PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO
|
||||
// 左移
|
||||
if (dragLengthX > 0) {
|
||||
if (this.cutL - dragLengthX < 0) dragLengthX = this.cutL
|
||||
} else {
|
||||
if (this.cutR + dragLengthX < 0) dragLengthX = -this.cutR
|
||||
}
|
||||
|
||||
if (dragLengthY > 0) {
|
||||
if (this.cutT - dragLengthY < 0) dragLengthY = this.cutT
|
||||
} else {
|
||||
if (this.cutB + dragLengthY < 0) dragLengthY = -this.cutB
|
||||
}
|
||||
this.setData({
|
||||
cutL: this.cutL - dragLengthX,
|
||||
cutT: this.cutT - dragLengthY,
|
||||
cutR: this.cutR + dragLengthX,
|
||||
cutB: this.cutB + dragLengthY
|
||||
})
|
||||
|
||||
PAGE_X = e.touches[0].pageX
|
||||
PAGE_Y = e.touches[0].pageY
|
||||
},
|
||||
|
||||
contentTouchEnd() {
|
||||
|
||||
},
|
||||
|
||||
// 获取图片
|
||||
getImageInfo() {
|
||||
var _this = this
|
||||
uni.showLoading({
|
||||
title: '图片生成中...',
|
||||
})
|
||||
// 将图片写入画布
|
||||
const ctx = uni.createCanvasContext('myCanvas')
|
||||
ctx.drawImage(_this.imageSrc, 0, 0, IMG_REAL_W, IMG_REAL_H)
|
||||
ctx.draw(true, () => {
|
||||
// 获取画布要裁剪的位置和宽度 均为百分比 * 画布中图片的宽度 保证了在微信小程序中裁剪的图片模糊 位置不对的问题 canvasT = (_this.cutT / _this.cropperH) * (_this.imageH / pixelRatio)
|
||||
var canvasW = ((_this.cropperW - _this.cutL - _this.cutR) / _this.cropperW) * IMG_REAL_W
|
||||
var canvasH = ((_this.cropperH - _this.cutT - _this.cutB) / _this.cropperH) * IMG_REAL_H
|
||||
var canvasL = (_this.cutL / _this.cropperW) * IMG_REAL_W
|
||||
var canvasT = (_this.cutT / _this.cropperH) * IMG_REAL_H
|
||||
uni.canvasToTempFilePath({
|
||||
x: canvasL,
|
||||
y: canvasT,
|
||||
width: canvasW,
|
||||
height: canvasH,
|
||||
destWidth: canvasW,
|
||||
destHeight: canvasH,
|
||||
quality: 0.5,
|
||||
canvasId: 'myCanvas',
|
||||
success: function(res) {
|
||||
uni.hideLoading()
|
||||
let data = {
|
||||
name: 'avatarfile',
|
||||
filePath: res.tempFilePath
|
||||
}
|
||||
uploadAvatar(data).then(response => {
|
||||
store.commit('SET_AVATAR', baseUrl + response.imgUrl)
|
||||
uni.showToast({
|
||||
title: "修改成功",
|
||||
icon: 'success'
|
||||
})
|
||||
uni.navigateBack()
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 设置大小的时候触发的touchStart事件
|
||||
dragStart(e) {
|
||||
T_PAGE_X = e.touches[0].pageX
|
||||
T_PAGE_Y = e.touches[0].pageY
|
||||
CUT_L = this.cutL
|
||||
CUT_R = this.cutR
|
||||
CUT_B = this.cutB
|
||||
CUT_T = this.cutT
|
||||
},
|
||||
|
||||
// 设置大小的时候触发的touchMove事件
|
||||
dragMove(e) {
|
||||
var _this = this
|
||||
var dragType = e.target.dataset.drag
|
||||
switch (dragType) {
|
||||
case 'right':
|
||||
var dragLength = (T_PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO
|
||||
if (CUT_R + dragLength < 0) dragLength = -CUT_R
|
||||
this.setData({
|
||||
cutR: CUT_R + dragLength
|
||||
})
|
||||
break
|
||||
case 'left':
|
||||
var dragLength = (T_PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO
|
||||
if (CUT_L - dragLength < 0) dragLength = CUT_L
|
||||
if ((CUT_L - dragLength) > (this.cropperW - this.cutR)) dragLength = CUT_L - (this.cropperW - this
|
||||
.cutR)
|
||||
this.setData({
|
||||
cutL: CUT_L - dragLength
|
||||
})
|
||||
break
|
||||
case 'top':
|
||||
var dragLength = (T_PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO
|
||||
if (CUT_T - dragLength < 0) dragLength = CUT_T
|
||||
if ((CUT_T - dragLength) > (this.cropperH - this.cutB)) dragLength = CUT_T - (this.cropperH - this
|
||||
.cutB)
|
||||
this.setData({
|
||||
cutT: CUT_T - dragLength
|
||||
})
|
||||
break
|
||||
case 'bottom':
|
||||
var dragLength = (T_PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO
|
||||
if (CUT_B + dragLength < 0) dragLength = -CUT_B
|
||||
this.setData({
|
||||
cutB: CUT_B + dragLength
|
||||
})
|
||||
break
|
||||
case 'rightBottom':
|
||||
var dragLengthX = (T_PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO
|
||||
var dragLengthY = (T_PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO
|
||||
|
||||
if (CUT_B + dragLengthY < 0) dragLengthY = -CUT_B
|
||||
if (CUT_R + dragLengthX < 0) dragLengthX = -CUT_R
|
||||
let cutB = CUT_B + dragLengthY
|
||||
let cutR = CUT_R + dragLengthX
|
||||
|
||||
this.setData({
|
||||
cutB: cutB,
|
||||
cutR: cutR
|
||||
})
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* pages/uni-cropper/index.wxss */
|
||||
|
||||
.uni-content-info {
|
||||
/* position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: block;
|
||||
align-items: center;
|
||||
flex-direction: column; */
|
||||
}
|
||||
|
||||
.cropper-config {
|
||||
padding: 20rpx 40rpx;
|
||||
}
|
||||
|
||||
.cropper-content {
|
||||
min-height: 750rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uni-corpper {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-touch-callout: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.uni-corpper-content {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.uni-corpper-content image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
min-width: 0 !important;
|
||||
max-width: none !important;
|
||||
height: 100%;
|
||||
min-height: 0 !important;
|
||||
max-height: none !important;
|
||||
image-orientation: 0deg !important;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* 移动图片效果 */
|
||||
|
||||
.uni-cropper-drag-box {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
cursor: move;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* 内部的信息 */
|
||||
|
||||
.uni-corpper-crop-box {
|
||||
position: absolute;
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.uni-corpper-crop-box .uni-cropper-view-box {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: visible;
|
||||
outline: 1rpx solid #69f;
|
||||
outline-color: rgba(102, 153, 255, .75)
|
||||
}
|
||||
|
||||
/* 横向虚线 */
|
||||
|
||||
.uni-cropper-dashed-h {
|
||||
position: absolute;
|
||||
top: 33.33333333%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 33.33333333%;
|
||||
border-top: 1rpx dashed rgba(255, 255, 255, 0.5);
|
||||
border-bottom: 1rpx dashed rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
/* 纵向虚线 */
|
||||
|
||||
.uni-cropper-dashed-v {
|
||||
position: absolute;
|
||||
left: 33.33333333%;
|
||||
top: 0;
|
||||
width: 33.33333333%;
|
||||
height: 100%;
|
||||
border-left: 1rpx dashed rgba(255, 255, 255, 0.5);
|
||||
border-right: 1rpx dashed rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
/* 四个方向的线 为了之后的拖动事件*/
|
||||
|
||||
.uni-cropper-line-t {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 100%;
|
||||
background-color: #69f;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 1rpx;
|
||||
opacity: 0.1;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.uni-cropper-line-t::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0rpx;
|
||||
width: 100%;
|
||||
-webkit-transform: translate3d(0, -50%, 0);
|
||||
transform: translate3d(0, -50%, 0);
|
||||
bottom: 0;
|
||||
height: 41rpx;
|
||||
background: transparent;
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
.uni-cropper-line-r {
|
||||
position: absolute;
|
||||
display: block;
|
||||
background-color: #69f;
|
||||
top: 0;
|
||||
right: 0rpx;
|
||||
width: 1rpx;
|
||||
opacity: 0.1;
|
||||
height: 100%;
|
||||
cursor: e-resize;
|
||||
}
|
||||
|
||||
.uni-cropper-line-r::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
width: 41rpx;
|
||||
-webkit-transform: translate3d(-50%, 0, 0);
|
||||
transform: translate3d(-50%, 0, 0);
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
.uni-cropper-line-b {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 100%;
|
||||
background-color: #69f;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 1rpx;
|
||||
opacity: 0.1;
|
||||
cursor: s-resize;
|
||||
}
|
||||
|
||||
.uni-cropper-line-b::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0rpx;
|
||||
width: 100%;
|
||||
-webkit-transform: translate3d(0, -50%, 0);
|
||||
transform: translate3d(0, -50%, 0);
|
||||
bottom: 0;
|
||||
height: 41rpx;
|
||||
background: transparent;
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
.uni-cropper-line-l {
|
||||
position: absolute;
|
||||
display: block;
|
||||
background-color: #69f;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 1rpx;
|
||||
opacity: 0.1;
|
||||
height: 100%;
|
||||
cursor: w-resize;
|
||||
}
|
||||
|
||||
.uni-cropper-line-l::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
width: 41rpx;
|
||||
-webkit-transform: translate3d(-50%, 0, 0);
|
||||
transform: translate3d(-50%, 0, 0);
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
.uni-cropper-point {
|
||||
width: 5rpx;
|
||||
height: 5rpx;
|
||||
background-color: #69f;
|
||||
opacity: .75;
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.point-t {
|
||||
top: -3rpx;
|
||||
left: 50%;
|
||||
margin-left: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.point-tr {
|
||||
top: -3rpx;
|
||||
left: 100%;
|
||||
margin-left: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.point-r {
|
||||
top: 50%;
|
||||
left: 100%;
|
||||
margin-left: -3rpx;
|
||||
margin-top: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.point-rb {
|
||||
left: 100%;
|
||||
top: 100%;
|
||||
-webkit-transform: translate3d(-50%, -50%, 0);
|
||||
transform: translate3d(-50%, -50%, 0);
|
||||
cursor: n-resize;
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
background-color: #69f;
|
||||
position: absolute;
|
||||
z-index: 1112;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.point-b {
|
||||
left: 50%;
|
||||
top: 100%;
|
||||
margin-left: -3rpx;
|
||||
margin-top: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.point-bl {
|
||||
left: 0%;
|
||||
top: 100%;
|
||||
margin-left: -3rpx;
|
||||
margin-top: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.point-l {
|
||||
left: 0%;
|
||||
top: 50%;
|
||||
margin-left: -3rpx;
|
||||
margin-top: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.point-lt {
|
||||
left: 0%;
|
||||
top: 0%;
|
||||
margin-left: -3rpx;
|
||||
margin-top: -3rpx;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
/* 裁剪框预览内容 */
|
||||
|
||||
.uni-cropper-viewer {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.uni-cropper-viewer image {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
}
|
||||
</style>
|
||||
112
pages/mine/help/index.vue
Normal file
112
pages/mine/help/index.vue
Normal file
@@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<view class="help-container">
|
||||
<view v-for="(item, findex) in list" :key="findex" :title="item.title" class="list-title">
|
||||
<view class="text-title">
|
||||
<view :class="item.icon"></view>{{ item.title }}
|
||||
</view>
|
||||
<view class="childList">
|
||||
<view v-for="(child, zindex) in item.childList" :key="zindex" class="question" hover-class="hover"
|
||||
@click="handleText(child)">
|
||||
<view class="text-item">{{ child.title }}</view>
|
||||
<view class="line" v-if="zindex !== item.childList.length - 1"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [{
|
||||
icon: 'iconfont icon-github',
|
||||
title: '若依问题',
|
||||
childList: [{
|
||||
title: '若依开源吗?',
|
||||
content: '开源'
|
||||
}, {
|
||||
title: '若依可以商用吗?',
|
||||
content: '可以'
|
||||
}, {
|
||||
title: '若依官网地址多少?',
|
||||
content: 'http://ruoyi.vip'
|
||||
}, {
|
||||
title: '若依文档地址多少?',
|
||||
content: 'http://doc.ruoyi.vip'
|
||||
}]
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-help',
|
||||
title: '其他问题',
|
||||
childList: [{
|
||||
title: '如何退出登录?',
|
||||
content: '请点击[我的] - [应用设置] - [退出登录]即可退出登录',
|
||||
}, {
|
||||
title: '如何修改用户头像?',
|
||||
content: '请点击[我的] - [选择头像] - [点击提交]即可更换用户头像',
|
||||
}, {
|
||||
title: '如何修改登录密码?',
|
||||
content: '请点击[我的] - [应用设置] - [修改密码]即可修改登录密码',
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleText(item) {
|
||||
this.$tab.navigateTo(`/pages/common/textview/index?title=${item.title}&content=${item.content}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.help-container {
|
||||
margin-bottom: 100rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.list-title {
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.childList {
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 0px 10rpx rgba(193, 193, 193, 0.2);
|
||||
border-radius: 16rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.text-title {
|
||||
color: #303133;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-left: 10rpx;
|
||||
|
||||
.iconfont {
|
||||
font-size: 16px;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.text-item {
|
||||
font-size: 28rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.question {
|
||||
color: #606266;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
</style>
|
||||
211
pages/mine/index.vue
Normal file
211
pages/mine/index.vue
Normal file
@@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<view class="mine-container" :style="{height: `${windowHeight}px`}">
|
||||
<!--顶部个人信息栏-->
|
||||
<view class="header-section">
|
||||
<view class="flex padding justify-between">
|
||||
<view class="flex align-center">
|
||||
<view v-if="!avatar" class="cu-avatar xl round bg-white">
|
||||
<view class="iconfont icon-people text-gray icon"></view>
|
||||
</view>
|
||||
<image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round"
|
||||
mode="widthFix">
|
||||
</image>
|
||||
<view v-if="!name" @click="handleToLogin" class="login-tip">
|
||||
点击登录
|
||||
</view>
|
||||
<view v-if="name" @click="handleToInfo" class="user-info">
|
||||
<view class="u_title">
|
||||
用户名:{{ name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="handleToInfo" class="flex align-center">
|
||||
<text>个人信息</text>
|
||||
<view class="iconfont icon-right"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="content-section">
|
||||
<view class="mine-actions grid col-4 text-center">
|
||||
<view class="action-item" @click="handleJiaoLiuQun">
|
||||
<view class="iconfont icon-friendfill text-pink icon"></view>
|
||||
<text class="text">交流群</text>
|
||||
</view>
|
||||
<view class="action-item" @click="handleBuilding">
|
||||
<view class="iconfont icon-service text-blue icon"></view>
|
||||
<text class="text">在线客服</text>
|
||||
</view>
|
||||
<view class="action-item" @click="handleBuilding">
|
||||
<view class="iconfont icon-community text-mauve icon"></view>
|
||||
<text class="text">反馈社区</text>
|
||||
</view>
|
||||
<view class="action-item" @click="handleBuilding">
|
||||
<view class="iconfont icon-dianzan text-green icon"></view>
|
||||
<text class="text">点赞我们</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="menu-list">
|
||||
<view class="list-cell list-cell-arrow" @click="handleToEditInfo">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-user menu-icon"></view>
|
||||
<view>编辑资料</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow" @click="handleHelp">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-help menu-icon"></view>
|
||||
<view>常见问题</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow" @click="handleAbout">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-aixin menu-icon"></view>
|
||||
<view>关于我们</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow" @click="handleToSetting">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-setting menu-icon"></view>
|
||||
<view>应用设置</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import storage from '@/utils/storage'
|
||||
import {
|
||||
checkPermi,
|
||||
checkRole
|
||||
} from "@/utils/permission";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
name: this.$store.state.user.name,
|
||||
version: getApp().globalData.config.appInfo.version
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
avatar() {
|
||||
return this.$store.state.user.avatar
|
||||
},
|
||||
windowHeight() {
|
||||
return uni.getSystemInfoSync().windowHeight - 50
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
// checkPermi().then(res => {
|
||||
// console.log(res)
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
checkPermi,
|
||||
handleToInfo() {
|
||||
this.$tab.navigateTo('/pages/mine/info/index')
|
||||
},
|
||||
handleToEditInfo() {
|
||||
this.$tab.navigateTo('/pages/mine/info/edit')
|
||||
},
|
||||
handleToSetting() {
|
||||
this.$tab.navigateTo('/pages/mine/setting/index')
|
||||
},
|
||||
handleToLogin() {
|
||||
this.$tab.reLaunch('/pages/login')
|
||||
},
|
||||
handleToAvatar() {
|
||||
this.$tab.navigateTo('/pages/mine/avatar/index')
|
||||
},
|
||||
handleLogout() {
|
||||
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
this.$tab.reLaunch('/pages/index')
|
||||
})
|
||||
})
|
||||
},
|
||||
handleHelp() {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
// this.$tab.navigateTo('/pages/mine/help/index')
|
||||
},
|
||||
handleAbout() {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
// this.$tab.navigateTo('/pages/mine/about/index')
|
||||
},
|
||||
handleJiaoLiuQun() {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
},
|
||||
handleBuilding() {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f5f6f7;
|
||||
}
|
||||
|
||||
.mine-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
|
||||
.header-section {
|
||||
padding: 15px 15px 45px 15px;
|
||||
background-image: linear-gradient(to right, #2396C4, #0F6C8E);
|
||||
color: white;
|
||||
|
||||
.login-tip {
|
||||
font-size: 18px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.cu-avatar {
|
||||
border: 2px solid #eaeaea;
|
||||
|
||||
.icon {
|
||||
font-size: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.user-info {
|
||||
margin-left: 15px;
|
||||
|
||||
.u_title {
|
||||
font-size: 18px;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content-section {
|
||||
position: relative;
|
||||
top: -50px;
|
||||
|
||||
.mine-actions {
|
||||
margin: 15px 15px;
|
||||
padding: 20px 0px;
|
||||
border-radius: 8px;
|
||||
background-color: white;
|
||||
|
||||
.action-item {
|
||||
.icon {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.text {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
margin: 8px 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
127
pages/mine/info/edit.vue
Normal file
127
pages/mine/info/edit.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="example">
|
||||
<uni-forms ref="form" :model="user" labelWidth="80px">
|
||||
<uni-forms-item label="用户昵称" name="nickName">
|
||||
<uni-easyinput v-model="user.nickName" placeholder="请输入昵称" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="手机号码" name="phonenumber">
|
||||
<uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="邮箱" name="email">
|
||||
<uni-easyinput v-model="user.email" placeholder="请输入邮箱" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="性别" name="sex" required>
|
||||
<uni-data-checkbox v-model="user.sex" :localdata="sexs" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserProfile } from "@/api/system/user"
|
||||
import { updateUserProfile } from "@/api/system/user"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: {
|
||||
nickName: "",
|
||||
phonenumber: "",
|
||||
email: "",
|
||||
sex: ""
|
||||
},
|
||||
sexs: [{
|
||||
text: '男',
|
||||
value: "0"
|
||||
}, {
|
||||
text: '女',
|
||||
value: "1"
|
||||
}],
|
||||
rules: {
|
||||
nickName: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '用户昵称不能为空'
|
||||
}]
|
||||
},
|
||||
phonenumber: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '手机号码不能为空'
|
||||
}, {
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
errorMessage: '请输入正确的手机号码'
|
||||
}]
|
||||
},
|
||||
email: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '邮箱地址不能为空'
|
||||
}, {
|
||||
format: 'email',
|
||||
errorMessage: '请输入正确的邮箱地址'
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getUser()
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.form.setRules(this.rules)
|
||||
},
|
||||
methods: {
|
||||
getUser() {
|
||||
getUserProfile().then(response => {
|
||||
this.user = response.data
|
||||
})
|
||||
},
|
||||
submit(ref) {
|
||||
this.$refs.form.validate().then(res => {
|
||||
updateUserProfile(this.user).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.example {
|
||||
padding: 15px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.segmented-control {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.button-group {
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
44
pages/mine/info/index.vue
Normal file
44
pages/mine/info/index.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<uni-list>
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.nickName" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.phonenumber" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="postGroup" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="roleGroup" />
|
||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="user.createTime" />
|
||||
</uni-list>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserProfile } from "@/api/system/user"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: {},
|
||||
roleGroup: "",
|
||||
postGroup: ""
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getUser()
|
||||
},
|
||||
methods: {
|
||||
getUser() {
|
||||
getUserProfile().then(response => {
|
||||
this.user = response.data
|
||||
this.roleGroup = response.roleGroup
|
||||
this.postGroup = response.postGroup
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
85
pages/mine/pwd/index.vue
Normal file
85
pages/mine/pwd/index.vue
Normal file
@@ -0,0 +1,85 @@
|
||||
<template>
|
||||
<view class="pwd-retrieve-container">
|
||||
<uni-forms ref="form" :value="user" labelWidth="80px">
|
||||
<uni-forms-item name="oldPassword" label="旧密码">
|
||||
<uni-easyinput type="password" v-model="user.oldPassword" placeholder="请输入旧密码" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item name="newPassword" label="新密码">
|
||||
<uni-easyinput type="password" v-model="user.newPassword" placeholder="请输入新密码" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item name="confirmPassword" label="确认密码">
|
||||
<uni-easyinput type="password" v-model="user.confirmPassword" placeholder="请确认新密码" />
|
||||
</uni-forms-item>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</uni-forms>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateUserPwd } from "@/api/system/user"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: {
|
||||
oldPassword: undefined,
|
||||
newPassword: undefined,
|
||||
confirmPassword: undefined
|
||||
},
|
||||
rules: {
|
||||
oldPassword: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '旧密码不能为空'
|
||||
}]
|
||||
},
|
||||
newPassword: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '新密码不能为空',
|
||||
},
|
||||
{
|
||||
minLength: 6,
|
||||
maxLength: 20,
|
||||
errorMessage: '长度在 6 到 20 个字符'
|
||||
}
|
||||
]
|
||||
},
|
||||
confirmPassword: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '确认密码不能为空'
|
||||
}, {
|
||||
validateFunction: (rule, value, data) => data.newPassword === value,
|
||||
errorMessage: '两次输入的密码不一致'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.form.setRules(this.rules)
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.pwd-retrieve-container {
|
||||
padding-top: 36rpx;
|
||||
padding: 15px;
|
||||
}
|
||||
</style>
|
||||
113
pages/mine/setting/index.vue
Normal file
113
pages/mine/setting/index.vue
Normal file
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<view class="setting-container" :style="{height: `${windowHeight}px`}">
|
||||
<view class="menu-list">
|
||||
<view class="list-cell list-cell-arrow" @click="handleToPwd">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-password menu-icon"></view>
|
||||
<view>修改密码</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow" @click="handleToUpgrade">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-refresh menu-icon"></view>
|
||||
<view>检查更新</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow" @click="handleBaseUrl">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-refresh menu-icon"></view>
|
||||
<view>配置服务器地址</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-cell list-cell-arrow" @click="handleCleanTmp">
|
||||
<view class="menu-item-box">
|
||||
<view class="iconfont icon-clean menu-icon"></view>
|
||||
<view>清理缓存</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-list menu">
|
||||
<view class="cu-item item-box">
|
||||
<view class="content text-center" @click="handleLogout">
|
||||
<text class="text-black">退出登录</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-popup ref="popup" type="dialog">
|
||||
<uni-popup-dialog mode="input" message="成功消息" :duration="2000" :before-close="true" @close="close" @confirm="confirm">
|
||||
<uni-easyinput type="text" v-model="baseUrl" placeholder="请输入服务器地址" />
|
||||
<!-- <uni-easyinput type="text" v-model="wmsUrl" placeholder="请输入WMS服务器地址" /> -->
|
||||
</uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// baseUrl: getApp().globalData.config.baseUrl,
|
||||
baseUrl: uni.getStorageSync('base_url'),
|
||||
// wmsUrl: uni.getStorageSync('wms_url'),
|
||||
windowHeight: uni.getSystemInfoSync().windowHeight
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleToPwd() {
|
||||
this.$tab.navigateTo('/pages/mine/pwd/index')
|
||||
},
|
||||
handleToUpgrade() {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
},
|
||||
handleCleanTmp() {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
},
|
||||
handleLogout() {
|
||||
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
this.$tab.reLaunch('/pages/index')
|
||||
})
|
||||
})
|
||||
},
|
||||
handleBaseUrl(){
|
||||
this.$refs.popup.open()
|
||||
},
|
||||
close() {
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
confirm() {
|
||||
// 输入框的值
|
||||
uni.setStorage({
|
||||
key: 'base_url',
|
||||
data: this.baseUrl
|
||||
})
|
||||
// uni.setStorage({
|
||||
// key: 'wms_url',
|
||||
// data: this.wmsUrl
|
||||
// })
|
||||
// TODO 做一些其他的事情,手动执行 close 才会关闭对话框
|
||||
// ...
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.item-box {
|
||||
background-color: #FFFFFF;
|
||||
margin: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 10rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #303133;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
</style>
|
||||
326
pages/qc/fqc.vue
Normal file
326
pages/qc/fqc.vue
Normal file
@@ -0,0 +1,326 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-collapse-item title="生产入库检单" :open="true">
|
||||
<uni-forms-item label="来源单" :labelWidth='90' name="sourceCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarSourceCode"
|
||||
v-model="formData.sourceCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检单" :labelWidth='90' name="qualityCode">
|
||||
<uni-combox-re labelKey="qualityCode" valueKey="id" :candidates="qualityCodeList" emptyTips="无"
|
||||
@input="scanBarCode" v-model="formData.qualityCode"></uni-combox-re>
|
||||
<!-- <uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.qualityCode" type="text" /> -->
|
||||
</uni-forms-item>
|
||||
|
||||
<uni-forms-item label="仓库编码" :labelWidth='90' name="warehouseCode">
|
||||
<uni-easyinput type="text" v-model="formData.warehouseCode" />
|
||||
</uni-forms-item>
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="生产入库检单明细" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
v-for="(item, index) in formData.qcQualityBillDetailList"
|
||||
@click="(data) => clickDetail(index,data)" @change="swipChange">
|
||||
<view>
|
||||
<uni-badge :text="index+1" class="uni-badge-left-margin" type="primary"></uni-badge>
|
||||
<button @click="open(index)" size="mini" type="primary">编辑</button>
|
||||
</view>
|
||||
<uni-forms-item label="物料编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.materialCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="制程编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.opCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.opCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料批号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialBatchNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialBatchNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料箱号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialLotNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialLotNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检员" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'qualityBy'">
|
||||
<uni-easyinput disabled type="text" v-model="item.qualityBy" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检方案编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityTypeCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar3"
|
||||
v-model="item.qualityTypeCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检标准编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityStandardCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar4(index)"
|
||||
v-model="item.qualityStandardCode" />
|
||||
</uni-forms-item>
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="计划质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.planNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.planNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="实收数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.actualNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.actualNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.number'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.number"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检合格数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.passNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.passNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-forms-item label="质检不通过原因" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.failReason'">
|
||||
<uni-easyinput type="textarea" v-model="item.failReason" />
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listQualityBill,
|
||||
addQualityBill,
|
||||
getQualityBill,
|
||||
updateQualityBill,
|
||||
listQualityBillByBatchNo,
|
||||
getStandardList,
|
||||
listStandardList
|
||||
} from "@/api/qc/qc.js";
|
||||
import {
|
||||
listPwoJob
|
||||
} from "@/api/mes/jobReport.js"
|
||||
import uniComboxRe from "../../uni_modules/uni-combox/components/uni-combox/uni-combox-re.vue"
|
||||
export default {
|
||||
mounted() {
|
||||
listStandardList().then(async res => {
|
||||
this.StandardList = res.rows;
|
||||
})
|
||||
},
|
||||
components: {
|
||||
uniComboxRe
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
sourceCode: null,
|
||||
qualityCode: null,
|
||||
warehouseCode: null,
|
||||
qcQualityBillDetailList: [],
|
||||
},
|
||||
qualityCodeList: [],
|
||||
StandardList: null,
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
sourceCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入来源单!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
otherFun(object) {
|
||||
console.log(object)
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).number = object.number;
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).passNumber = object.passNumber;
|
||||
},
|
||||
open(index) {
|
||||
let qscid = null;
|
||||
if (this.formData.qcQualityBillDetailList[index].qualityStandardCode && this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode != "") {
|
||||
const result = this.StandardList.find(item => item.qualityStandardCode == this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
if (result !== undefined) {
|
||||
// 找到了匹配项,进行后续逻辑
|
||||
qscid = result.id
|
||||
let did = this.formData.qcQualityBillDetailList[index].id;
|
||||
let mbn = this.formData.qcQualityBillDetailList[index].materialBatchNo;
|
||||
let mc = this.formData.qcQualityBillDetailList[index].materialCode;
|
||||
|
||||
console.log(qscid + ' ' + mbn + ' ' + mc);
|
||||
uni.navigateTo({
|
||||
url: '/pages/qc/updateStandardList?qscid=' + qscid +
|
||||
'&materialBatchNo=' + mbn +
|
||||
'&materialCode=' + mc +
|
||||
'&did=' + did
|
||||
});
|
||||
} else {
|
||||
console.log(result)
|
||||
this.$modal.msg("未检索到该质检标准编码相关信息!");
|
||||
}
|
||||
} else {
|
||||
this.$modal.msg("请输入质检标准编码!");
|
||||
}
|
||||
},
|
||||
test() {},
|
||||
change(e) {
|
||||
console.log('当前模式:' + e.type + ',状态:' + e.show);
|
||||
},
|
||||
scanBarCode(e) {
|
||||
if (e) {
|
||||
//查询质检单明细
|
||||
getQualityBill(e).then(async response => {
|
||||
this.formData = response.data;
|
||||
this.formData.qcQualityBillDetailList =
|
||||
response.data.qcQualityBillDetailList.map((item) => {
|
||||
item.qualityStandardCode = this.StandardList.find(i =>
|
||||
i.id == item.qualityStandardCode)
|
||||
.qualityStandardCode
|
||||
item.qualityTypeCode = Number(item.qualityTypeCode);
|
||||
return item;
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBarSourceCode() {
|
||||
if (this.formData.sourceCode && this.formData.sourceCode != "") {
|
||||
let q = {
|
||||
sourceCode: this.formData.sourceCode
|
||||
}
|
||||
listQualityBill(q).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.qualityCodeList = res.rows;
|
||||
console.log(this.qualityCodeList)
|
||||
} else {
|
||||
this.$modal.msg("未检索到该来源单相关信息!");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
//质检单
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qualityCode = res.result;
|
||||
_this.scanBarCode(_this.formData.qualityCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//来源单
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.sourceCode = res.result;
|
||||
_this.scanBarSourceCode(_this.formData.sourceCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//仓库编码
|
||||
scanBar2() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.warehouseCode = res.result;
|
||||
_this.scanBarCode(_this.formData.warehouseCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检方案编码
|
||||
scanBar3() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[0].qualityTypeCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[0].qualityTypeCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检标准编码
|
||||
scanBar4(index) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[index].qualityStandardCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该质检吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
for (var i in _this.formData.qcQualityBillDetailList) {
|
||||
if (_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode && _this.formData.qcQualityBillDetailList[
|
||||
i].qualityStandardCode != "") {
|
||||
//查询质检标准编码的id
|
||||
const res = _this.StandardList.find(item => item
|
||||
.qualityStandardCode == _this.formData
|
||||
.qcQualityBillDetailList[i].qualityStandardCode);
|
||||
if (res !== undefined) {
|
||||
_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode = res.id;
|
||||
} else {
|
||||
_this.$modal.msg("请填写正确的质检标准编码!");
|
||||
}
|
||||
} else {
|
||||
_this.formData.qcQualityBillDetailList[i].qualityStandardCode =
|
||||
null;
|
||||
}
|
||||
}
|
||||
_this.$modal.loading('提交中')
|
||||
updateQualityBill(_this.formData).then(async res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("检验成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
463
pages/qc/ipqc.vue
Normal file
463
pages/qc/ipqc.vue
Normal file
@@ -0,0 +1,463 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-collapse-item title="生产过程检单" :open="true">
|
||||
<uni-forms-item label="来源单" :labelWidth='90' name="sourceCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarSourceCode"
|
||||
v-model="formData.sourceCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检单" :labelWidth='90' name="qualityCode">
|
||||
<uni-combox-re labelKey="qualityCode" valueKey="id" :candidates="qualityCodeList" emptyTips="无"
|
||||
@input="scanBarCode" v-model="formData.qualityCode"></uni-combox-re>
|
||||
<!-- <uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.qualityCode" type="text" /> -->
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="单据类型" :labelWidth='90' name="type">
|
||||
<uni-tag :text="formData.typeText" type="success"></uni-tag>
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="仓库编码" :labelWidth='90' name="warehouseCode">
|
||||
<uni-easyinput type="text" v-model="formData.warehouseCode" />
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="工单" :labelWidth='90' name="pwoCode">
|
||||
{{formData.pwoCode}}
|
||||
<!-- <uni-easyinput type="text" v-model="formData.warehouseCode" /> -->
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料编码" :labelWidth='90' name="ptNoTar">
|
||||
{{formData.ptNoTar}}
|
||||
<!-- <uni-easyinput type="text" v-model="formData.warehouseCode" /> -->
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='90' name="ptTitleTar">
|
||||
{{formData.ptTitleTar}}
|
||||
<!-- <uni-easyinput type="text" v-model="formData.warehouseCode" /> -->
|
||||
</uni-forms-item>
|
||||
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="生产过程检单明细" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
v-for="(item, index) in formData.qcQualityBillDetailList"
|
||||
@click="(data) => clickDetail(index,data)" @change="swipChange">
|
||||
<view>
|
||||
<uni-badge :text="index+1" class="uni-badge-left-margin" type="primary"></uni-badge>
|
||||
<button @click="open(index)" size="mini" type="primary">编辑</button>
|
||||
</view>
|
||||
<uni-forms-item label="物料编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.materialCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.materialName'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialName"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料规格" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.specification1'">
|
||||
<uni-easyinput type="text" disabled v-model="item.specification1"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="制程编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.opCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.opCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料批号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialBatchNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialBatchNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料箱号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialLotNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialLotNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检员" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'qualityBy'">
|
||||
<!-- <uni-easyinput type="text" v-model="item.qualityBy" suffixIcon="scan"
|
||||
@iconClick="scanBarqualityBy" /> -->
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBarqualityBy"
|
||||
v-model="item.qualityBy" @confirm="(data) => isEmp(index,data)" />
|
||||
<uni-data-select style="margin-top: 10px;" v-model="item.qualityBy" :localdata="empList"
|
||||
@change="qualityByChange"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="质检方案编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityTypeCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar3"
|
||||
v-model="item.qualityTypeCode" />
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="质检标准编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityStandardCode'">
|
||||
<uni-easyinput type="text" disabled
|
||||
v-model="item.qualityStandardCode+':'+item.qualityStandardName" />
|
||||
</uni-forms-item>
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="计划质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.planNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.planNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="实收数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.actualNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.actualNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.number'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.number"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检合格数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.passNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.passNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-forms-item label="质检不通过原因" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.failReason'">
|
||||
<uni-easyinput type="textarea" v-model="item.failReason" />
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
<uni-forms-item label="失败自动补单" :labelWidth='100' name="failRemake" style="margin-top: 10px;">
|
||||
<u-switch v-model="formData.failRemake" activeColor="#5AC725" inactiveColor="#ff4949"
|
||||
style="float: left;"></u-switch>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="检验结果" :labelWidth='90' name="result" style="margin-top: 10px;">
|
||||
<uni-data-select v-model="formData.result" :localdata="resultOptions"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-collapse>
|
||||
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listQualityBill,
|
||||
addQualityBill,
|
||||
getQualityBill,
|
||||
updateQualityBill,
|
||||
listQualityBillByBatchNo,
|
||||
getStandardList,
|
||||
listStandardList
|
||||
} from "@/api/qc/qc.js";
|
||||
import {
|
||||
listPwoJob
|
||||
} from "../../api/mes/jobReport";
|
||||
import {
|
||||
listPwo
|
||||
} from "../../api/mes/pwoDraw";
|
||||
import uniComboxRe from "../../uni_modules/uni-combox/components/uni-combox/uni-combox-re.vue"
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn.js";
|
||||
export default {
|
||||
mounted() {
|
||||
listStandardList().then(async res => {
|
||||
this.StandardList = res.rows;
|
||||
})
|
||||
getDicts("qc_bill_result").then(res => {
|
||||
this.resultOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
getDicts("qc_bill_type").then(res => {
|
||||
this.typeOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
});
|
||||
listEmployee().then((res) => {
|
||||
this.empList = res.rows.map(item => {
|
||||
let obj = {
|
||||
text: item.name,
|
||||
value: item.empCode
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
components: {
|
||||
uniComboxRe
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
empList: [],
|
||||
resultOptions: [],
|
||||
typeOptions: [],
|
||||
formData: {
|
||||
qualityCode: null,
|
||||
warehouseCode: null,
|
||||
qcQualityBillDetailList: [],
|
||||
ptNoTar: null,
|
||||
ptTitleTar: null,
|
||||
typeText: null
|
||||
},
|
||||
qualityCodeList: [],
|
||||
StandardList: null,
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
sourceCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入来源单!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
qualityByChange(e) {
|
||||
console.log(e)
|
||||
this.formData.qualityBy = e;
|
||||
},
|
||||
//验证是否为员工
|
||||
isEmp(i, code) {
|
||||
listEmployee({
|
||||
empCode: code
|
||||
}).then(res => {
|
||||
if (res.total == 0) {
|
||||
this.$modal.msg("未查询到该员工!");
|
||||
this.formData.qcQualityBillDetailList[i].qualityBy = null;
|
||||
this.formData.qualityBy = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
otherFun(object) {
|
||||
console.log(object)
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).number = object.number;
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).passNumber = object.passNumber;
|
||||
},
|
||||
open(index) {
|
||||
let qscid = null;
|
||||
if (this.formData.qcQualityBillDetailList[index].qualityStandardCode && this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode != "") {
|
||||
const result = this.StandardList.find(item => item.qualityStandardCode == this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
if (result !== undefined) {
|
||||
console.log(result)
|
||||
// 找到了匹配项,进行后续逻辑
|
||||
qscid = result.id
|
||||
let did = this.formData.qcQualityBillDetailList[index].id;
|
||||
let mbn = this.formData.qcQualityBillDetailList[index].materialBatchNo;
|
||||
let mc = this.formData.qcQualityBillDetailList[index].materialCode;
|
||||
let mn = this.formData.qcQualityBillDetailList[index].materialName || '';
|
||||
let sp = this.formData.qcQualityBillDetailList[index].specification1 || '';
|
||||
let billId = this.formData.id;
|
||||
let number = this.formData.qcQualityBillDetailList[index].number;
|
||||
console.log(qscid + ' ' + mbn + ' ' + mc);
|
||||
uni.navigateTo({
|
||||
url: '/pages/qc/updateStandardList?qscid=' + qscid +
|
||||
'&materialBatchNo=' + mbn +
|
||||
'&materialCode=' + mc +
|
||||
'&materialName=' + mn +
|
||||
'&specification1=' + sp +
|
||||
'&number=' + number +
|
||||
'&did=' + did +
|
||||
'&billId=' + billId
|
||||
});
|
||||
} else {
|
||||
console.log(result)
|
||||
this.$modal.msg("未检索到该质检标准编码相关信息!");
|
||||
}
|
||||
} else {
|
||||
this.$modal.msg("请输入质检标准编码!");
|
||||
}
|
||||
},
|
||||
test() {},
|
||||
change(e) {
|
||||
console.log('当前模式:' + e.type + ',状态:' + e.show);
|
||||
},
|
||||
scanBarCode(e) {
|
||||
if (e) {
|
||||
//查询质检单明细
|
||||
getQualityBill(e).then(async response => {
|
||||
response.data.typeText = this.typeOptions.find(i =>
|
||||
i.value == response.data.type
|
||||
).text
|
||||
this.formData = {
|
||||
...this.formData,
|
||||
...response.data
|
||||
}
|
||||
this.formData.qcQualityBillDetailList =
|
||||
response.data.qcQualityBillDetailList.map((item) => {
|
||||
item.qualityStandardCode = this.StandardList.find(i =>
|
||||
i.id == item.qualityStandardCode)
|
||||
.qualityStandardCode
|
||||
item.qualityStandardName = this.StandardList.find(i =>
|
||||
i.id == item.qualityStandardCode)
|
||||
.qualityStandardName
|
||||
item.qualityTypeCode = Number(item.qualityTypeCode);
|
||||
return item;
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBarSourceCode() {
|
||||
if (this.formData.sourceCode && this.formData.sourceCode != "") {
|
||||
let q = {
|
||||
sourceCode: this.formData.sourceCode
|
||||
}
|
||||
listQualityBill(q).then(async res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.qualityCodeList = res.rows;
|
||||
console.log(this.qualityCodeList)
|
||||
} else {
|
||||
this.$modal.msg("未检索到该来源单相关信息!");
|
||||
}
|
||||
});
|
||||
listPwoJob({
|
||||
code: this.formData.sourceCode
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.pwoCode = res.rows[0].pwoCode
|
||||
listPwo({
|
||||
pwoCode: this.formData.pwoCode
|
||||
}).then(resp => {
|
||||
if (resp.rows.length > 0) {
|
||||
this.formData.ptNoTar = resp.rows[0].ptNoTar;
|
||||
this.formData.ptTitleTar = resp.rows[0].ptTitleTar;
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//质检单
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qualityCode = res.result;
|
||||
_this.scanBarCode(_this.formData.qualityCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//来源单
|
||||
scanBar1() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.sourceCode = res.result;
|
||||
_this.scanBarSourceCode(_this.formData.sourceCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//仓库编码
|
||||
scanBar2() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.warehouseCode = res.result;
|
||||
// _this.scanBarCode(_this.formData.warehouseCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检方案编码
|
||||
scanBar3() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[0].qualityTypeCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[0].qualityTypeCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检标准编码
|
||||
scanBar4(index) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[index].qualityStandardCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检员扫码
|
||||
scanBarqualityBy(index) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[index].qualityBy = res.result;
|
||||
_this.formData.qualityBy = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该质检吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
for (var i in _this.formData.qcQualityBillDetailList) {
|
||||
if (_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode && _this.formData.qcQualityBillDetailList[
|
||||
i].qualityStandardCode != "") {
|
||||
//查询质检标准编码的id
|
||||
const res = _this.StandardList.find(item => item
|
||||
.qualityStandardCode == _this.formData
|
||||
.qcQualityBillDetailList[i].qualityStandardCode);
|
||||
if (res !== undefined) {
|
||||
_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode = res.id;
|
||||
} else {
|
||||
_this.$modal.msg("请填写正确的质检标准编码!");
|
||||
}
|
||||
} else {
|
||||
_this.formData.qcQualityBillDetailList[i].qualityStandardCode =
|
||||
null;
|
||||
}
|
||||
}
|
||||
_this.$modal.loading('提交中')
|
||||
console.log(_this.formData)
|
||||
updateQualityBill(_this.formData).then(async res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("检验成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
300
pages/qc/iqc.vue
Normal file
300
pages/qc/iqc.vue
Normal file
@@ -0,0 +1,300 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-collapse-item title="采购入库检单" :open="true">
|
||||
<uni-forms-item label="质检单" :labelWidth='90' name="qualityCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.qualityCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="来源单" :labelWidth='90' name="sourceCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarCode" v-model="formData.sourceCode" type="text" />
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="仓库编码" :labelWidth='90' name="warehouseCode">
|
||||
<uni-easyinput type="text" v-model="formData.warehouseCode" />
|
||||
</uni-forms-item>
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="采购入库检单明细" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
v-for="(item, index) in formData.qcQualityBillDetailList"
|
||||
@click="(data) => clickDetail(index,data)" @change="swipChange">
|
||||
<view>
|
||||
<uni-badge :text="index+1" class="uni-badge-left-margin" type="primary"></uni-badge>
|
||||
<button @click="open(index)" size="mini" type="primary">编辑</button>
|
||||
</view>
|
||||
<uni-forms-item label="物料编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.materialCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="制程编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.opCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.opCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料批号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialBatchNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialBatchNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料箱号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialLotNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialLotNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检员" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'qualityBy'">
|
||||
<uni-easyinput disabled type="text" v-model="item.qualityBy" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检方案编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityTypeCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar3"
|
||||
v-model="item.qualityTypeCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检标准编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityStandardCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar4(index)"
|
||||
v-model="item.qualityStandardCode" />
|
||||
</uni-forms-item>
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="计划质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.planNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.planNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="实收数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.actualNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.actualNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.number'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.number"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检合格数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.passNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.passNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-forms-item label="质检不通过原因" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.failReason'">
|
||||
<uni-easyinput type="textarea" v-model="item.failReason" />
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listQualityBill,
|
||||
addQualityBill,
|
||||
getQualityBill,
|
||||
updateQualityBill,
|
||||
listQualityBillByBatchNo,
|
||||
getStandardList,
|
||||
listStandardList
|
||||
} from "@/api/qc/qc.js";
|
||||
export default {
|
||||
mounted() {
|
||||
listStandardList().then(async res => {
|
||||
this.StandardList = res.rows;
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
qualityCode: null,
|
||||
warehouseCode: null,
|
||||
qcQualityBillDetailList: [],
|
||||
},
|
||||
StandardList: null,
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
qualityCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入质检单!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
otherFun(object) {
|
||||
console.log(object)
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).number = object.number;
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).passNumber = object.passNumber;
|
||||
},
|
||||
open(index) {
|
||||
let qscid = null;
|
||||
if (this.formData.qcQualityBillDetailList[index].qualityStandardCode && this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode != "") {
|
||||
const result = this.StandardList.find(item => item.qualityStandardCode == this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
if (result !== undefined) {
|
||||
// 找到了匹配项,进行后续逻辑
|
||||
qscid = result.id
|
||||
let did = this.formData.qcQualityBillDetailList[index].id;
|
||||
let mbn = this.formData.qcQualityBillDetailList[index].materialBatchNo;
|
||||
let mc = this.formData.qcQualityBillDetailList[index].materialCode;
|
||||
|
||||
console.log(qscid + ' ' + mbn + ' ' + mc);
|
||||
uni.navigateTo({
|
||||
url: '/pages/qc/updateStandardList?qscid=' + qscid +
|
||||
'&materialBatchNo=' + mbn +
|
||||
'&materialCode=' + mc +
|
||||
'&did=' + did
|
||||
});
|
||||
} else {
|
||||
console.log(result)
|
||||
this.$modal.msg("未检索到该质检标准编码相关信息!");
|
||||
}
|
||||
} else {
|
||||
this.$modal.msg("请输入质检标准编码!");
|
||||
}
|
||||
},
|
||||
test() {},
|
||||
change(e) {
|
||||
console.log('当前模式:' + e.type + ',状态:' + e.show);
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.qualityCode && this.formData.qualityCode != "") {
|
||||
let q = {
|
||||
qualityCode: this.formData.qualityCode,
|
||||
}
|
||||
listQualityBill(q).then(async res => {
|
||||
console.log(res);
|
||||
if (res.rows != null && res.rows.length > 0) {
|
||||
let did = res.rows[0].id
|
||||
//查询质检单明细
|
||||
getQualityBill(did).then(async response => {
|
||||
this.formData = response.data;
|
||||
this.formData.qcQualityBillDetailList =
|
||||
response.data.qcQualityBillDetailList.map((item) => {
|
||||
item.qualityStandardCode = this.StandardList.find(i =>
|
||||
i.id == item.qualityStandardCode)
|
||||
.qualityStandardCode
|
||||
item.qualityTypeCode = Number(item.qualityTypeCode);
|
||||
return item;
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("未检索到该质检单相关信息!");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("请输入质检单!");
|
||||
}
|
||||
},
|
||||
//质检单
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qualityCode = res.result;
|
||||
_this.scanBarCode(_this.formData.qualityCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//仓库编码
|
||||
scanBar2() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.warehouseCode = res.result;
|
||||
_this.scanBarCode(_this.formData.warehouseCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检方案编码
|
||||
scanBar3() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[0].qualityTypeCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[0].qualityTypeCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检标准编码
|
||||
scanBar4(index) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[index].qualityStandardCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该质检吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
for (var i in _this.formData.qcQualityBillDetailList) {
|
||||
if (_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode && _this.formData.qcQualityBillDetailList[
|
||||
i].qualityStandardCode != "") {
|
||||
//查询质检标准编码的id
|
||||
const res = _this.StandardList.find(item => item
|
||||
.qualityStandardCode == _this.formData
|
||||
.qcQualityBillDetailList[i].qualityStandardCode);
|
||||
if (res !== undefined) {
|
||||
_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode = res.id;
|
||||
} else {
|
||||
_this.$modal.msg("请填写正确的质检标准编码!");
|
||||
}
|
||||
} else {
|
||||
_this.formData.qcQualityBillDetailList[i].qualityStandardCode =
|
||||
null;
|
||||
}
|
||||
}
|
||||
_this.$modal.loading('提交中')
|
||||
updateQualityBill(_this.formData).then(async res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("检验成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
227
pages/qc/opqc.vue
Normal file
227
pages/qc/opqc.vue
Normal file
@@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData">
|
||||
<uni-forms-item label="作业编码" :labelWidth='90' name="sourceCode">
|
||||
<uni-easyinput v-model="formData.sourceCode" suffixIcon="scan" @iconClick="scanBarSourceCode"
|
||||
@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 statusOptions" :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 qcList" :key="index" is-full>
|
||||
<view><strong>制程</strong> : {{item.opTitle}}</view>
|
||||
<view><strong>物料编码</strong> : {{item.ptNoTar}}</view>
|
||||
<view><strong>物料名称</strong> : {{item.ptTitleTar}}</view>
|
||||
<view><strong>质检结果</strong> : {{item.result}}</view>
|
||||
<uni-row>
|
||||
<uni-col :span="18">
|
||||
<view><strong>物料规格</strong> : {{item.specification1}}</view>
|
||||
<view><strong>报工数量</strong> : {{item.reportNumber}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<u-button type="primary" @click="badRecordList(item)" style="font-size: 14px;"
|
||||
v-if="item.isRecord">不良记录</u-button>
|
||||
<u-button type="primary" @click="badRecordForm(item)"
|
||||
style="font-size: 14px;margin-top: 10px;" v-else>不良记录新增</u-button>
|
||||
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row>
|
||||
<uni-col :span="18">
|
||||
<view><strong>加工人员</strong> : {{item.createByName}}</view>
|
||||
<view><strong>报工时间</strong> :{{item.reportcreateTime}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6"> <u-button type="success" @click="handleFinish(item)"
|
||||
style="font-size: 14px;margin-top: 10px;">通过</u-button></uni-col>
|
||||
</uni-row>
|
||||
</uni-card>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import {
|
||||
listQualityBill,
|
||||
addQualityBill,
|
||||
getQualityBill,
|
||||
updateQualityBill,
|
||||
listQualityBillByBatchNo,
|
||||
getStandardList,
|
||||
listStandardList
|
||||
} from "@/api/qc/qc.js";
|
||||
import {
|
||||
listPwoJob,
|
||||
addReport,
|
||||
getEquipment,
|
||||
addReportEnterPiece,
|
||||
listEquipment
|
||||
} from "@/api/mes/jobReport.js";
|
||||
import {
|
||||
listMesPwoRecordrecord,
|
||||
getMesPwoRecordrecord,
|
||||
delMesPwoRecordrecord,
|
||||
addMesPwoRecordrecord,
|
||||
updateMesPwoRecordrecord
|
||||
} from "@/api/mes/mesPwoRecordrecord";
|
||||
import {
|
||||
listMesPwoRecordDetail,
|
||||
getMesPwoRecordDetail,
|
||||
delMesPwoRecordDetail,
|
||||
addMesPwoRecordDetail,
|
||||
updateMesPwoRecordDetail,
|
||||
} from "@/api/mes/mesPwoRecordDetail";
|
||||
export default {
|
||||
mounted() {
|
||||
getDicts("qc_bill_status").then(res => {
|
||||
this.statusOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
getDicts("qc_bill_result").then(res => {
|
||||
this.resultOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
listMesPwoRecordrecord().then(resp => {
|
||||
this.recordList = resp.rows
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
recordList: [],
|
||||
statusOptions: [],
|
||||
resultOptions: [],
|
||||
qcList: [],
|
||||
formData: {
|
||||
sourceCode: null,
|
||||
status: "0",
|
||||
type: 3
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
badRecordList(item) {
|
||||
listMesPwoRecordrecord({
|
||||
relOrderCode: item.qualityCode
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
listMesPwoRecordDetail({
|
||||
pwoRecordId: res.rows[0].id
|
||||
}).then(response => {
|
||||
console.log(response)
|
||||
let mesPwoRecordDetailList = response.rows.map((obj) => {
|
||||
obj.dataInfo = JSON.parse(obj.dataInfo);
|
||||
return obj;
|
||||
});
|
||||
console.log(mesPwoRecordDetailList)
|
||||
let obj = {
|
||||
pwoRecordName: res.rows[0].pwoRecordName,
|
||||
pwoRecordCode: res.rows[0].pwoRecordCode,
|
||||
mesPwoRecordDetailList: mesPwoRecordDetailList
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/mes/pwoRecord/badRecordList?formData=' +
|
||||
encodeURIComponent(
|
||||
JSON.stringify(obj))
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("未查询到记录单相关信息!")
|
||||
}
|
||||
})
|
||||
},
|
||||
badRecordForm(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/mes/pwoRecord/badRecord?reportForm=' +
|
||||
encodeURIComponent(
|
||||
JSON.stringify(item))
|
||||
});
|
||||
},
|
||||
scanBarSourceCode(code) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.sourceCode = res.result;
|
||||
_this.submit()
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
listQualityBill(this.formData).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
res.rows.map(item => {
|
||||
let obj = this.recordList.find(r => r.relOrderCode == item.qualityCode)
|
||||
if (obj) {
|
||||
item.isRecord = true
|
||||
} else {
|
||||
item.isRecord = false
|
||||
}
|
||||
item.additionalJson = JSON.parse(item.additionalJson);
|
||||
item.ptNoTar = item.additionalJson.ptNoTar;
|
||||
item.opTitle = item.additionalJson.opTitle;
|
||||
item.ptTitleTar = item.additionalJson.ptTitleTar;
|
||||
item.specification1 = item.additionalJson.specification1;
|
||||
item.reportNumber = item.additionalJson.reportNumber;
|
||||
item.createByName = item.additionalJson.createByName;
|
||||
item.reportcreateTime = item.additionalJson.createTime;
|
||||
item.pwoCode = item.additionalJson.pwoCode;
|
||||
item.pwoJobCode = item.additionalJson.pwoJobCode;
|
||||
item.reportId = item.additionalJson.id;
|
||||
item.eqpCode = item.additionalJson.machineId;
|
||||
item.opCode = item.additionalJson.opCode;
|
||||
return item
|
||||
})
|
||||
console.log(res.rows)
|
||||
this.qcList = res.rows;
|
||||
console.log(this.qcList)
|
||||
} else {
|
||||
this.$modal.msg("未查询到相关信息,请重新输入!")
|
||||
this.formData.sourceCode = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
handleFinish(item) {
|
||||
let obj = this.resultOptions.find(i => i.text == '通过')
|
||||
if (obj) {
|
||||
item.additionalJson = JSON.stringify(item.additionalJson)
|
||||
item.result = obj.value
|
||||
getQualityBill(item.id).then(res => {
|
||||
item.qcQualityBillDetailList = res.data.qcQualityBillDetailList
|
||||
updateQualityBill(item).then(res => {
|
||||
this.$modal.msgSuccess("修改成功!");
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.text {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
300
pages/qc/oqc.vue
Normal file
300
pages/qc/oqc.vue
Normal file
@@ -0,0 +1,300 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-collapse-item title="销售出库检单" :open="true">
|
||||
<uni-forms-item label="质检单" :labelWidth='90' name="qualityCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" @confirm="scanBarCode"
|
||||
v-model="formData.qualityCode" type="text" />
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="来源单" :labelWidth='90' name="sourceCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" @confirm="scanBarCode" v-model="formData.sourceCode" type="text" />
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="仓库编码" :labelWidth='90' name="warehouseCode">
|
||||
<uni-easyinput type="text" v-model="formData.warehouseCode" />
|
||||
</uni-forms-item>
|
||||
</uni-collapse-item>
|
||||
<uni-collapse-item title="销售出库检单明细" :open="true">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
|
||||
v-for="(item, index) in formData.qcQualityBillDetailList"
|
||||
@click="(data) => clickDetail(index,data)" @change="swipChange">
|
||||
<view>
|
||||
<uni-badge :text="index+1" class="uni-badge-left-margin" type="primary"></uni-badge>
|
||||
<button @click="open(index)" size="mini" type="primary">编辑</button>
|
||||
</view>
|
||||
<uni-forms-item label="物料编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.materialCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="制程编码" :labelWidth='80'
|
||||
:name="'qcQualityBillDetailList.'+ index +'.opCode'">
|
||||
<uni-easyinput type="text" disabled v-model="item.opCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料批号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialBatchNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialBatchNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料箱号" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.materialLotNo'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialLotNo" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检员" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'qualityBy'">
|
||||
<uni-easyinput disabled type="text" v-model="item.qualityBy" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检方案编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityTypeCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar3"
|
||||
v-model="item.qualityTypeCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="质检标准编码" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.qualityStandardCode'">
|
||||
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanBar4(index)"
|
||||
v-model="item.qualityStandardCode" />
|
||||
</uni-forms-item>
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="计划质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.planNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.planNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="实收数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.actualNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.actualNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.number'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.number"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检合格数量" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.passNumber'">
|
||||
<u-number-box inputWidth="120" button-size="36" v-model="item.passNumber"
|
||||
min="0"></u-number-box>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-forms-item label="质检不通过原因" :labelWidth='80'
|
||||
name="'qcQualityBillDetailList.'+ index +'.failReason'">
|
||||
<uni-easyinput type="textarea" v-model="item.failReason" />
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listQualityBill,
|
||||
addQualityBill,
|
||||
getQualityBill,
|
||||
updateQualityBill,
|
||||
listQualityBillByBatchNo,
|
||||
getStandardList,
|
||||
listStandardList
|
||||
} from "@/api/qc/qc.js";
|
||||
export default {
|
||||
mounted() {
|
||||
listStandardList().then(async res => {
|
||||
this.StandardList = res.rows;
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
qualityCode: null,
|
||||
warehouseCode: null,
|
||||
qcQualityBillDetailList: [],
|
||||
},
|
||||
StandardList: null,
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
rules: {
|
||||
qualityCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入质检单!'
|
||||
}]
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
otherFun(object) {
|
||||
console.log(object)
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).number = object.number;
|
||||
this.formData.qcQualityBillDetailList.find(item => item.id == object.did).passNumber = object.passNumber;
|
||||
},
|
||||
open(index) {
|
||||
let qscid = null;
|
||||
if (this.formData.qcQualityBillDetailList[index].qualityStandardCode && this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode != "") {
|
||||
const result = this.StandardList.find(item => item.qualityStandardCode == this.formData
|
||||
.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
if (result !== undefined) {
|
||||
// 找到了匹配项,进行后续逻辑
|
||||
qscid = result.id
|
||||
let did = this.formData.qcQualityBillDetailList[index].id;
|
||||
let mbn = this.formData.qcQualityBillDetailList[index].materialBatchNo;
|
||||
let mc = this.formData.qcQualityBillDetailList[index].materialCode;
|
||||
|
||||
console.log(qscid + ' ' + mbn + ' ' + mc);
|
||||
uni.navigateTo({
|
||||
url: '/pages/qc/updateStandardList?qscid=' + qscid +
|
||||
'&materialBatchNo=' + mbn +
|
||||
'&materialCode=' + mc +
|
||||
'&did=' + did
|
||||
});
|
||||
} else {
|
||||
console.log(result)
|
||||
this.$modal.msg("未检索到该质检标准编码相关信息!");
|
||||
}
|
||||
} else {
|
||||
this.$modal.msg("请输入质检标准编码!");
|
||||
}
|
||||
},
|
||||
test() {},
|
||||
change(e) {
|
||||
console.log('当前模式:' + e.type + ',状态:' + e.show);
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.qualityCode && this.formData.qualityCode != "") {
|
||||
let q = {
|
||||
qualityCode: this.formData.qualityCode
|
||||
}
|
||||
listQualityBill(q).then(async res => {
|
||||
console.log(res);
|
||||
if (res.rows != null && res.rows.length > 0) {
|
||||
let did = res.rows[0].id
|
||||
//查询质检单明细
|
||||
getQualityBill(did).then(async response => {
|
||||
this.formData = response.data;
|
||||
this.formData.qcQualityBillDetailList =
|
||||
response.data.qcQualityBillDetailList.map((item) => {
|
||||
item.qualityStandardCode = this.StandardList.find(i =>
|
||||
i.id == item.qualityStandardCode)
|
||||
.qualityStandardCode
|
||||
item.qualityTypeCode = Number(item.qualityTypeCode);
|
||||
return item;
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("未检索到该质检单相关信息!");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$modal.msg("请输入质检单!");
|
||||
}
|
||||
},
|
||||
//质检单
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qualityCode = res.result;
|
||||
_this.scanBarCode(_this.formData.qualityCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//仓库编码
|
||||
scanBar2() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.warehouseCode = res.result;
|
||||
_this.scanBarCode(_this.formData.warehouseCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检方案编码
|
||||
scanBar3() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[0].qualityTypeCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[0].qualityTypeCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
//质检标准编码
|
||||
scanBar4(index) {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qcQualityBillDetailList[index].qualityStandardCode = res.result;
|
||||
_this.scanBarCode(_this.qcQualityBillDetailList[index].qualityStandardCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const _this = this;
|
||||
_this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定完成该质检吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
for (var i in _this.formData.qcQualityBillDetailList) {
|
||||
if (_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode && _this.formData.qcQualityBillDetailList[
|
||||
i].qualityStandardCode != "") {
|
||||
//查询质检标准编码的id
|
||||
const res = _this.StandardList.find(item => item
|
||||
.qualityStandardCode == _this.formData
|
||||
.qcQualityBillDetailList[i].qualityStandardCode);
|
||||
if (res !== undefined) {
|
||||
_this.formData.qcQualityBillDetailList[i]
|
||||
.qualityStandardCode = res.id;
|
||||
} else {
|
||||
_this.$modal.msg("请填写正确的质检标准编码!");
|
||||
}
|
||||
} else {
|
||||
_this.formData.qcQualityBillDetailList[i].qualityStandardCode =
|
||||
null;
|
||||
}
|
||||
}
|
||||
_this.$modal.loading('提交中')
|
||||
updateQualityBill(_this.formData).then(async res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("检验成功!");
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
338
pages/qc/qcAdd.vue
Normal file
338
pages/qc/qcAdd.vue
Normal file
@@ -0,0 +1,338 @@
|
||||
<template>
|
||||
<view style="background-color: #fff;">
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<uni-row>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="作业编码" :labelWidth='80' name="sourceCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" v-model="formData.sourceCode"
|
||||
@confirm="scanBarCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<!-- <uni-col :span="24">
|
||||
<uni-forms-item label="工单" :labelWidth='80' name="pwoCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.pwoCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col> -->
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="物料编码" :labelWidth='80' name="materialCode">
|
||||
<uni-easyinput disabled type="text" v-model="formData.qcQualityBillDetailList.materialCode" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="物料名称" :labelWidth='80' name="materialName">
|
||||
<uni-easyinput disabled type="text" v-model="formData.qcQualityBillDetailList.materialName" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="制程编码" :labelWidth='80' name="opCode">
|
||||
<uni-easyinput type="text" v-model="formData.qcQualityBillDetailList.opCode" />
|
||||
<uni-data-select v-model="formData.qcQualityBillDetailList.opCode" :localdata="pPbomOptions" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检类型" :labelWidth='80' name="type">
|
||||
<uni-data-select v-model="formData.type" :localdata="typeOptions" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检标准" :labelWidth='80' name="qualityStandardCode">
|
||||
<uni-data-select v-model="formData.qcQualityBillDetailList.qualityStandardCode"
|
||||
:localdata="standardOptions" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="实收数量" :labelWidth='80' name="actualNumber">
|
||||
<uni-easyinput type="number" v-model="formData.qcQualityBillDetailList.actualNumber" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="质检数量" :labelWidth='80' name="number">
|
||||
<uni-easyinput type="number" v-model="formData.qcQualityBillDetailList.number" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="" :labelWidth='80'>
|
||||
<uni-data-checkbox v-model="radio" multiple :localdata="qcchecked" @change="qcAllCheck"
|
||||
style="transform:scale(1.4);"></uni-data-checkbox>
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="24">
|
||||
<uni-forms-item label="质检员" :labelWidth='90' name="qualityBy">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarQualityBy" @confirm="confirmQualityBy"
|
||||
v-model="formData.qualityBy" type="text" style="margin-bottom: 5px;" />
|
||||
<uni-data-select v-model="formData.qualityBy" :localdata="empList" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listQualityBill,
|
||||
addQualityBill,
|
||||
getQualityBill,
|
||||
updateQualityBill,
|
||||
listQualityBillByBatchNo,
|
||||
getStandardList,
|
||||
listStandardList,
|
||||
listStandardApply
|
||||
} from "@/api/qc/qc.js";
|
||||
import {
|
||||
listPwoJob
|
||||
} from "@/api/mes/jobReport.js"
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import {
|
||||
listPbom
|
||||
} from "@/api/qc/ppom";
|
||||
import {
|
||||
listEmployee
|
||||
} from "@/api/mes/jobIn";
|
||||
export default {
|
||||
mounted() {
|
||||
getDicts("qc_bill_type").then(res => {
|
||||
this.typeOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
listEmployee().then((res) => {
|
||||
this.empList = res.rows.map(item => {
|
||||
return {
|
||||
text: item.empCode + ':' + item.name,
|
||||
value: item.empCode,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
empList: [],
|
||||
radio: [],
|
||||
qcchecked: [{
|
||||
text: '全选',
|
||||
value: 0
|
||||
}],
|
||||
typeOptions: [],
|
||||
pPbomOptions: [],
|
||||
standardOptions: [],
|
||||
formData: {
|
||||
qcQualityBillDetailList: {
|
||||
qualityBy: null,
|
||||
materialCode: null,
|
||||
materialName: null,
|
||||
qualityStandardCode: null,
|
||||
opCode: null,
|
||||
actualNumber: null,
|
||||
number: null,
|
||||
},
|
||||
type: null,
|
||||
pwoCode: null,
|
||||
sourceCode: null,
|
||||
qualityBy: null
|
||||
},
|
||||
rules: {
|
||||
pwoJobCode: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请输入作业编码!'
|
||||
}]
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'formData.qcQualityBillDetailList.materialCode': {
|
||||
handler: function(newVal, oldVal) {
|
||||
if (newVal != null) {
|
||||
this.selectStandardOptions();
|
||||
}
|
||||
}
|
||||
},
|
||||
'formData.qcQualityBillDetailList.opCode': {
|
||||
handler: function(newVal, oldVal) {
|
||||
if (newVal != null) {
|
||||
this.selectStandardOptions();
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
'formData.type': {
|
||||
handler: function(newVal, oldVal) {
|
||||
if (newVal != null) {
|
||||
this.selectStandardOptions();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
scanBarQualityBy() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.qualityBy = res.result;
|
||||
_this.formData.qcQualityBillDetailList.qualityBy = res.result;
|
||||
_this.confirmQualityBy()
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmQualityBy() {
|
||||
listEmployee({
|
||||
empCode: this.formData.qualityBy
|
||||
}).then(async res => {
|
||||
if (res.rows.length == 0) {
|
||||
this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
this.formData.qualityBy = null;
|
||||
this.formData.qcQualityBillDetailList.qualityBy = null;
|
||||
}
|
||||
})
|
||||
},
|
||||
qcAllCheck(e) {
|
||||
if (e.detail.data.length > 0) {
|
||||
this.formData.qcQualityBillDetailList.number = this.formData.qcQualityBillDetailList
|
||||
.actualNumber
|
||||
} else {
|
||||
this.formData.qcQualityBillDetailList.number = null;
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
this.formData.qcQualityBillDetailList.qualityBy = this.formData.qualityBy
|
||||
this.formData.qcQualityBillDetailList = [this.formData.qcQualityBillDetailList]
|
||||
if (this.formData && this.formData.qcQualityBillDetailList.length > 0) {
|
||||
//默认新建质检单结果为通过,状态为新建
|
||||
this.formData.status = '0'
|
||||
// this.qcform.result = '1'
|
||||
console.log(this.formData)
|
||||
this.$modal.loading('提交中')
|
||||
addQualityBill(this.formData).then(res => {
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgSuccess("创建成功!");
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
} else {
|
||||
this.$message.error("请输入明细!");
|
||||
}
|
||||
})
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.formData.sourceCode) {
|
||||
listPwoJob({
|
||||
code: this.formData.sourceCode
|
||||
}).then(async res => {
|
||||
let jobs = res.rows;
|
||||
if (jobs.length == 0) {
|
||||
this.$modal.msg("未检索到该作业编码相关的信息!");
|
||||
} else {
|
||||
let pwoJob = jobs[0];
|
||||
// 根据物料编码找制程
|
||||
this.selectMaterial(pwoJob.ptNoTar);
|
||||
// 添加明细
|
||||
this.formData.qcQualityBillDetailList.materialCode = pwoJob.ptNoTar;
|
||||
this.formData.qcQualityBillDetailList.materialName = pwoJob.ptTitleTar;
|
||||
this.formData.qcQualityBillDetailList.materialBatchNo = pwoJob.batchNo;
|
||||
this.formData.qcQualityBillDetailList.materialLotNo = pwoJob.lotNo;
|
||||
this.formData.qcQualityBillDetailList.opCode = pwoJob.opCode;
|
||||
this.formData.qcQualityBillDetailList.planNumber = pwoJob.targetNum;
|
||||
this.formData.qcQualityBillDetailList.qualityTypeCode = "";
|
||||
this.formData.qcQualityBillDetailList.qualityBy = "";
|
||||
this.formData.qcQualityBillDetailList.qualityStandardCode = "";
|
||||
this.formData.qcQualityBillDetailList.planNumber = 0;
|
||||
this.formData.qcQualityBillDetailList.actualNumber = pwoJob.targetNum;
|
||||
this.formData.qcQualityBillDetailList.number = 0;
|
||||
this.formData.qcQualityBillDetailList.unitId = "";
|
||||
this.formData.qcQualityBillDetailList.secondActualNumber = "";
|
||||
this.formData.qcQualityBillDetailList.secondNumber = "";
|
||||
this.formData.qcQualityBillDetailList.secondUnit = "";
|
||||
this.formData.qcQualityBillDetailList.passNumber = 0;
|
||||
this.formData.qcQualityBillDetailList.passUnit = "";
|
||||
this.formData.qcQualityBillDetailList.secondPassNumber = "";
|
||||
this.formData.qcQualityBillDetailList.secondPassUnit = "";
|
||||
this.formData.qcQualityBillDetailList.failReason = "";
|
||||
this.formData.qcQualityBillDetailList.enclosure = "";
|
||||
this.formData.qcQualityBillDetailList.remark = "";
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
selectMaterial(materialCode) {
|
||||
let ppbom = {};
|
||||
ppbom.concatPnCode = materialCode;
|
||||
ppbom.filterSearch = true;
|
||||
if (ppbom.concatPnCode != "" && ppbom.concatPnCode) {
|
||||
listPbom(ppbom).then((response) => {
|
||||
|
||||
this.pPbomOptions = response.rows.map(item => {
|
||||
item.text = item.opCode + ":" + item.opTitle;
|
||||
item.value = item.opCode;
|
||||
return item
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
selectStandardOptions() {
|
||||
let materialCode = this.formData.qcQualityBillDetailList.materialCode;
|
||||
let opCode = this.formData.qcQualityBillDetailList.opCode;
|
||||
let type = this.formData.type;
|
||||
let standardOptions = [];
|
||||
if (materialCode != "" && materialCode && opCode != "" && opCode && type != "" && type) {
|
||||
listStandardList().then((res) => {
|
||||
standardOptions = res.rows;
|
||||
});
|
||||
let mt = null;
|
||||
if (materialCode.includes('@')) {
|
||||
mt = materialCode.split('@')[0];
|
||||
}
|
||||
listStandardApply({
|
||||
materialCode: mt,
|
||||
opCode: opCode,
|
||||
billType: type
|
||||
}).then((response) => {
|
||||
console.log(response)
|
||||
if (response.total > 0) {
|
||||
let array = response.rows.map(item => ({
|
||||
id: item.qualityStandardId
|
||||
}))
|
||||
array.forEach(aitem => {
|
||||
standardOptions.forEach(sitem => {
|
||||
if (sitem.id == aitem.id) {
|
||||
sitem.text = sitem.qualityStandardCode +
|
||||
":" + sitem.qualityStandardName;
|
||||
sitem.value = sitem.qualityStandardCode;
|
||||
this.standardOptions.push(sitem)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
console.log(this.standardOptions)
|
||||
}
|
||||
// this.pPbomOptions = response.rows;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.sourceCode = res.result;
|
||||
_this.scanBarCode(_this.formData.sourceCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user