Commit 334d0c01 by 夏超

[fix] 修改问题

parent a360f704
...@@ -283,3 +283,18 @@ class RokeWorkstationWorkOrderModel(http.Controller): ...@@ -283,3 +283,18 @@ class RokeWorkstationWorkOrderModel(http.Controller):
"work_order_ids": routing.routing_task_id.change_routing_id_work_order(routing) "work_order_ids": routing.routing_task_id.change_routing_id_work_order(routing)
}) })
return {"code": 0, "message": f"工艺路线生成工单成功!"} return {"code": 0, "message": f"工艺路线生成工单成功!"}
@http.route('/roke/workstation/craft_design/workstation_verify_if_editable', type='json', auth='user',
csrf=False, cors="*")
def workstation_verify_if_editable(self):
"""
根据任务报工情况判断工艺设计是否可编辑
"""
_self = http.request
routing_id = _self.jsonrequest.get("routing_id", 0)
routing = _self.env["roke.routing"].search([("id", "=", routing_id)])
if not routing.routing_task_id:
return {"code": 0, "message": f"工艺没有相应的任务,不可编辑!", "editable": False}
if routing.routing_task_id.record_ids:
return {"code": 0, "message": f"绑定任务已报工,不可编辑!", "editable": False}
return {"code": 0, "message": f"获取成功!", "editable": True}
...@@ -56,19 +56,19 @@ ...@@ -56,19 +56,19 @@
<div class="rightBottomLeftBox"> <div class="rightBottomLeftBox">
<div class="title"> <div class="title">
<span>产品工序</span> <span>产品工序</span>
<el-button size="small" :disabled="!treeActiveData.type||treeActiveData.type=='category'" <el-button size="small" :disabled="!prohibited_state"
type="primary" @click="() => addProcessDialogShow = true"> type="primary" @click="() => addProcessDialogShow = true">
添加 添加
</el-button> </el-button>
</div> </div>
<div class="processBox"> <div class="processBox">
<draggable v-model="productProcessList" chosen-class="chosen" delay="0" group="people" <draggable :options="{ disabled: !prohibited_state }" v-model="productProcessList" chosen-class="chosen" delay="0" group="people"
animation="100" force-fallback class="draggableAreaStyle" @end="processSortEndHandle"> animation="100" force-fallback class="draggableAreaStyle" @end="processSortEndHandle">
<div class="processItemBox" :class="{processActive:item.show}" <div class="processItemBox" :class="{processActive:item.show}"
v-for="(item,index) in productProcessList" :key="index" @click="selProcessHandle(item)"> v-for="(item,index) in productProcessList" :key="index" @click="selProcessHandle(item)">
<span>[[item.process_name]]</span> <span>[[item.process_name]]</span>
<span> <span>
<i class="el-icon-delete" @click.stop="deleteProcessIconHandle(item,index)"></i> <i class="el-icon-delete" @click.stop="prohibited_state?deleteProcessIconHandle(item,index):''"></i>
<i class="iconfont icon-tuozhuai1"></i> <i class="iconfont icon-tuozhuai1"></i>
</span> </span>
</div> </div>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<span v-else>[[scope.row.description]]</span> <span v-else>[[scope.row.description]]</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="!isEdit" label="操作" align="center" width="80"> <el-table-column v-if="!isEdit && prohibited_state" label="操作" align="center" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="deleteInfoHandle('工艺参数',scope.row)"> <el-button type="text" size="small" @click="deleteInfoHandle('工艺参数',scope.row)">
<i class="el-icon-delete" style="font-size: 18px"></i> <i class="el-icon-delete" style="font-size: 18px"></i>
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="padding: 10px;"> <div style="padding: 10px;" v-if="prohibited_state">
<el-button type="primary" size="small" :disabled="!selProductProcessData||isEdit" <el-button type="primary" size="small" :disabled="!selProductProcessData||isEdit"
@click="addInfoHandle('工艺参数')"> @click="addInfoHandle('工艺参数')">
添加 添加
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="100"> <el-table-column v-if="prohibited_state" label="操作" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" style="margin-left: 10px;" <el-button type="text" size="small" style="margin-left: 10px;"
@click="filePreviewHandle(scope.row)"> @click="filePreviewHandle(scope.row)">
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="padding: 10px;"> <div style="padding: 10px;" v-if="prohibited_state">
<el-upload :auto-upload="false" action="#" :disabled="!this.selProductProcessData" <el-upload :auto-upload="false" action="#" :disabled="!this.selProductProcessData"
:show-file-list="false" :on-change="uploadChange"> :show-file-list="false" :on-change="uploadChange">
<el-button type="primary" size="small" :disabled="!this.selProductProcessData"> <el-button type="primary" size="small" :disabled="!this.selProductProcessData">
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="100"> <el-table-column v-if="prohibited_state" label="操作" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="editInfoHandle('设备检查项',scope.row)"> <el-button type="text" size="small" @click="editInfoHandle('设备检查项',scope.row)">
<i class="el-icon-edit" style="font-size: 18px"></i> <i class="el-icon-edit" style="font-size: 18px"></i>
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="padding: 10px;"> <div style="padding: 10px;" v-if="prohibited_state">
<el-button type="primary" size="small" :disabled="!selProductProcessData||isEdit" <el-button type="primary" size="small" :disabled="!selProductProcessData||isEdit"
@click="addInfoHandle('设备检查项')"> @click="addInfoHandle('设备检查项')">
添加 添加
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
:header-cell-style="{backgroundColor:'#f5f7fa'}" style="width: 100%"> :header-cell-style="{backgroundColor:'#f5f7fa'}" style="width: 100%">
<el-table-column type="index" label="序号" align="center" width="50"></el-table-column> <el-table-column type="index" label="序号" align="center" width="50"></el-table-column>
<el-table-column prop="name" label="产品不良类型" align="center"></el-table-column> <el-table-column prop="name" label="产品不良类型" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="80"> <el-table-column label="操作" align="center" width="80" v-if="prohibited_state">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="deleteInfoHandle('不良类型',scope.row)"> <el-button type="text" size="small" @click="deleteInfoHandle('不良类型',scope.row)">
<i class="el-icon-delete" style="font-size: 18px"></i> <i class="el-icon-delete" style="font-size: 18px"></i>
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="padding: 10px;"> <div style="padding: 10px;" v-if="prohibited_state">
<el-button type="primary" size="small" key="selected" :disabled="!selProductProcessData" <el-button type="primary" size="small" key="selected" :disabled="!selProductProcessData"
@click="badnessTypeBtnHandle('selected')"> @click="badnessTypeBtnHandle('selected')">
选择不良类型 选择不良类型
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
placeholder="请填写FPY"></el-input> placeholder="请填写FPY"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div <div v-if="prohibited_state"
style="display: flex; align-items: center; justify-content: space-evenly; margin-top: 15px;"> style="display: flex; align-items: center; justify-content: space-evenly; margin-top: 15px;">
<el-button type="primary" :disabled="!(treeActiveData.type=='product')" size="small" <el-button type="primary" :disabled="!(treeActiveData.type=='product')" size="small"
@click="editInfoHandle('生产信息')"> @click="editInfoHandle('生产信息')">
...@@ -321,7 +321,7 @@ ...@@ -321,7 +321,7 @@
<span v-else>[[ scope.row.must?'是':'否']]</span> <span v-else>[[ scope.row.must?'是':'否']]</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="!isEdit" label="操作" align="center" width="80"> <el-table-column v-if="!isEdit && prohibited_state" label="操作" align="center" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="deleteInfoHandle('关键物料',scope.row)"> <el-button type="text" size="small" @click="deleteInfoHandle('关键物料',scope.row)">
<i class="el-icon-delete" style="font-size: 18px"></i> <i class="el-icon-delete" style="font-size: 18px"></i>
...@@ -329,7 +329,7 @@ ...@@ -329,7 +329,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="padding: 10px;"> <div style="padding: 10px;" v-if="prohibited_state">
<el-button type="primary" size="small" :disabled="!selProductProcessData||isEdit" <el-button type="primary" size="small" :disabled="!selProductProcessData||isEdit"
@click="addInfoHandle('关键物料')"> @click="addInfoHandle('关键物料')">
添加 添加
...@@ -665,7 +665,8 @@ ...@@ -665,7 +665,8 @@
qty: [{ required: true, trigger: 'blur', message: '请输入数量' }], qty: [{ required: true, trigger: 'blur', message: '请输入数量' }],
must: [{ required: true, trigger: 'blur', message: '请选择是否必投' }], must: [{ required: true, trigger: 'blur', message: '请选择是否必投' }],
}, },
selProcessHandleItem: null selProcessHandleItem: null,
prohibited_state: false
} }
}, },
computed: { computed: {
...@@ -759,7 +760,7 @@ ...@@ -759,7 +760,7 @@
}).catch(error => { }).catch(error => {
this.errorHandle(error, true) this.errorHandle(error, true)
}) })
this.is_the_operation_prohibited()
}, },
mounted() { mounted() {
// 在 mounted 钩子函数时才显示内容,防止出现白屏问题 // 在 mounted 钩子函数时才显示内容,防止出现白屏问题
...@@ -773,7 +774,22 @@ ...@@ -773,7 +774,22 @@
}, },
methods: { methods: {
// 更新 // 是否只允许查看,不能编辑数据
is_the_operation_prohibited() {
axios({
method: "POST",
url: this.baseURL + "/roke/workstation/craft_design/workstation_verify_if_editable",
data: {
routing_id: this.routingData.routing_id
},
headers: {
'Content-Type': 'application/json',
},
}).then((res) => {
this.prohibited_state = res.data.result.editable
})
},
// 操作工序后 更新
workstation_work_process_check_work_order() { workstation_work_process_check_work_order() {
axios({ axios({
method: "POST", method: "POST",
......
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