Commit 1396bf42 authored by tanjunxin's avatar tanjunxin

fix: 刀模板具申请单增加操作按钮及功能

parent 748c8b08
......@@ -113,4 +113,12 @@ export function deleteTask(taskId) {
url: "/mes/pro/protask/deleteTask/" + taskId,
method: "delete",
});
}
\ No newline at end of file
}
// 校验状态改变
export function updateNotInspectionStatusApi(data) {
return request({
url: `/tm/tmToolRequest/updateNotInspectionStatus/${data.toolRequestItemId}?inspectionStatus=${data.inspectionStatus}`,
method: "put",
});
}
......@@ -25,6 +25,14 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="编排单号" prop="arrangeCode">
<el-input
v-model="queryParams.arrangeCode"
placeholder="请输入编排单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="作业单元" prop="workunitName">
<el-input
v-model="queryParams.workunitName"
......@@ -37,7 +45,7 @@
<el-date-picker v-model="daterangePurchaseDate" value-format="yyyy-MM-dd" type="daterange" range-separator="-"
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<!-- <el-form-item label="预计开始时间" prop="startTime">
<el-date-picker clearable
v-model="queryParams.startTime"
......@@ -61,15 +69,7 @@
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="编排单号" prop="arrangeCode">
<el-input
v-model="queryParams.arrangeCode"
placeholder="请输入编排单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
......@@ -94,8 +94,16 @@
@click="handlePrint"
>打印</el-button> -->
</el-col>
<!-- <el-col :span="1.5">
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['tm:tmToolRequest:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -108,7 +116,7 @@
v-hasPermi="['tm:tmToolRequest:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
......@@ -122,9 +130,8 @@
</el-row>
<el-table v-loading="loading" :data="tmToolRequestList" row-key="productionMakeId"
default-expand-all>
<!-- @selection-change="handleSelectionChange" 勾选框中的属性-->
<!-- <el-table-column type="selection" width="55" align="center" /> -->
default-expand-all @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键id" align="center" prop="toolRequestId" /> -->
<el-table-column label="申请单号" width="150" align="center" prop="toolRequestCode" :show-overflow-tooltip="true">
<template slot-scope="scope">
......@@ -156,16 +163,16 @@
</template>
</el-table-column>
<el-table-column label="总数量" align="center" prop="requestNum" />
<!-- <el-table-column label="编排单号" align="center" prop="arrangeCode" /> -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="编排单号" align="center" width="150" prop="arrangeCode" />
<el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
<!-- <el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
v-hasPermi="['tm:tmToolRequest:query']"
>查看</el-button>
>查看</el-button> -->
<!-- <template slot-scope="scope">
<el-button
......@@ -176,14 +183,20 @@
>{{ scope.row.toolRequestCode }}</el-button
>
</template> -->
<!-- <el-button
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['tm:tmToolRequest:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['tm:tmToolRequest:remove']"
>删除</el-button> -->
>删除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -277,7 +290,7 @@
<itemline ref="line" :quantity="form.quantity" :toolRequestId="form.toolRequestId" :taskId="form.taskWorkunitId" :optType="optType" @sum="handleSumNum"></itemline>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button v-if="!form.toolRequestId" type="primary" @click="submitForm">确 定</el-button>
<el-button v-if="['add', 'edit'].includes(optType)" type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......@@ -345,7 +358,6 @@ export default {
total: 0,
// 刀模版申请单表格数据
tmToolRequestList: [],
daterangePurchaseDate: [],
// 弹出层标题
title: "",
......@@ -389,8 +401,6 @@ export default {
};
},
created() {
this.getList();
},
methods: {
......@@ -457,7 +467,8 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null };
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
......@@ -513,7 +524,7 @@ export default {
return
}
this.$refs.line.tmToolRequestItemList.forEach(item => {
sum+=Number(item.quantity)
sum+=Number(item.quantity ? item.quantity : '')
})
this.form.requestNum = sum
},
......@@ -525,6 +536,7 @@ export default {
this.form = response.data;
this.open = true;
this.title = "修改刀模版申请单";
this.optType = "edit";
});
},
/** 提交按钮 */
......@@ -532,7 +544,11 @@ export default {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.toolRequestId != null) {
updateTmToolRequest(this.form).then(response => {
const params = {
...this.form,
imToolRequestItemList: this.$refs.line.tmToolRequestItemList
}
updateTmToolRequest(params).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
......@@ -560,9 +576,11 @@ export default {
const toolRequestIds = row.toolRequestId || this.ids;
this.$modal.confirm('是否确认删除刀模版申请单编号为"' + toolRequestIds + '"的数据项?').then(function() {
return delTmToolRequest(toolRequestIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).then((res) => {
if(res.code == 200) {
this.$modal.msgSuccess("删除成功");
this.getList();
}
}).catch(() => {});
},
/** 导出按钮操作 */
......
<template>
<div class="app-container">
<el-button
v-if="$attrs.optType === 'add'"
v-if="['add', 'edit'].includes($attrs.optType)"
type="primary"
plain
icon="el-icon-plus"
......@@ -15,8 +15,19 @@
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="刀模版物料名称" align="center" prop="itemName" />
<el-table-column width="120px" label="预计使用寿命" align="center" prop="estimatedLifeTime" />
<el-table-column width="100px" v-if="$attrs.optType === 'add'" label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column width="120px" label="是否校验" align="center" prop="inspectionStatus">
<template slot-scope="scope">
{{ scope.row.inspectionStatus ? "是" : "否" }}
</template>
</el-table-column>
<el-table-column width="120px" v-if="['add', 'edit'].includes($attrs.optType)" label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
v-if="['edit'].includes($attrs.optType) && scope.row.toolRequestItemId"
size="mini"
type="text"
@click="handleCheck(scope.row, scope.$index)"
>跳过校验</el-button>
<el-button
size="mini"
type="text"
......@@ -26,16 +37,13 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0&&$attrs.optType !== 'add'"
v-if="total > 0 && ['add'].includes($attrs.optType)"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
@pagination="getTaskList"
/>
<!-- 添加或修改刀模版物料申请单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
......@@ -73,15 +81,15 @@
<script>
import { listTmToolRequestItem, getTmToolRequestItem, delTmToolRequestItem, addTmToolRequestItem, updateTmToolRequestItem } from "@/api/mes/tm/tmToolRequestItem";
import { getTaskIdMaxProcessTool } from "@/api/mes/pro/protask";
import { getTaskIdMaxProcessTool, updateNotInspectionStatusApi } from "@/api/mes/pro/protask";
import ItemSelect from "@/components/itemSelect/index.vue";
export default {
name: "TmToolRequestItem",
components: {ItemSelect},
props:{
toolRequestId:{
type:String,
default:''
type: Number,
default: 0
}
},
data() {
......@@ -108,7 +116,11 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
toolRequestId: null, itemId: null, allQuantity: null, nextMaintenPeriod: null, },
toolRequestId: null,
temId: null,
allQuantity: null,
nextMaintenPeriod: null,
},
// 表单参数
form: {},
// 表单校验
......@@ -125,13 +137,13 @@ export default {
},
watch: {
'$attrs.taskId'(newVal, oldVal){
if (this.$attrs.optType === 'add') {
if(['add', 'edit'].includes(this.$attrs.optType)) {
this.getTaskList()
}
}
},
created() {
if (this.$attrs.optType !== 'add') {
if(!['add'].includes(this.$attrs.optType)) {
this.getList();
}
},
......@@ -193,6 +205,17 @@ export default {
this.$emit('sum')
});
},
async handleCheck(row, index) {
const params = {
toolRequestItemId: row.toolRequestItemId,
inspectionStatus: !row.inspectionStatus
};
const res = await updateNotInspectionStatusApi(params);
if(res.code == 200) {
this.getList();
this.$modal.msgSuccess("操作成功");
}
},
handleRemove(row, index) {
console.log(row,index)
this.tmToolRequestItemList.splice(index, 1)
......@@ -206,7 +229,16 @@ export default {
// 表单重置
reset() {
this.form = {
toolRequestItemId: null, toolRequestId: null, itemId: null, allQuantity: null, nextMaintenPeriod: null, createBy: null, createTime: null, updateBy: null, updateTime: null };
toolRequestItemId: null,
toolRequestId: null,
itemId: null,
allQuantity: null,
nextMaintenPeriod: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment