Commit 1396bf42 authored by tanjunxin's avatar tanjunxin

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

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