Commit 308f0169 authored by tanjunxin's avatar tanjunxin

fix: 对刀模版功能进行优化

parent 67fee88e
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
plain plain
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
v-hasPermi="['tm:tmToolRequestUse:remove']" v-hasPermi="['tm:tmToolRequestUse: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"
...@@ -144,6 +144,14 @@ ...@@ -144,6 +144,14 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
v-hasPermi="['tm:tmToolRequestUse:view']"
>查看</el-button
>
<!-- <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
...@@ -158,7 +166,7 @@ ...@@ -158,7 +166,7 @@
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['tm:tmToolRequestUse:remove']" v-hasPermi="['tm:tmToolRequestUse:remove']"
>删除</el-button >删除</el-button
> > -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -187,16 +195,18 @@ ...@@ -187,16 +195,18 @@
readonly readonly
style="width: 220px;" style="width: 220px;"
v-model="form.toolRequestUseCode" v-model="form.toolRequestUseCode"
:disabled="title == '查看刀模版领用单'"
placeholder="请输入领用单编码" placeholder="请输入领用单编码"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="申请单" prop="toolRequestId"> <el-form-item label="申请单" prop="toolRequestId">
<el-input style="width: 220px;" v-model="form.toolRequestCode" readonly> <el-input style="width: 220px;" v-model="form.toolRequestCode" readonly >
<el-button <el-button
slot="append" slot="append"
icon="el-icon-search" icon="el-icon-search"
:disabled="title == '查看刀模版领用单'"
@click="$refs.ToolRequestSelectRef.showFlag = true" @click="$refs.ToolRequestSelectRef.showFlag = true"
></el-button> ></el-button>
</el-input> </el-input>
...@@ -232,7 +242,7 @@ ...@@ -232,7 +242,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8" v-if="title != '查看刀模版领用单'">
<el-form-item label="申请时间" prop="requestDate"> <el-form-item label="申请时间" prop="requestDate">
<el-date-picker <el-date-picker
disabled disabled
...@@ -274,7 +284,7 @@ ...@@ -274,7 +284,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8" v-if="title != '查看刀模版领用单'">
<el-form-item label="申请数量" prop="requestNum"> <el-form-item label="申请数量" prop="requestNum">
<el-input <el-input
disabled disabled
...@@ -298,7 +308,7 @@ ...@@ -298,7 +308,7 @@
</el-row> </el-row>
</el-form> </el-form>
<el-divider content-position="left">申请单刀模版具数据</el-divider> <el-divider content-position="left">{{`${title == '查看刀模版领用单' ? '' : '申请单'}刀模版具数据`}}</el-divider>
<el-table :data="tmToolRequestList"> <el-table :data="tmToolRequestList">
<el-table-column label="物料" prop="itemName" /> <el-table-column label="物料" prop="itemName" />
<el-table-column label="数量" prop="quantity" /> <el-table-column label="数量" prop="quantity" />
...@@ -473,6 +483,33 @@ export default { ...@@ -473,6 +483,33 @@ export default {
this.title = "添加刀模版领用单"; this.title = "添加刀模版领用单";
this.handleAutoGenChange(true); this.handleAutoGenChange(true);
}, },
/** 查看按钮操作 */
handleView(row) {
this.reset();
const toolRequestUseId = row.toolRequestUseId || this.ids;
getTmToolRequestUse(toolRequestUseId).then((response) => {
const tmToolRequestUseItemList = response.data.tmToolRequestUseItemList;
this.form = response.data;
this.tmToolRequestList = response.data.tmToolRequestUseItemList.map(item=> {
return {
...item,
allQuantity: item.allQuantity || 1
}
})
// 请求申请单
// this.queryToolList(this.form.toolRequestId, () => {
this.tmToolRequestList.forEach((item) => {
const flag = tmToolRequestUseItemList.find(
(v) => v.itemId == item.itemId
);
flag && (item.isCheck = flag.toolId);
});
console.log(this.tmToolRequestList, 'this.tmToolRequestList')
// });
this.open = true;
this.title = "查看刀模版领用单";
});
},
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</el-form> --> </el-form> -->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
plain plain
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
@click="handleAdd" @click="handleAdd"
v-hasPermi="['tm:toolmachinesrecord:add']" v-hasPermi="['tm:toolmachinesrecord:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col> -->
</el-row> </el-row>
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
......
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