初始化仓库
This commit is contained in:
172
pages/tpm/checkTask.vue
Normal file
172
pages/tpm/checkTask.vue
Normal file
@@ -0,0 +1,172 @@
|
||||
<template>
|
||||
<view>
|
||||
<view>
|
||||
<uni-easyinput suffixIcon="scan" placeholder="请输入设备编码" @iconClick="scanBar"
|
||||
v-model="queryParams.equipmentCode" type="text" @confirm="scanBarCode" />
|
||||
<button type="primary" @click="reset"
|
||||
style="margin-top: 5px;text-align: center;display: block;width: 30%;">重置</button>
|
||||
<view class="cu-card article ">
|
||||
<view class="cu-item shadow borderBottom" v-for="(item,index) in list" :key="index">
|
||||
<view class="title">
|
||||
<view class="text-cut">任务名 : {{item.taskName}}</view>
|
||||
<view>
|
||||
<button type="primary" size="mini" @click="detail(item)" style="float: right;">查看明细</button>
|
||||
|
||||
</view>
|
||||
<view>
|
||||
<button type="success" size="mini"
|
||||
style="float: right;margin-right: 10px;background-color: #5AC725;color: #fff;"
|
||||
@click="handleFinish(item)">完成</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="desc">
|
||||
<view class="text-content">
|
||||
<view>明细号 : {{item.taskItemCode}}</view>
|
||||
<view>明细名 : {{item.taskItemName}}</view>
|
||||
<view>状态 : <uni-tag :text="tagText(item.status)" type="primary"
|
||||
v-if="item.status"></uni-tag></view>
|
||||
<view>设备编码 : {{item.equipmentCode}}</view>
|
||||
<view>时间 : {{item.createTime}}</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listCheckTaskItem,
|
||||
getCheckTaskItem
|
||||
} from "@/api/tpm/index.js";
|
||||
import {
|
||||
listTaskItem,
|
||||
getTaskItem,
|
||||
delTaskItem,
|
||||
addTaskItem,
|
||||
updateTaskItem,
|
||||
finishCheckTaskItem,
|
||||
finishCheckTaskItemDetail,
|
||||
repairCheckTaskItemDetail,
|
||||
tpmCheckTaskEditemOnly,
|
||||
listEmployee
|
||||
} from "@/api/tpm/checkTaskItem";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
import {
|
||||
getUserProfile
|
||||
} from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
this.getList()
|
||||
getDicts("tpm_task_status").then(res => {
|
||||
this.taskStatusOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
console.log(this.$store)
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: {},
|
||||
queryParams: {
|
||||
equipmentCode: null,
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
orderByColumn: "id",
|
||||
isAsc: "desc",
|
||||
},
|
||||
formData: {},
|
||||
taskStatusOptions: [],
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tagText(status) {
|
||||
let obj = this.taskStatusOptions.find(item => item.value == status)
|
||||
if (obj !== undefined) {
|
||||
return this.taskStatusOptions.find(item => item.value == status).text
|
||||
}
|
||||
},
|
||||
async handleFinish(item) {
|
||||
try {
|
||||
console.log("1234");
|
||||
// 获取用户ID
|
||||
let useId = null;
|
||||
const res = await listEmployee({"name": this.$store.state.user.name});
|
||||
console.log(res,"res1")
|
||||
|
||||
if (res && res.rows && res.rows.length > 0) {
|
||||
useId = res.rows[0]["id"] ?? null;
|
||||
}
|
||||
|
||||
// if (useId) {
|
||||
// 调用 tpmCheckTaskEditemOnly 方法
|
||||
const verifierRes = await tpmCheckTaskEditemOnly({verifierId: useId, id: item.id});
|
||||
console.log(verifierRes, "verifierRes");
|
||||
|
||||
// 调用 finishCheckTaskItem 方法
|
||||
const finishRes = await finishCheckTaskItem([item.id]);
|
||||
this.$modal.msgSuccess("完成成功!");
|
||||
this.getList();
|
||||
// } else {
|
||||
// console.log("无")
|
||||
// // this.$modal.msgError("没有找到该员工!");
|
||||
// }
|
||||
} catch (error) {
|
||||
// console.error("Error in handleFinish:", error);
|
||||
// this.$modal.msgError("操作失败,请稍后重试!");
|
||||
}
|
||||
},
|
||||
|
||||
getList() {
|
||||
listCheckTaskItem(this.queryParams).then(response => {
|
||||
this.list = response.rows;
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.queryParams.equipmentCode = null;
|
||||
this.getList();
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.queryParams.equipmentCode) {
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.queryParams.equipmentCode = res.result;
|
||||
_this.scanBarCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
detail(item) {
|
||||
getCheckTaskItem(item.id).then(async res => {
|
||||
this.$tab.navigateTo('/pages/tpm/checkTaskItem?formData=' + JSON.stringify(res.data));
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
136
pages/tpm/checkTaskItem.vue
Normal file
136
pages/tpm/checkTaskItem.vue
Normal file
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData">
|
||||
<uni-collapse-item title="点检任务明细单" :open="true">
|
||||
<uni-forms-item label="任务名" :labelWidth='90' name="taskName">
|
||||
<uni-easyinput disabled v-model="formData.taskName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="明细号" :labelWidth='90' name="taskItemCode">
|
||||
<uni-easyinput disabled v-model="formData.taskItemCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="明细名" :labelWidth='90' name="taskItemName">
|
||||
<uni-easyinput disabled v-model="formData.taskItemName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput disabled v-model="formData.equipmentCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="检查人ID" :labelWidth='90' name="verifierId">
|
||||
<uni-easyinput disabled v-model="formData.verifierId" />
|
||||
</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.tpmEquipmentCheckTaskItemDetailList">
|
||||
<uni-badge :text="index+1" type="primary"></uni-badge>
|
||||
<uni-forms-item label="项目编码" :labelWidth='90'
|
||||
:name="'tpmEquipmentCheckTaskItemDetailList.'+ index +'.detailCode'">
|
||||
<uni-easyinput disabled type="text" disabled v-model="item.detailCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="项目名称" :labelWidth='90'
|
||||
:name="'tpmEquipmentCheckTaskItemDetailList.'+ index +'.detailName'">
|
||||
<uni-easyinput disabled type="text" disabled v-model="item.detailName"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="点检标准" :labelWidth='90'
|
||||
name="'tpmEquipmentCheckTaskItemDetailList.'+ index +'.standard'">
|
||||
<uni-easyinput disabled type="text" v-model="item.standard" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="点检结果" :labelWidth='90'
|
||||
name="'tpmEquipmentCheckTaskItemDetailList.'+ index +'.result'">
|
||||
<uni-easyinput disabled type="text" v-model="item.result" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="状态" :labelWidth='90'
|
||||
name="'tpmEquipmentCheckTaskItemDetailList.'+ index +'.status'">
|
||||
<uni-tag :text="tagText(item.status)" type="primary" v-if="item.status"></uni-tag>
|
||||
<button type="success" size="mini"
|
||||
style="float: right;margin-right: 10px;background-color: #5AC725;color: #fff;"
|
||||
@click="handleFinish(item)">点检完成</button>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="备注" :labelWidth='90'
|
||||
name="'tpmEquipmentCheckTaskItemDetailList.'+ index +'remark'">
|
||||
<uni-easyinput disabled type="text" v-model="item.remark" />
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listTaskItem,
|
||||
getTaskItem,
|
||||
delTaskItem,
|
||||
addTaskItem,
|
||||
updateTaskItem,
|
||||
finishCheckTaskItem,
|
||||
finishCheckTaskItemDetail,
|
||||
repairCheckTaskItemDetail,
|
||||
listEmployee,
|
||||
tpmCheckTaskEditemOnly
|
||||
} from "@/api/tpm/checkTaskItem";
|
||||
export default {
|
||||
onLoad(option) {
|
||||
this.formData = JSON.parse(option.formData);
|
||||
},
|
||||
mounted() {},
|
||||
data() {
|
||||
return {
|
||||
formData: {},
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tagText(status) {
|
||||
if (status == "0") {
|
||||
return "待点检";
|
||||
} else if (status == "1") {
|
||||
return "已点检";
|
||||
} else if (status == "2") {
|
||||
return "已报修";
|
||||
}
|
||||
},
|
||||
async handleFinish(item) {
|
||||
try {
|
||||
// 获取用户ID
|
||||
let useId = null;
|
||||
const res = await listEmployee({
|
||||
"name": this.$store.state.user.name
|
||||
});
|
||||
if (res && res.rows && res.rows.length > 0) {
|
||||
useId = res.rows[0]["id"];
|
||||
}
|
||||
|
||||
if (useId) {
|
||||
// 更改数据状态
|
||||
const verifierRes = await tpmCheckTaskEditemOnly({
|
||||
id: useId
|
||||
});
|
||||
console.log(verifierRes, "verifierRes");
|
||||
|
||||
// 完成检查任务项详情
|
||||
const finishRes = await finishCheckTaskItemDetail([item.id]);
|
||||
this.$modal.msgSuccess("完成成功!");
|
||||
item.status = "1"; // 更新item的状态
|
||||
} else {
|
||||
// this.$modal.msgError("没有找到该员工!");
|
||||
}
|
||||
} catch (error) {
|
||||
// console.error("Error in handleFinish:", error);
|
||||
// this.$modal.msgError("操作失败,请稍后重试!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
204
pages/tpm/detail.vue
Normal file
204
pages/tpm/detail.vue
Normal file
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<view class="detail-container">
|
||||
<!-- 日期选择器 -->
|
||||
<view class="date-picker">
|
||||
<u-datetime-picker :value="selectedDate" mode="date" @confirm="handleDateChange"></u-datetime-picker>
|
||||
</view>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<view class="data-table">
|
||||
<view class="table-header">
|
||||
<text v-for="(col, index) in columns" :key="index" class="header-cell">
|
||||
{{ col.title }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view class="table-body">
|
||||
<view class="table-row" v-for="(item, rowIndex) in tableData" :key="rowIndex">
|
||||
<text class="body-cell" v-for="(col, colIndex) in columns" :key="colIndex">
|
||||
{{ item[col.key] }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectedDate: new Date().toISOString().slice(0, 10), // 默认当天
|
||||
originData: null, // 原始数据
|
||||
statType: '', // 统计类型
|
||||
columns: [], // 动态表头
|
||||
tableData: [] // 表格数据
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
this.initData(options.data)
|
||||
this.generateTable()
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化接收数据
|
||||
initData(encodedData) {
|
||||
try {
|
||||
const rawData = decodeURIComponent(encodedData)
|
||||
this.originData = JSON.parse(rawData)
|
||||
this.statType = this.originData.statType
|
||||
|
||||
console.log(rawData)
|
||||
} catch (e) {
|
||||
uni.showToast({
|
||||
title: '数据加载失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 日期变化处理
|
||||
handleDateChange(e) {
|
||||
this.selectedDate = e.value
|
||||
this.generateTable()
|
||||
},
|
||||
|
||||
// 生成表格数据
|
||||
generateTable() {
|
||||
// 根据类型生成不同列
|
||||
this.columns = this.getColumns()
|
||||
|
||||
// 根据类型生成数据(示例逻辑)
|
||||
this.tableData = this.statType === 'quality' ?
|
||||
this.generateQualityData() :
|
||||
this.generateCommonData()
|
||||
},
|
||||
|
||||
// 获取表头配置
|
||||
getColumns() {
|
||||
const baseColumns = [{
|
||||
title: '日期',
|
||||
key: 'date'
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
key: 'type'
|
||||
}
|
||||
]
|
||||
|
||||
switch (this.statType) {
|
||||
case 'quality':
|
||||
return [...baseColumns,
|
||||
{
|
||||
title: '问题数量',
|
||||
key: 'issueCount'
|
||||
},
|
||||
{
|
||||
title: '问题类型',
|
||||
key: 'issueType'
|
||||
}
|
||||
]
|
||||
|
||||
case 'salary':
|
||||
return [...baseColumns,
|
||||
{
|
||||
title: '计件数量',
|
||||
key: 'quantity'
|
||||
},
|
||||
{
|
||||
title: '工资金额',
|
||||
key: 'amount'
|
||||
}
|
||||
]
|
||||
|
||||
default: // production
|
||||
return [...baseColumns,
|
||||
{
|
||||
title: '报工数量',
|
||||
key: 'total'
|
||||
},
|
||||
{
|
||||
title: '合格数量',
|
||||
key: 'passed'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// 生成质量数据(示例)
|
||||
generateQualityData() {
|
||||
return [{
|
||||
date: this.selectedDate,
|
||||
type: '当日统计',
|
||||
issueCount: this.originData.todayData.failedNum,
|
||||
issueType: '生产问题'
|
||||
}, {
|
||||
date: '本月累计',
|
||||
type: '月度统计',
|
||||
issueCount: this.originData.monthData.failedNum,
|
||||
issueType: '综合问题'
|
||||
}]
|
||||
},
|
||||
generateCommonData() {
|
||||
return [{
|
||||
date: this.selectedDate,
|
||||
type: '当日统计',
|
||||
issueCount: this.originData.todayData.failedNum,
|
||||
issueType: '生产问题'
|
||||
}, {
|
||||
date: '本月累计',
|
||||
type: '月度统计',
|
||||
issueCount: this.originData.monthData.failedNum,
|
||||
issueType: '综合问题'
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.detail-container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.date-picker {
|
||||
margin: 20rpx 0;
|
||||
padding: 20rpx;
|
||||
background: #fff;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.data-table {
|
||||
border: 1rpx solid #e4e7ed;
|
||||
border-radius: 8rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.table-header,
|
||||
.table-row {
|
||||
display: flex;
|
||||
height: 80rpx;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header-cell,
|
||||
.body-cell {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.table-header {
|
||||
background-color: #f5f7fa;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.table-row:nth-child(even) {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.body-cell {
|
||||
color: #606266;
|
||||
}
|
||||
</style>
|
||||
189
pages/tpm/list.vue
Normal file
189
pages/tpm/list.vue
Normal file
@@ -0,0 +1,189 @@
|
||||
<style>
|
||||
.example-body {
|
||||
padding: 12px;
|
||||
background-color: #FFFFFF;
|
||||
|
||||
}
|
||||
|
||||
.result-box {
|
||||
text-align: center;
|
||||
padding: 20px 0px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
// 搜索框
|
||||
.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>
|
||||
<template>
|
||||
<view>
|
||||
<uni-easyinput suffixIcon="scan" placeholder="请输入设备编码" @iconClick="scanBar" v-model="equipmentCode" type="text"
|
||||
@confirm="scanBarCode" />
|
||||
|
||||
<selectLay :zindex="1211" :options="equipmentbrandArr" :value="equipmentbrand" placeholder="请选择设备厂家" @selectitem="equipmentbrandFuc"></selectLay>
|
||||
|
||||
|
||||
<button type="primary" size="mini" @click="reset"
|
||||
style="margin-top: 5px;text-align: center;display: block;width: 30%;">重置</button>
|
||||
|
||||
|
||||
|
||||
<view class="cu-card article ">
|
||||
<view class="cu-item shadow borderBottom" v-for="(item,index) in list" :key="index">
|
||||
<view class="title">
|
||||
<view class="text-cut">设备编码 : {{item.equipmentCode}}</view>
|
||||
<!-- <view>
|
||||
<u-button type="primary" size="mini" @click="detail(item)" style="float: right;">查看任务</u-button>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="desc">
|
||||
<view class="text-content">
|
||||
<view>设备名称 : {{item.equipmentTitle}}</view>
|
||||
<view>设备厂家 : {{item.equipmentBrand}}</view>
|
||||
<view>设备所属单位 : {{item.belongDept}}</view>
|
||||
<view>数量 : {{item.amount}}</view>
|
||||
<view>开机状态:
|
||||
<u-switch v-model="item.openStatus" activeColor="#5AC725" :inactiveValue="'0'"
|
||||
:activeValue="'1'" style="display: inline-flex;"
|
||||
@change="switchChange(item)"></u-switch>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listEquipment,
|
||||
updateEquipment
|
||||
} from "@/api/tpm/index.js";
|
||||
import {
|
||||
listEqpClass
|
||||
} from "@/api/basic/equipment.js"
|
||||
import selectLay from "@/components/select-lay/select-lay.vue"
|
||||
export default {
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
components: {
|
||||
selectLay
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
originalList: [], // 存储原始的设备列表数据
|
||||
equipmentCode: null,
|
||||
equipmentbrand: "",
|
||||
equipmentbrandArr: [],
|
||||
isAllBrandsSelected: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
listEqpClass().then(res => {
|
||||
this.equipmentbrandArr = res.rows.map(item=>{
|
||||
|
||||
return {
|
||||
value:item.equipmentBrand,
|
||||
label:item.equipmentBrand
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
equipmentbrandFuc(index,items) {
|
||||
this.equipmentbrand = items.value
|
||||
if (this.equipmentbrand == null) {
|
||||
// 如果选择了"所有品牌",则展示所有设备
|
||||
this.list = this.originalList;
|
||||
} else {
|
||||
// 根据选中的品牌筛选设备
|
||||
this.list = this.originalList.filter(item => {
|
||||
return item.equipmentBrand === this.equipmentbrand;
|
||||
});
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.equipmentCode = null;
|
||||
this.equipmentbrand = "";
|
||||
this.isAllBrandsSelected = true; // 重置品牌选择
|
||||
this.getList(); // 重新获取原始列表
|
||||
},
|
||||
getList() {
|
||||
listEquipment().then(response => {
|
||||
this.originalList = response.rows.map(item => {
|
||||
if (item.openStatus == null) item.openStatus = '0';
|
||||
return item;
|
||||
});
|
||||
this.list = this.originalList;
|
||||
});
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.equipmentCode) {
|
||||
let obj = {
|
||||
equipmentCode: this.equipmentCode
|
||||
}
|
||||
listEquipment(obj).then(response => {
|
||||
this.list = response.rows;
|
||||
});
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.equipmentCode = res.result;
|
||||
_this.scanBarCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
detail() {
|
||||
|
||||
},
|
||||
switchChange(item) {
|
||||
updateEquipment(item).then((response) => {
|
||||
this.$modal.msgSuccess("开关状态修改成功!");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
133
pages/tpm/maintainTask.vue
Normal file
133
pages/tpm/maintainTask.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<view>
|
||||
<view>
|
||||
<uni-easyinput suffixIcon="scan" placeholder="请输入设备编码" @iconClick="scanBar"
|
||||
v-model="queryParams.equipmentCode" type="text" @confirm="scanBarCode" />
|
||||
<button type="primary" size="mini" @click="reset"
|
||||
style="margin-top: 5px;text-align: center;display: block;width: 30%;">重置</button>
|
||||
<view class="cu-card article ">
|
||||
<view class="cu-item shadow borderBottom" v-for="(item,index) in list" :key="index">
|
||||
<view class="title">
|
||||
<view class="text-cut">任务名 : {{item.taskName}}</view>
|
||||
<view>
|
||||
<button type="primary" size="mini" @click="detail(item)" style="float: right;">查看明细</button>
|
||||
</view>
|
||||
<view>
|
||||
<button type="success" size="mini"
|
||||
style="float: right;margin-right: 10px;background-color: #5AC725;color: #fff;"
|
||||
@click="handleFinish(item)">完成</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="desc">
|
||||
<view class="text-content">
|
||||
<view>明细号 : {{item.taskItemCode}}</view>
|
||||
<view>明细名 : {{item.taskItemName}}</view>
|
||||
<view>状态 : <uni-tag :text="tagText(item.status)" type="primary"
|
||||
v-if="item.status"></uni-tag></view>
|
||||
<view>设备编码 : {{item.equipmentCode}}</view>
|
||||
<view>时间 : {{item.createTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listMaintainTaskItem,
|
||||
getMaintainTaskItem
|
||||
} from "@/api/tpm/index.js";
|
||||
import {
|
||||
listTaskItem,
|
||||
getTaskItem,
|
||||
delTaskItem,
|
||||
addTaskItem,
|
||||
updateTaskItem,
|
||||
finishMaintainTaskItem
|
||||
} from "@/api/tpm/maintainTaskItem";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
export default {
|
||||
mounted() {
|
||||
this.getList()
|
||||
getDicts("tpm_task_status").then(res => {
|
||||
this.taskStatusOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: {},
|
||||
queryParams: {
|
||||
equipmentCode: null,
|
||||
},
|
||||
formData: {},
|
||||
taskStatusOptions: [],
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tagText(status) {
|
||||
let obj = this.taskStatusOptions.find(item => item.value == status)
|
||||
if (obj !== undefined) {
|
||||
return this.taskStatusOptions.find(item => item.value == status).text
|
||||
}
|
||||
},
|
||||
handleFinish(item) {
|
||||
finishMaintainTaskItem([item.id]).then((response) => {
|
||||
this.$modal.msgSuccess("完成成功!");
|
||||
this.getList()
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
listMaintainTaskItem(this.queryParams).then(response => {
|
||||
this.list = response.rows;
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.queryParams.equipmentCode = null;
|
||||
this.getList();
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.queryParams.equipmentCode) {
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.queryParams.equipmentCode = res.result;
|
||||
_this.scanBarCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
detail(item) {
|
||||
getMaintainTaskItem(item.id).then(async res => {
|
||||
this.$tab.navigateTo('/pages/tpm/maintainTaskItem?formData=' + JSON.stringify(res.data));
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
96
pages/tpm/maintainTaskItem.vue
Normal file
96
pages/tpm/maintainTaskItem.vue
Normal file
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData">
|
||||
<uni-collapse-item title="保养任务明细单" :open="true">
|
||||
<uni-forms-item label="任务名" :labelWidth='90' name="taskName">
|
||||
<uni-easyinput disabled v-model="formData.taskName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="明细号" :labelWidth='90' name="taskItemCode">
|
||||
<uni-easyinput disabled v-model="formData.taskItemCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="明细名" :labelWidth='90' name="taskItemName">
|
||||
<uni-easyinput disabled v-model="formData.taskItemName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput disabled v-model="formData.equipmentCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="操作人ID" :labelWidth='90' name="operatorId">
|
||||
<uni-easyinput disabled v-model="formData.operatorId" />
|
||||
</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.tpmEquipmentMaintainTaskItemDetailList">
|
||||
<uni-badge :text="index+1" type="primary"></uni-badge>
|
||||
<uni-forms-item label="项目编码"
|
||||
:name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'.detailCode'">
|
||||
<uni-easyinput disabled type="text" disabled v-model="item.detailCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="项目名称"
|
||||
:name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'.detailName'">
|
||||
<uni-easyinput disabled type="text" disabled v-model="item.detailName"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称" :labelWidth='90'
|
||||
name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'.materialName'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料编码" :labelWidth='90'
|
||||
name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'.materialCode'">
|
||||
<uni-easyinput disabled type="text" v-model="item.materialCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="数量" :labelWidth='90'
|
||||
name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'.planNumber'">
|
||||
<uni-easyinput disabled type="text" v-model="formData.planNumber" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="实际数量" :labelWidth='90'
|
||||
name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'actualNumber'">
|
||||
<uni-easyinput disabled type="number" v-model="item.actualNumber" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="单位" :labelWidth='90'
|
||||
name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'unitName'">
|
||||
<uni-easyinput disabled type="text" v-model="item.unitName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="备注" :labelWidth='90'
|
||||
name="'tpmEquipmentMaintainTaskItemDetailList.'+ index +'remark'">
|
||||
<uni-easyinput disabled type="text" v-model="item.remark" />
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listTaskItem,
|
||||
getTaskItem
|
||||
} from "@/api/tpm/index.js";
|
||||
|
||||
export default {
|
||||
onLoad(option) {
|
||||
this.formData = JSON.parse(option.formData);
|
||||
},
|
||||
mounted() {},
|
||||
data() {
|
||||
return {
|
||||
formData: {},
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
92
pages/tpm/repairTask.vue
Normal file
92
pages/tpm/repairTask.vue
Normal file
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<view>
|
||||
<view>
|
||||
<uni-easyinput suffixIcon="scan" placeholder="请输入设备编码" @iconClick="scanBar"
|
||||
v-model="queryParams.equipmentCode" type="text" @confirm="scanBarCode" />
|
||||
<button type="primary" size="mini" @click="reset"
|
||||
style="margin-top: 5px;text-align: center;display: block;width: 30%;">重置</button>
|
||||
<view class="cu-card article ">
|
||||
<view class="cu-item shadow borderBottom" v-for="(item,index) in list" :key="index">
|
||||
<view class="title">
|
||||
<view class="text-cut">故障号 : {{item.breakdownCode}}</view>
|
||||
<view>
|
||||
<button type="primary" size="mini" @click="detail(item)" style="float: right;">查看明细</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="desc">
|
||||
<view class="text-content">
|
||||
<view>故障名 : {{item.breakdownName}}</view>
|
||||
<view>任务名 : {{item.taskName}}</view>
|
||||
<view>设备编码 : {{item.equipmentCode}}</view>
|
||||
<view>故障类型 : {{item.type}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listBreakdown,
|
||||
getBreakdown
|
||||
} from "@/api/tpm/index.js";
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: {},
|
||||
queryParams: {
|
||||
equipmentCode: null,
|
||||
},
|
||||
formData: {},
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
listBreakdown(this.queryParams).then(response => {
|
||||
this.list = response.rows;
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.queryParams.equipmentCode = null;
|
||||
this.getList();
|
||||
},
|
||||
scanBarCode() {
|
||||
if (this.queryParams.equipmentCode) {
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.queryParams.equipmentCode = res.result;
|
||||
_this.scanBarCode();
|
||||
}
|
||||
});
|
||||
},
|
||||
detail(item) {
|
||||
getBreakdown(item.id).then(async res => {
|
||||
this.$tab.navigateTo('/pages/tpm/repairTaskItem?formData=' + JSON.stringify(res.data));
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
287
pages/tpm/repairTaskAdd.vue
Normal file
287
pages/tpm/repairTaskAdd.vue
Normal file
@@ -0,0 +1,287 @@
|
||||
<template>
|
||||
<view style="background-color: #fff;">
|
||||
<!-- <uni-collapse> -->
|
||||
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||
<!-- <uni-collapse-item title="新增模具维修" :open="true"> -->
|
||||
<uni-forms-item label="任务号" :labelWidth='90' name="taskCode">
|
||||
<uni-easyinput type="text" v-model="formData.taskCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="任务名" :labelWidth='90' name="taskName">
|
||||
<uni-easyinput type="text" v-model="formData.taskName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="类型" :labelWidth='90' name="type" v-if="!formData.taskId">
|
||||
<uni-data-select v-model="formData.type" :localdata="repairTypeOptions" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="状态" :labelWidth='90' name="status">
|
||||
<u-radio-group v-model="formData.status" placement="row">
|
||||
<u-radio v-for="(item, index) in taskStatusOptions" :key="index" :label="item.text"
|
||||
:name="item.value">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="备注" :labelWidth='90' name="remark">
|
||||
<uni-easyinput v-model="formData.remark" type="text" />
|
||||
</uni-forms-item>
|
||||
<u-divider :text="'新增故障'" v-if="formData.taskId"></u-divider>
|
||||
<view v-if="formData.taskId">
|
||||
<uni-forms-item label="故障号" :labelWidth='90' name="breakdownCode">
|
||||
<uni-easyinput v-model="formData.breakdownCode" disabled type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="故障名" :labelWidth='90' name="breakdownName">
|
||||
<uni-easyinput v-model="formData.breakdownName" type="text" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="故障类型" :labelWidth='90' name="type" v-if="formData.taskId">
|
||||
<uni-data-select v-model="formData.type" :localdata="breakdownTypeOptions" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="type" v-if="formData.taskId">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarEquipmentCode" v-model="formData.equipmentCode"
|
||||
type="text" @confirm="confirmEquipmentCode" />
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="维修人" :labelWidth='90' name="operatorCode">
|
||||
<uni-easyinput suffixIcon="scan" @iconClick="scanBarOperatorCode" @confirm="confirmOperatorCode"
|
||||
v-model="formData.operatorCode" type="text" style="margin-bottom: 10px;" />
|
||||
<uni-data-select v-model="formData.operatorCode" :localdata="empList" />
|
||||
</uni-forms-item> -->
|
||||
</view>
|
||||
<!-- </uni-collapse-item> -->
|
||||
</uni-forms>
|
||||
<!-- </uni-collapse> -->
|
||||
<u-button type="success" v-if="!formData.taskId" @click="taskSubmit">新建任务</u-button>
|
||||
<u-button type="primary" v-if="formData.taskId" @click="breakSubmit">新建故障</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listTask,
|
||||
getTask,
|
||||
delTask,
|
||||
addTask,
|
||||
updateTask,
|
||||
} from "@/api/tpm/repairTask";
|
||||
import {
|
||||
listBreakdown,
|
||||
getBreakdown,
|
||||
delBreakdown,
|
||||
addBreakdown,
|
||||
updateBreakdown,
|
||||
} from "@/api/tpm/repairBreakdown";
|
||||
import {
|
||||
getDicts
|
||||
} from "@/api/system/dict/dictData.js";
|
||||
|
||||
import {
|
||||
listEquipment
|
||||
} from "@/api/mes/jobReport.js";
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
getDicts("tpm_repair_type").then(res => {
|
||||
this.repairTypeOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
getDicts("tpm_task_status").then(res => {
|
||||
this.taskStatusOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
getDicts("tpm_breakdown_type").then(res => {
|
||||
this.breakdownTypeOptions = res.data.map(dict => {
|
||||
return {
|
||||
text: dict.dictLabel,
|
||||
value: dict.dictValue,
|
||||
diasble: false
|
||||
}
|
||||
});
|
||||
})
|
||||
listEmployee().then((res) => {
|
||||
|
||||
this.empList = res.rows.map(item => {
|
||||
item.text = item.empCode + ':' + item.name
|
||||
item.value = item.empCode
|
||||
return item
|
||||
});
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
empList: [],
|
||||
repairTypeOptions: [],
|
||||
breakdownTypeOptions: [],
|
||||
taskStatusOptions: [],
|
||||
formData: {
|
||||
taskCode: null,
|
||||
taskName: null,
|
||||
type: null,
|
||||
status: "0",
|
||||
mouldUuid: null,
|
||||
mouldName: null,
|
||||
remark: null,
|
||||
breakdownCode: null,
|
||||
breakdownName: null,
|
||||
operatorId: null,
|
||||
operatorCode: null,
|
||||
mouldId: null,
|
||||
taskId: null,
|
||||
taskType: null
|
||||
},
|
||||
rules: {
|
||||
// saleOutTaskCode: {
|
||||
// rules: [{
|
||||
// required: true,
|
||||
// errorMessage: '请输入销售出库任务单!'
|
||||
// }]
|
||||
// },
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
deleteDetail(index) {
|
||||
this.formData.wmsSaleOutDetailList.splice(index, 1);
|
||||
},
|
||||
clickDetail(itemIndex, {
|
||||
position,
|
||||
index
|
||||
}) {
|
||||
if (index == 0) {
|
||||
this.deleteDetail(itemIndex);
|
||||
}
|
||||
},
|
||||
//扫描设备编码带出设备信息
|
||||
confirmEquipmentCode() {
|
||||
if (this.formData.equipmentCode) {
|
||||
listEquipment({
|
||||
equipmentCode: this.formData.equipmentCode
|
||||
}).then(res => {
|
||||
if (res.rows.length > 0) {
|
||||
this.formData.equipmentId = res.rows[0].id
|
||||
} else {
|
||||
this.$modal.msg("未查询到该设备,请重新输入!")
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
scanBarEquipmentCode() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
success: function(res) {
|
||||
_this.formData.equipmentCode = res.result;
|
||||
_this.confirmEquipmentCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
// scanBarOperatorCode() {
|
||||
// const _this = this;
|
||||
// uni.scanCode({
|
||||
// scanType: ['qrCode', 'barCode'],
|
||||
// success: function(res) {
|
||||
// _this.formData.operatorCode = res.result;
|
||||
// _this.confirmOperatorCode()
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// confirmOperatorCode() {
|
||||
// listEmployee({
|
||||
// empCode: this.formData.operatorCode
|
||||
// }).then(async res => {
|
||||
// if (res.rows.length == 0) {
|
||||
// this.$modal.msg("未查询到该人员,请重新输入!")
|
||||
// this.formData.operatorCode = null;
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
taskSubmit() {
|
||||
const _this = this;
|
||||
this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定新建该任务吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log(_this.formData)
|
||||
if (_this.formData.taskName == null || _this.formData.taskName == "") {
|
||||
_this.$modal.msg("任务名不得为空,请输入!")
|
||||
} else {
|
||||
_this.$modal.loading('提交中')
|
||||
addTask(_this.formData).then(async res => {
|
||||
let obj = res.tpmEquipmentRepairTask
|
||||
_this.formData.taskId = obj.id;
|
||||
_this.formData.taskCode = obj.taskCode;
|
||||
_this.formData.taskType = obj.type;
|
||||
_this.$modal.msgSuccess("新建任务成功!");
|
||||
_this.$modal.closeLoading();
|
||||
});
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
breakSubmit() {
|
||||
const _this = this;
|
||||
this.$refs.form.validate().then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定新建该故障吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
if (_this.formData.breakdownName == null || _this.formData
|
||||
.breakdownName == "") {
|
||||
_this.$modal.msg("故障名不得为空,请输入!")
|
||||
} else {
|
||||
// let obj = _this.empList.find(item => _this.formData.operatorCode ==
|
||||
// item.value)
|
||||
// if (obj !== undefined) {
|
||||
// _this.formData.operatorId = obj.id
|
||||
// }
|
||||
console.log(_this.formData)
|
||||
_this.$modal.loading('提交中')
|
||||
addBreakdown(_this.formData).then(async res => {
|
||||
_this.$modal.msgSuccess("新建故障成功!");
|
||||
_this.$modal.closeLoading();
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab(
|
||||
"/pages/work/index");
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.divider {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
height: 1px;
|
||||
background-color: #F1F1F1;
|
||||
}
|
||||
|
||||
.divider span {
|
||||
padding: 5px;
|
||||
|
||||
}
|
||||
</style>
|
||||
93
pages/tpm/repairTaskItem.vue
Normal file
93
pages/tpm/repairTaskItem.vue
Normal file
@@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-collapse>
|
||||
<uni-forms ref="form" :modelValue="formData">
|
||||
<uni-collapse-item title="维修任务明细单" :open="true">
|
||||
<uni-forms-item label="任务名" :labelWidth='90' name="taskName">
|
||||
<uni-easyinput disabled v-model="formData.taskName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="故障号" :labelWidth='90' name="taskItemCode">
|
||||
<uni-easyinput disabled v-model="formData.taskItemCode" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="故障名" :labelWidth='90' name="taskItemName">
|
||||
<uni-easyinput disabled v-model="formData.taskItemName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="故障类型" :labelWidth='90' name="type">
|
||||
<uni-easyinput disabled v-model="formData.type" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备编码" :labelWidth='90' name="equipmentCode">
|
||||
<uni-easyinput disabled v-model="formData.equipmentCode" />
|
||||
</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.tpmEquipmentRepairBreakdownMaterialList">
|
||||
<uni-badge :text="index+1" type="primary"></uni-badge>
|
||||
<uni-forms-item label="物料编码"
|
||||
:name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'.detailCode'">
|
||||
<uni-easyinput disabled type="text" disabled
|
||||
v-model="item.materialCode"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称"
|
||||
:name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'.detailName'">
|
||||
<uni-easyinput disabled type="text" disabled
|
||||
v-model="item.materialName"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="计划数量" :labelWidth='90'
|
||||
name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'.materialName'">
|
||||
<uni-easyinput disabled type="text" v-model="item.planNumber" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="实际数量" :labelWidth='90'
|
||||
name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'.materialCode'">
|
||||
<uni-easyinput disabled type="text" v-model="item.actualNumber" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="单位" :labelWidth='90'
|
||||
name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'.planNumber'">
|
||||
<uni-easyinput disabled type="text" v-model="formData.unitName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="备注" :labelWidth='90'
|
||||
name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'actualNumber'">
|
||||
<uni-easyinput disabled type="number" v-model="item.remark" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="单位" :labelWidth='90'
|
||||
name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'unitName'">
|
||||
<uni-easyinput disabled type="text" v-model="item.unitName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="备注" :labelWidth='90'
|
||||
name="'tpmEquipmentRepairBreakdownMaterialList.'+ index +'remark'">
|
||||
<uni-easyinput disabled type="text" v-model="item.remark" />
|
||||
</uni-forms-item>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</uni-collapse-item>
|
||||
</uni-forms>
|
||||
</uni-collapse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
onLoad(option) {
|
||||
this.formData = JSON.parse(option.formData);
|
||||
},
|
||||
mounted() {},
|
||||
data() {
|
||||
return {
|
||||
formData: {},
|
||||
rightOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ff2a17'
|
||||
}
|
||||
}, ],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user