生产工单添加完成功能
This commit is contained in:
parent
dd0c463b29
commit
f3d8881237
@ -51,3 +51,10 @@ export function listItems(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function dofinish(workorderId){
|
||||||
|
return request({
|
||||||
|
url: '/mes/pro/workorder/'+workorderId,
|
||||||
|
method: 'put'
|
||||||
|
})
|
||||||
|
}
|
@ -179,8 +179,16 @@
|
|||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
v-if="scope.row.status =='CONFIRMED'"
|
v-if="scope.row.status =='CONFIRMED'"
|
||||||
@click="handleAdd(scope.row)"
|
@click="handleAdd(scope.row)"
|
||||||
v-hasPermi="['mes:pro:workorder:add']"
|
v-hasPermi="['mes:pro:workorder:update']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-circle-check"
|
||||||
|
v-if="scope.row.status =='CONFIRMED'"
|
||||||
|
@click="handleFinish(scope.row)"
|
||||||
|
v-hasPermi="['mes:pro:workorder:update']"
|
||||||
|
>完成</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@ -350,7 +358,7 @@
|
|||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button>
|
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button>
|
||||||
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">确 定</el-button>
|
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">确 定</el-button>
|
||||||
<el-button type="success" @click="handleFinish" v-if="form.status =='PREPARE' && optType !='view' && form.workorderId !=null">完成</el-button>
|
<el-button type="success" @click="handleConfirm" v-if="form.status =='PREPARE' && optType !='view' && form.workorderId !=null">完成</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -358,7 +366,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listWorkorder, getWorkorder, delWorkorder, addWorkorder, updateWorkorder } from "@/api/mes/pro/workorder";
|
import { listWorkorder, getWorkorder, delWorkorder, addWorkorder, updateWorkorder ,dofinish} from "@/api/mes/pro/workorder";
|
||||||
import Workorderbom from "./bom/bom.vue";
|
import Workorderbom from "./bom/bom.vue";
|
||||||
import WorkorderItemList from "./items/item.vue";
|
import WorkorderItemList from "./items/item.vue";
|
||||||
import ItemSelect from "@/components/itemSelect/single.vue";
|
import ItemSelect from "@/components/itemSelect/single.vue";
|
||||||
@ -639,13 +647,22 @@ export default {
|
|||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `workorder_${new Date().getTime()}.xlsx`)
|
}, `workorder_${new Date().getTime()}.xlsx`)
|
||||||
},
|
},
|
||||||
handleFinish(){
|
handleConfirm(){
|
||||||
let that = this;
|
let that = this;
|
||||||
this.$modal.confirm('是否完成工单编制?【完成后将不能更改】').then(function(){
|
this.$modal.confirm('是确认完成工单编制?【确认后将不能更改】').then(function(){
|
||||||
that.form.status = 'CONFIRMED';
|
that.form.status = 'CONFIRMED';
|
||||||
that.submitForm();
|
that.submitForm();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleFinish(row){
|
||||||
|
const workorderIds = row.workorderId || this.ids;
|
||||||
|
this.$modal.confirm('确认完成工单?一旦完成,此工单将无法继续报工').then(function() {
|
||||||
|
return dofinish(workorderIds) //完成工单
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("更改成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
//物料选择弹出框
|
//物料选择弹出框
|
||||||
onItemSelected(obj){
|
onItemSelected(obj){
|
||||||
if(obj != undefined && obj != null){
|
if(obj != undefined && obj != null){
|
||||||
|
Loading…
Reference in New Issue
Block a user