Commit 787de668 by 夏超

[fix] 修改问题

parent 0c8f2476
...@@ -53,8 +53,7 @@ class InheritProductionTask(models.Model): ...@@ -53,8 +53,7 @@ class InheritProductionTask(models.Model):
def _onchange_routing_id(self): def _onchange_routing_id(self):
return super(InheritProductionTask, self)._onchange_routing_id() return super(InheritProductionTask, self)._onchange_routing_id()
def change_routing_id_work_order(self): def change_routing_id_work_order(self, routing):
routing = self.routing_id
product = self.product_id product = self.product_id
plan_qty = self.plan_qty plan_qty = self.plan_qty
task_type = self.type task_type = self.type
...@@ -147,7 +146,7 @@ class InheritProductionTask(models.Model): ...@@ -147,7 +146,7 @@ class InheritProductionTask(models.Model):
"routing_id": routing_id.id, "routing_id": routing_id.id,
}) })
self.write({ self.write({
"work_order_ids": self.change_routing_id_work_order() "work_order_ids": self.change_routing_id_work_order(routing_id)
}) })
elif not self.routing_id.routing_task_id or self.routing_id.routing_task_id.id != self.id: elif not self.routing_id.routing_task_id or self.routing_id.routing_task_id.id != self.id:
routing_id = self.routing_id.copy() routing_id = self.routing_id.copy()
...@@ -157,7 +156,7 @@ class InheritProductionTask(models.Model): ...@@ -157,7 +156,7 @@ class InheritProductionTask(models.Model):
}) })
self.write({"routing_id": routing_id.id}) self.write({"routing_id": routing_id.id})
self.write({ self.write({
"work_order_ids": self.change_routing_id_work_order() "work_order_ids": self.change_routing_id_work_order(routing_id)
}) })
else: else:
routing_id = self.routing_id routing_id = self.routing_id
......
...@@ -69,6 +69,6 @@ class InheritRokeRoutingLineModel(models.Model): ...@@ -69,6 +69,6 @@ class InheritRokeRoutingLineModel(models.Model):
for v in self: for v in self:
if v.routing_id.routing_task_id: if v.routing_id.routing_task_id:
v.routing_id.routing_task_id.write({ v.routing_id.routing_task_id.write({
"work_order_ids": v.routing_id.routing_task_id.change_routing_id_work_order() "work_order_ids": v.routing_id.routing_task_id.change_routing_id_work_order(v.routing_id)
}) })
return res return res
...@@ -141,31 +141,33 @@ ...@@ -141,31 +141,33 @@
<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 label="工艺文件名称" align="center" show-overflow-tooltip> <el-table-column label="工艺文件名称" align="center" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: flex; align-items: center; "> <div style="width: 100%;">
<el-image style="width: 1rem; height: 1rem;margin-right: 5px;" <div>
<el-image style="width: 1rem; height: 1rem;margin-right: 5px;"
:src="baseURL+scope.row.thumbnail" fit="contain"> :src="baseURL+scope.row.thumbnail" fit="contain">
</el-image> </el-image>
[[scope.row.name]] [[scope.row.name]]
</div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上传人" align="center" width="80"> <el-table-column label="上传人" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: flex; align-items: center; "> <div >
[[scope.row.create_user]] [[scope.row.create_user]]
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上传时间" align="center" width="160"> <el-table-column label="上传时间" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: flex; align-items: center; "> <div >
[[dateTimeHandle(scope.row.create_date)]] [[dateTimeHandle(scope.row.create_date)]]
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="文件类型" align="center" width="100"> <el-table-column label="文件类型" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: flex; align-items: center; "> <div >
[[ [[
getFileTypeHandle(scope.row.mimetype)!='其它文件'?getFileTypeHandle(scope.row.mimetype): getFileTypeHandle(scope.row.mimetype)!='其它文件'?getFileTypeHandle(scope.row.mimetype):
getFileSuffixHandle(scope.row.name) ]] getFileSuffixHandle(scope.row.name) ]]
......
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