Commit ae989824 authored by 周远喜's avatar 周远喜

portal 无关内容删除

parent c5404559
<template>
<div class="parameter">
<Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row :gutter="20">
<Col span="12">
<div class="left-up">
<p class="title-c">参数设置</p>
<FormItem :label="l('plan_method')" prop="plan_method">
<i-switch v-model="entity.plan_method" size="large">
<span slot="open">On</span>
<span slot="close">Off</span>
</i-switch>
</FormItem>
<FormItem :label="l('calId')" prop="calId">
<Select v-model="entity.calId" style="width:150px">
<Option
v-for="(item,index) in listCal"
:key="index"
:value="item.calid"
:label="item.calname"
></Option>
</Select>
</FormItem>
<FormItem :label="l('overTime')" prop="overTime">
<i-switch v-model="entity.overTime" size="large">
<span slot="open">On</span>
<span slot="close">Off</span>
</i-switch>
</FormItem>
<FormItem :label="l('efficiencyValue')" prop="efficiencyValue">
<Input v-model="entity.efficiencyValue" style="width:150px"></Input>
</FormItem>
<FormItem :label="l('run_time')" prop="run_time">
<InputNumber v-model="entity.run_time"></InputNumber>
</FormItem>
<FormItem :label="l('isDiscrete')" prop="isDiscrete">
<i-switch v-model="entity.isDiscrete" size="large">
<span slot="open">On</span>
<span slot="close">Off</span>
</i-switch>
</FormItem>
<FormItem :label="l('discrete')" prop="discrete">
<InputNumber v-model="entity.discrete"></InputNumber>
</FormItem>
<FormItem :label="l('discrete_percent')" prop="discrete_percent">
<InputNumber v-model="entity.discrete_percent"></InputNumber>
</FormItem>
</div>
<div class="left-donw">
<p class="title-c">参数级别</p>
<div class="icon">
<Dropdown trigger="custom" :visible="visible" style="width:150px">
<a href="javascript:void(0)" @click="handleOpen">
<Icon type="md-git-compare" />
</a>
<DropdownMenu slot="list" style="text-align: center;">
<DropdownItem>
<a href="#">
<Icon type="md-apps" />
</a>
<span>转序规则</span>
</DropdownItem>
<DropdownItem>
<a href="#">
<Icon type="md-apps" />
</a>
<span>加班策略</span>
</DropdownItem>
<DropdownItem>
<a href="#">
<Icon type="md-apps" />
</a>
<span>任务平衡</span>
</DropdownItem>
<DropdownItem>
<a href="#">
<Icon type="md-apps" />
</a>
<span>是否离散</span>
</DropdownItem>
<div style="margin:10px;">
<Button type="primary" @click="handleOk">确定</Button>
<Button type="primary" @click="handle">关闭</Button>
</div>
</DropdownMenu>
</Dropdown>
</div>
<div class="slider">
<Slider v-model="entity.value1" :step="25" show-stops></Slider>
<div class="slow"></div>
<div class="fast"></div>
</div>
</div>
</Col>
<Col span="12">
<div class="right-up">
<p class="title-d">多台分配设置</p>
<div class="duo">
<Row>
<Col :span="12">
<FormItem :label="l('multi_machine')" prop="multi_machine">
<i-switch v-model="entity.switch4" size="large">
<span slot="open">On</span>
<span slot="close">Off</span>
</i-switch>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="多台数量" prop="abbre">
<InputNumber v-model="entity.abbre"></InputNumber>
</FormItem>
</Col>
</Row>
<FormItem label="班组结构">
<Select v-model="entity.select6" style="width:150px">
<Option value="beijing">结构1</Option>
<Option value="shanghai">结构2</Option>
<Option value="shenzhen">结构3</Option>
<Option value="shenzhen">结构4</Option>
</Select>
</FormItem>
<div class="check-box">
<CheckboxGroup v-model="entity.fruit">
<Checkbox label="10985553333(数控车床 车工班)"></Checkbox>
<br />
<Checkbox label="10985553333(数控车床 车工班)"></Checkbox>
<br />
<Checkbox label="10985553333(数控车床 车工班)"></Checkbox>
<br />
<Checkbox label="10985553333(数控车床 车工班)"></Checkbox>
<br />
</CheckboxGroup>
</div>
</div>
</div>
<div class="left-donw right-down">
<p class="title-c">参数应用</p>
<div class="slider">
<Slider v-model="entity.value2" :step="33.3" show-stops></Slider>
<div class="slow">工序</div>
<div class="ding">订单</div>
<div class="ling">零件</div>
<div class="fast">所有</div>
</div>
</div>
</Col>
</Row>
<FormItem class="click-btn">
<Button type="primary" @click="handleSubmit">确定</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</div>
</template>
<script>
import Api from "./api";
export default {
data() {
return {
entity: {
value1: 100,
value2: 100,
fruit: []
},
listCal: [],
visible: false,
rules: {
businessName: [{ required: true, message: "必填", trigger: "blur" }],
businessCode: [{ required: true, message: "必填", trigger: "blur" }]
}
};
},
mounted() {
this.getCal();
},
methods: {
getCal() {
Api.getallcal().then(res => {
if (res.success) {
this.listCal = res.result;
}
});
},
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
Api.apsschedulupdateparameter(this.entity).then(res => {
if (res.success) {
}
});
} else {
this.$Message.error("Fail!");
}
});
},
handleClose() {
this.$emit("on-close");
},
handleOpen() {
this.visible = true;
},
handle() {
this.visible = false;
},
handleOk() {},
l(key) {
let vkey = "mes_op_task_plan_simulate" + "." + key;
return this.$t(vkey) || key;
}
}
};
</script>
<style lang="less" scoped>
.parameter {
margin: 10px;
.left-up {
position: relative;
border: 1px solid #e0e0e0;
padding: 25px 0;
.title-c {
width: 68px;
padding-left: 5px;
background: #fff;
position: absolute;
top: -9px;
left: 25px;
color: #2680eb;
}
}
.left-donw {
margin-top: 15px;
position: relative;
border: 1px solid #e0e0e0;
padding: 25px 0;
.title-c {
width: 68px;
padding-left: 5px;
background: #fff;
position: absolute;
top: -9px;
left: 25px;
color: #2680eb;
}
.slider {
margin: 0 50px 0 50px;
position: relative;
.slow {
position: absolute;
top: 7px;
left: -5px;
}
.fast {
position: absolute;
top: 7px;
right: -10px;
}
.ding {
position: absolute;
top: 7px;
left: 30%;
}
.ling {
position: absolute;
top: 7px;
right: 30%;
}
}
.icon {
text-align: right;
padding-right: 15px;
margin-top: -15px;
}
}
.right-up {
position: relative;
border: 1px solid #e0e0e0;
padding: 25px 0;
.title-d {
width: 95px;
padding-left: 5px;
margin-left: 10px;
background: #fff;
position: absolute;
top: -9px;
left: 25px;
color: #2680eb;
}
.check-box {
height: 348px;
border-top: 1px solid #e0e0e0;
padding: 15px;
padding-left: 0;
margin-left: 25px;
overflow: auto;
}
}
.right-down {
height: 92px;
}
.click-btn {
text-align: right;
margin-top: 15px;
}
}
</style>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${resourceUrl}mesparttaskplansimulate/paged`,
paged(params) {
return Api.post(`${resourceUrl}mesparttaskplansimulate/paged`, params);
},
get(params) {
return Api.get(`${resourceUrl}mesparttaskplansimulate/get`, params);
},
create(params) {
return Api.post(`${resourceUrl}mesparttaskplansimulate/create`, params);
},
update(params) {
return Api.post(`${resourceUrl}mesparttaskplansimulate/update`, params);
},
//删除:
delete(params) {
return Api.delete(`${resourceUrl}mesparttaskplansimulate/delete`, {
params: params
});
},
//获取排产池数据列表
getall() {
return Api.get(`${apsUrl}/Mes_part_task_plan_simulate/getall`);
},
//点开排产池列表查看对应的工序
getbyorderid(params) {
return Api.get(`${apsUrl}/mes_op_task_plan_simulate/getbyorderid`, params);
},
//订单优先级
orderpriority(params) {
return Api.post(`${apsUrl}/apspoolappservices/orderpriority`, params);
},
//删除工序
removeoptasksimluate(params) {
return Api.post(`${apsUrl}/apspoolappservices/removeoptasksimluate`, params);
},
//恢复工艺
recoveryoptasksimluate(params) {
return Api.post(`${apsUrl}/apspoolappservices/recoveryoptasksimluate`, params);
},
//移出排产池
shiftoutapspool(params) {
return Api.post(`${apsUrl}/apspoolappservices/shiftoutapspool`, params);
},
//排产计算
apsprepareandcalc(params) {
return Api.post(`${apsUrl}/apspoolappservices/apsprepareandcalc`, params);
},
//排产方案下发
processschemedispatch(params) {
return Api.post(`${apsUrl}/apspoolappservices/processschemedispatch`, params);
},
//APS排产前数据合法性校验
apsdatachecked(params) {
return Api.post(`${apsUrl}/apspoolappservices/apsdatachecked`, params);
},
//获取连班策略
getallcal(params) {
return Api.get(`${apsUrl}/mes_daily_work_sched/getallcal`, params);
},
//工序参数调整
apsschedulupdateparameter(params) {
return Api.post(`${apsUrl}/ser/apsschedulupdateparameter`, params);
},
}
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row>
<Col :span="12">
<FormItem :label="l('tASKSEQ')" prop="tASKSEQ">
<Input></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('tASKNAME')" prop="tASKNAME">
<Input></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('sHOPID')" prop="sHOPID">
<!-- v-model="orderSearchForm.orderCat" -->
<Select >
<Option value="" class="option-text">请选择</Option>
<Option v-for="item in orderCatList" :value="item" :key="item">{{ item }}</Option>
</Select>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('eQUIPID')" prop="eQUIPID">
<Select >
<Option value="" class="option-text">请选择</Option>
<Option v-for="item in orderCatList" :value="item" :key="item">{{ item }}</Option>
</Select>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="关重资源名称" prop="rUNTIME">
<Select >
<Option value="" class="option-text">请选择</Option>
<Option v-for="item in orderCatList" :value="item" :key="item">{{ item }}</Option>
</Select>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('rUNTIME')" prop="rUNTIME">
<!-- v-model="value1" -->
<InputNumber :max="100" :min="1"></InputNumber>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from '../api'
export default {
name: 'Edit',
data() {
return {
disabled: false,
entity: {},
orderCatList:[
],
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
methods: {
load(v) {
// Api.get({ id: v }).then((r) => {
// this.entity = r.result
// this.$emit('on-load')
// })
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
Api.update(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'mes_op_task_execute' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
<template>
<div style="padding:0">
<DataGrid
style="margin-top:-25px;margin-bottom:-25px"
:columns="columns"
ref="grid"
:easy="false"
:high="false"
:set="false"
:border="false"
:data="data1"
:page="false"
:height="gridHeight"
></DataGrid>
<Modal v-model="editModal" title="编辑" footer-hide width="800">
<Edit :eid="curId" @on-close="cancel" />
</Modal>
<Modal v-model="insertlModal" title="插单" @on-ok="insertOk" @on-cancel="cancel">
<p>确定进行 {{insertTItle}} 操作?</p>
</Modal>
<Modal v-model="setParsModal" title="工序参数设置" footer-hide width="1000">
<Add :eid="curId" @on-close="cancel" />
</Modal>
</div>
</template>
<script>
import Api from "../api";
import Edit from "./edit";
import Add from "../add";
export default {
name: "list",
components: {
Edit,
Add
},
props: {
rowId: { type: Number }
},
data() {
return {
action: Api.index,
easySearch: {
keys: {
op: "task_seq",
value: null
}
},
setParsModal: false,
editModal: false,
detailModal: false,
insertlModal: false,
rowIndex: null,
curId: 0,
gridHeight: 50,
columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" },
{ title: " ", width: 130 },
{
key: "insert_flag",
title: this.l("insert_flag"),
align: "center",
high: true,
width: 60,
render: (h, params) => {
return h("Icon", {
attrs: {
type:
params.row.insert_flag == 1 ? "ios-flag" : "ios-flag-outline",
size: 20,
color: params.row.insert_flag == 1 ? "#2680EB" : "#aaa"
},
on: { click: () => this.changeFlag(params.row.id, params.index) }
});
}
},
{
key: "task_seq",
title: this.l("task_seq"),
align: "left",
easy: true,
high: true
},
{
key: "op_task_pk",
title: this.l("op_task_pk"),
align: "left",
high: true,
hide: true
},
{
key: "task_name",
title: this.l("task_name"),
align: "left",
easy: true,
high: true
},
{
key: "part_task_pk",
title: this.l("part_task_pk"),
align: "left",
high: true,
hide: true
},
{
key: "put_into_qty",
title: this.l("put_into_qty"),
align: "left",
high: true
},
{
key: "plan_start",
title: this.l("plan_start"),
align: "center",
high: true,
width: 140
},
{
key: "plan_finish",
title: this.l("plan_finish"),
align: "center",
high: true,
width: 140
},
{
key: "setup_time",
title: this.l("setup_time"),
align: "right",
high: true
},
{
key: "run_time",
title: this.l("run_time"),
align: "right",
high: true
},
{
key: "outside_time",
title: this.l("outside_time"),
align: "center",
high: true,
width: 140
},
{
key: "transport_time",
title: this.l("transport_time"),
align: "right",
high: true,
hide: true
},
{
key: "check_time",
title: this.l("check_time"),
align: "right",
high: true,
hide: true
},
{
key: "efficiency_value",
title: this.l("efficiency_value"),
align: "right",
high: true
},
{
key: "machine_rule",
title: this.l("machine_rule"),
align: "left",
easy: true,
high: true,
width: 140
},
{
key: "singleout",
title: this.l("singleout"),
align: "left",
high: true,
hide: true
},
{
key: "first_equip",
title: this.l("first_equip"),
align: "left",
easy: true,
high: true,
hide: true
},
{
key: "equip_type",
title: this.l("equip_type"),
align: "left",
easy: true,
high: true,
hide: true
},
{
key: "cal_id",
title: this.l("cal_id"),
align: "left",
easy: true,
high: true
},
{
key: "plan_method",
title: this.l("plan_method"),
align: "left",
easy: true,
high: true
},
{
key: "over_time",
title: this.l("over_time"),
align: "left",
easy: true,
high: true
},
{
key: "isdiscrete",
title: this.l("isdiscrete"),
align: "left",
easy: true,
high: true
},
{
key: "discrete_value",
title: this.l("discrete_value"),
align: "left",
high: true
},
{
key: "multi_machine",
title: this.l("multi_machine"),
align: "left",
easy: true,
high: true
},
{
key: "notes",
title: this.l("notes"),
align: "left",
easy: true,
high: true,
hide: true
},
{
key: "taskseq_des",
title: this.l("taskseq_des"),
align: "left",
easy: true,
high: true,
hide: true
},
{
key: "workshopcode",
title: this.l("workshopcode"),
align: "left",
easy: true,
high: true,
hide: true
},
{
key: "routing_detail_id",
title: this.l("routing_detail_id"),
align: "left",
high: true,
hide: true
},
{
key: "routing_header_id",
title: this.l("routing_header_id"),
align: "left",
high: true,
hide: true
},
{
key: "comb_param",
title: this.l("comb_param"),
align: "left",
easy: true,
high: true,
hide: true
},
{
key: "rule_qty",
title: this.l("rule_qty"),
align: "left",
high: true,
hide: true
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h("op", {
attrs: {
icon: "md-options",
type: "icon",
oprate: "detail",
title: "工序参数设置"
},
on: { click: () => this.openParms(params.row.id) }
}),
h("op", {
attrs: {
icon: "ios-create",
type: "icon",
title: "編輯工序",
oprate: "edit",
msg: "确认要移出排产吗?"
},
on: { click: () => this.edit(params.row.id) }
}),
h("op", {
attrs: {
icon: "ios-trash",
type: "icon",
title: "删除工序",
oprate: "delete",
msg: "确认要刪除工序吗?"
},
on: { click: () => this.remove(params.row, params.index) }
})
]);
}
}
],
data1: [],
insertTItle: "插单",
selectRoutingDetail: {} //需那种工序
};
},
mounted() {
this.loadData(this.rowId);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
//根据点击副组件传过来id进行加载数据
loadData(expendId) {
let params = {
id: expendId
};
Api.getbyorderid(params).then(res => {
if (res.success) {
this.gridHeight = 50;
this.gridHeight = (res.result.length +1) * 48;
this.data1 = res.result;
}
});
},
//插单事件start----
changeFlag(id, index) {
this.rowIndex = index;
if (this.data1[this.rowIndex].insert_flag == 1) {
this.insertTItle = "取消插单";
} else {
this.insertTItle = "插单";
}
this.insertlModal = true;
},
insertOk() {
//this.loadData(this.row)
if (this.data1[this.rowIndex].insert_flag == 1) {
//根据插单数据状态进行插单或取消插单操作
this.data1[this.rowIndex].insert_flag = 0;
} else {
this.data1[this.rowIndex].insert_flag = 1;
}
this.setParsModal = false;
this.detailModal = false;
this.editModal = false;
this.insertlModal = false;
},
//插单事件end----
//单个工序进行参设置start----
openParms(id) {
this.setParsModal = true;
},
//单个工序进行参数设置end----
//编辑工序start----
edit(id) {
this.editModal = true;
this.curId = Number(id);
},
//编辑工序end----
//删除工序事件start-----
remove(row, index) {
//this.curId = Number(id);
this.rowIndex = index;
this.selectRoutingDetail = row;
let params = {
partPk: this.selectRoutingDetail.part_task_pk,
detailIdstr: this.selectRoutingDetail.routing_detail_id
};
Api.removeoptasksimluate(params).then(r => {
if (r.success) {
this.$Message.success("删除成功");
this.data1.splice(this.rowIndex, 1);
}
});
},
//删除工序时间end-----
cancel() {
this.curId = 0;
this.setParsModal = false;
this.detailModal = false;
this.editModal = false;
this.deletedlModal = false;
this.insertlModal = false;
},
l(key) {
let vkey = "mes_op_task_plan_simulate" + "." + key;
return this.$t(vkey) || key;
}
}
};
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<div>
<DataGrid
:columns="columns"
ref="grid"
:draggable="true"
:data="list"
:high="false"
@on-drag-drop="onDragDrop"
:page="false"
@on-selection-change="onSelect"
:batch="true"
:border="false"
:easy="false"
>
<template slot="easySearch"></template>
<template slot="searchBack">
<Select placeholder="选择历史方案" style="width: 150px"></Select>
<DatePicker type="date" placeholder="设置基准日期" style="width: 150px"></DatePicker>
<a style="font-weight:bold" @click="addModal=true">
<Icon type="ios-options" size="14" />&nbsp;工序参数调整
</a>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="apsModal=true">APS排产</Button>
</template>
<template slot="batch">
<Button type="primary" class="mr10 ml10" @click="removeOk">移出排产</Button>
</template>
</DataGrid>
<Modal v-model="addModal" title="工序参数设置" footer-hide width="1000">
<Add @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="apsModal" title="确定APS排产" @on-ok="removeOk" @on-cancel="cancel">
<p>确定进行APS排产?</p>
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Add from "./add";
import Expand from "./components/excute";
export default {
name: "list",
components: {
Add,
Expand
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "notes", value: null }
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
apsModal: false,
list: [],
curId: 0,
columns: [
{
key: "move",
title: " ",
hide: false,
align: "center",
width: 30,
render: (h, params) => {
return h("Icon", {
attrs: {
type: "md-more",
size: 18
},
class: "drag"
});
}
},
{
type: "expand",
width: 50,
render: (h, params) => {
return h(Expand, {
props: {
rowId: params.row.part_task_pk
}
});
}
},
{
key: "selection",
type: "selection",
width: 50,
align: "center"
},
{
key: "id",
title: this.l("id"),
hide: true,
align: "left",
sortable: true,
width: 50
},
{
key: "insert_flag",
title: this.l("insert_flag"),
align: "center",
width: 70,
high: true,
code: "aps.aps.insert_flag",
category: "icon"
},
{
key: "part_task_pk",
title: this.l("part_task_pk"),
align: "left",
high: true
},
{
key: "priority",
title: this.l("priority"),
align: "left",
high: true,
render: (h, params) => {
return h("span", {
},params.index+1);
}
},
{
key: "plan_qty",
title: this.l("plan_qty"),
align: "left",
high: true,
sortable: true
},
{
key: "spare_qty",
title: this.l("spare_qty"),
align: "left",
high: true
},
{
key: "plan_start",
title: this.l("plan_start"),
align: "center",
high: true,
resizable: true,
width: 140
},
{
key: "plan_finish",
title: this.l("plan_finish"),
align: "center",
high: true,
sortable: true,
resizable: true,
width: 140
},
{
key: "notes",
title: this.l("notes"),
align: "left",
easy: true,
high: true,
hide: true
},
{
key: "demand_start",
title: this.l("demand_start"),
align: "center",
hide: true,
resizable: true,
width: 100
},
{
key: "demand_finish",
title: this.l("demand_finish"),
align: "center",
high: true,
resizable: true,
width: 140
},
{
key: "badjustflag",
title: this.l("badjustflag"),
align: "left",
high: true
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
// fixed:"right",
render: (h, params) => {
return h("div", { class: "action" }, [
h("op", {
attrs: {
icon: "md-options",
type: "icon",
title: "工序参数设置"
},
on: { click: () => this.openParms(params.row.id) }
}),
h("op", {
attrs: {
icon: "md-return-left",
type: "icon",
title: "移出排产池",
oprate: "delete",
msg: "确认要移出排产吗?"
},
on: { click: () => this.remove(params.row.part_task_pk) }
}),
h("op", {
attrs: {
icon: "md-refresh",
type: "icon",
title: "恢复工序",
oprate: "delete",
msg: "确认要恢复工序吗?"
},
on: { click: () => this.refresh(params.row.part_task_pk) }
})
]);
}
}
],
arrPartPkId:[]
};
},
mounted() {
this.loadList();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
//排产池加载数据列表
loadList() {
Api.getall().then(res => {
if (res.success) {
this.list = res.result;
}
});
},
addOk() {
this.$refs.grid.load();
this.addModal = false;
this.detailModal = false;
this.editModal = false;
this.curId = 0;
},
detail(id) {
this.detailModal = true;
this.curId = id;
},
edit(id) {
this.editModal = true;
this.curId = id;
},
refresh(partPkId) {//恢复工序
let params = {
id: partPkId
};
Api.recoveryoptasksimluate(params).then(r => {
if (r.success) {
this.$Message.success("恢复成功");
this.loadList();
}
});
},
remove(partPkId) {//移出排产池
let paramsArry = [];
if (partPkId.constructor == Array) {
paramsArry = partPkId;
} else {
paramsArry.push(partPkId);
}
let params={
partPks:paramsArry
}
Api.shiftoutapspool(params).then(r => {
if (r.success) {
this.$Message.success("移出排产池操作成功");
this.loadList();
}
});
},
onSelect(a, b) {//批量选择
let selectRows = a;
this.arrPartPkId = [];
selectRows.forEach(e => {
this.arrPartPkId.push(e.part_task_pk);
});
},
removeOk() {//批量选择移出排产池
this.remove(this.arrPartPkId);
},
removeCancel() {
this.deletelModal = false;
},
cancel() {
this.curId = 0;
this.addModal = false;
this.detailModal = false;
this.editModal = false;
this.deletedlModal = false;
this.apsModal = false;
},
onDragDrop(a, b) {
this.list.splice(b, 1, ...this.list.splice(a, 1, this.list[b]));
},
openParms(id) {
this.addModal = true;
},
l(key) {
let vkey = "mes_part_task_plan_simulate" + "." + key;
return this.$t(vkey) || key;
}
}
};
</script>
<style lang="less">
.drag {
cursor: move;
}
</style>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${PlanUrl}/mesorder/planpaged`,
// 获取当前登录用户信息
getUserInfo(params) {
return Api.get(`${systemUrl}/user/getuserinfo`, params);
},
// 获取人员列表信息
getUser(params) {
return Api.post(`${systemUrl}/user/getselectuser`, params);
},
// 获取用户所在车间
getUserDepartment(params){
return Api.get(`${systemUrl}/user/getuserdepartment`, params);
},
// 获取用户所有设备
getlistall(params){
return Api.get(`${systemUrl}/equipinfo/getlistall`, params);
},
// 获取用户班组工单
getEntryList(params){
return Api.get(`${PlanUrl}/teamsdispatchs/getentrylist`, params);
},
// 派工接口(保存)
saveTeamentry(params){
return Api.post(`${PlanUrl}/teamsdispatchs/saveteamentry`, params);
},
//删除:
delete(params) {
return Api.delete(`${PlanUrl}/mesorder/delete`, {
params: params
});
},
}
\ No newline at end of file
.dispatch{
padding: 12px 5px;
.footer02 {
background: #4c5968;
opacity: 0.9;
position: absolute;
bottom: 0;
box-shadow: 0px -5px 6px rgba(0,0,0,0.3);
width: 98%;
z-index: 99;
padding: 10px;
color: #fff;
margin: 10px 0 10px 0;
}
}
.dispatch_part{
border: 1px solid #ccc;
height: 100%;
.dispatch_part_top{
height: 50px;
line-height: 50px;
padding: 0 0 0 12px;
background: #F5F6FA;
.check{
position: absolute;
top: 0;
right: 24px;
}
}
.dispatch_part_body{
padding: 10px;
overflow-y: auto;
.dispatch_card{
margin: 10px 0;
.card{
.card_top{
.label{
cursor: pointer;
}
}
.ivu-card-head{
background: #2d8cf0!important;
}
}
.g_title{
color: #2d8cf0;
}
}
.dispatch_card02{
margin: 10px 0;
// padding-left: 0!important;
// padding-right: 0!important;
.man_body{
max-width: 185px;
label{
border-radius: 24px;
width: 100%;
height: 50px;
line-height: 47px;
span.ivu-checkbox{
.ivu-checkbox-inner{
margin-top: -42px!important;
}
}
span{
// overflow: hidden;
// text-overflow: ellipsis;
// -o-text-overflow: ellipsis;
// white-space:nowrap;
// display: inline-block;
height: 50px;
}
.svg_name{
width: 50px;
}
.svg{
width: 70px;
}
}
}
}
}
}
.drawer_midell{
.drawer_center{
text-align: center;
padding: 10px;
color: #2d8cf0;
.color{
color: #2d8cf0;
}
}
}
.drawer_box{
.drawer_row_title{
width: 100px;
height: 40px;
float: left;
margin: 2px 0 0;
font-weight: 600;
}
.drawer_midell{
// height: 120px;
// margin: 20px 0;
.drawer_center{
text-align: center;
padding: 10px;
color: #2d8cf0;
.color{
color: #2d8cf0;
}
}
}
.drawer_row_textarea{
width: 550px;
textarea{
max-height: 200px;
}
}
.drawer_footer{
width: 100%;
position: absolute;
bottom: 0;
left: 0;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
background: #fff;
}
}
\ No newline at end of file
<style lang="less" scoped>
@import './dispatch.less';
</style>
<template>
<div class="dispatch myBug">
<Row :gutter="20">
<Col span="15">
<div class="dispatch_part">
<p class="dispatch_part_top">
<b class="mr10">工单列表</b>
<RadioGroup v-model="status" type="button" size="small" @on-change="changeStatus">
<!-- <Radio label="0">全部</Radio> -->
<Radio label="1">未排产</Radio>
<Radio label="2">已排产</Radio>
</RadioGroup>
{{listTask.length}}
</p>
<div class="dispatch_part_body" :style="{height:byheight}">
<!-- {{ids}} -->
<Row :gutter="15" class="card_body01">
<Col span="8" class="dispatch_card" v-for="(item,index) in listTask" :key="index">
<Card>
<p slot="title" class="card_top">
<Checkbox
v-model="item.checked"
:disabled="item.dispatchStatus==2"
>工单号:{{item.mesCode}}</Checkbox>
</p>
<div class="h60">
<p class="g_title">{{item.productName}}--{{item.equipCode}}</p>
<p>
<Icon type="ios-pricetags" />
工序{{item.process_seq}}{{item.process_name}}
</p>
<p>{{item.beginTime}}--{{item.endTime}}</p>
</div>
</Card>
</Col>
</Row>
</div>
</div>
</Col>
<Col span="9">
<div class="dispatch_part">
<p class="dispatch_part_top">
<b class="mr10">{{button2}}列表</b>
<span v-if="button2 == '设备'">{{listSheBei.length}}</span>
<span v-else-if="button2 == '人员'">{{listMan.length}}</span>
<span class="check">
<RadioGroup v-model="button2" type="button" size="small">
<Radio label="设备" title="设置设备">
<Icon type="logo-linkedin" />
</Radio>
<Radio label="人员" title="设置人员">
<Icon type="ios-man" />
</Radio>
</RadioGroup>
</span>
</p>
<div class="dispatch_part_body" :style="{height:byheight}">
<div class="shebei" v-if="button2 == '设备'">
<Row :gutter="15">
<!-- {{shebeiId}} -->
<span style="display:none">{{shebeiId}}</span>
<Col
span="12"
class="dispatch_card"
v-for="(item,index) in listSheBei"
:key="index">
<Card class="card">
<p slot="title" class="card_top">
<label @click="setShebeiId(item.id)" class="label">
<Icon
type="ios-disc"
size="18"
:color="item.id==shebeiId?'#2d8cf0':'#fff'"
/>
<input
name="shebei"
:value="item.equip_id"
type="radio"
style="display:none"
/>
设备编号:{{item.equip_id}}
</label>
</p>
<div class="h60">
<p class="g_title">{{item.equip_name}}</p>
<p>资源主操:{{item.operatorUsers}}</p>
<p>位置:{{item.locationx}}</p>
<p>状态:{{item.equip_status}}</p>
</div>
</Card>
</Col>
</Row>
</div>
<div class="man" v-if="button2 == '人员'">
<!-- {{peploeId}} @on-change="setpepoleid" @on-change="setpepoleids"-->
<Row :gutter="15">
<Col span="8" class="dispatch_card02" v-for="(item,index) in listMan" :key="index">
<CheckboxGroup class="man_body">
<Checkbox v-model="item.checked" border class>
<span class="svg_name">{{item.userName}}</span>
<span class="svg">{{item.id}}</span>
</Checkbox>
</CheckboxGroup>
</Col>
</Row>
</div>
</div>
</div>
</Col>
</Row>
<FooterToolbar style="height:65px" v-show="showOperate&&footerToolbar">
<Button class="span ml20" type="primary" @click="openDrawer">设置</Button>
<Button @click="footerToolbar=false">取消</Button>
</FooterToolbar>
<Drawer title="排产设置盘" v-model="facilityModal" width="820" class="drawer_box">
<Form ref="formValidate" :model="entity" :rules="ruleValidate" :label-width="100">
<Row>
<Col span="24">
<FormItem label="工时" prop="taskTime">
<DatePicker
v-model="entity.taskTime"
type="datetimerange"
placement="bottom-start"
:options="dateRange"
@on-change="handleChange"
placeholder="请选择时间段"
style="width: 330px"
></DatePicker>
</FormItem>
</Col>
<Col span="24">
<FormItem label="选择人员" prop="userIds" style="width:100%">
<UserSelect
ref="userSelected"
v-model="entity.userIds"
:type="2"
:multiple="true"
style="width: 500px"
/>
</FormItem>
</Col>
<Col span="24" class="drawer_midell">
<p class="drawer_center">
<Icon type="ios-stats" class="color" />数据分析图表
</p>
</Col>
<Col span="24">
<FormItem label="备注" style="width:100%">
<Input
maxlength="200"
v-model="entity.remark"
type="textarea"
:autosize="{minRows: 3,maxRows: 5}"
show-word-limit
class="drawer_row_textarea"
/>
</FormItem>
</Col>
</Row>
<FormItem>
<Button style="margin-right: 8px" @click="cancle">取消</Button>
<Button type="primary" @click="sendSheBei">派工</Button>
</FormItem>
</Form>
</Drawer>
<!-- 人员抽屉 -->
<Drawer title="排产设置盘" v-model="manModal" width="820" class="drawer_box">
<Form ref="formpepole" :model="pentity" :rules="rulepepole" :label-width="100">
<Row>
<Col span="24">
<FormItem label="工时" prop="taskTime">
<DatePicker
v-model="pentity.taskTime"
type="datetimerange"
placement="bottom-start"
:options="dateRange"
@on-change="handleChange"
placeholder="请选择时间段"
style="width: 330px"
></DatePicker>
</FormItem>
</Col>
<Col span="24" class="drawer_midell">
<p class="drawer_center">
<Icon type="ios-stats" class="color" />数据分析图表
</p>
</Col>
<Col span="24">
<FormItem label="备注" style="width:100%">
<Input
maxlength="200"
v-model="pentity.remark"
type="textarea"
:autosize="{minRows: 3,maxRows: 5}"
show-word-limit
class="drawer_row_textarea"
/>
</FormItem>
</Col>
</Row>
<FormItem>
<Button style="margin-right: 8px" @click="cancle">取消</Button>
<Button type="primary" @click="sendUser">派工</Button>
</FormItem>
</Form>
</Drawer>
</div>
</template>
<script>
import Api from './api'
export default {
components: { },
data() {
return {
action: Api.index,
toheight: '500px',
byheight: '450px',
button1: '全部',
button2: '设备',
shebei: '',
dateRange: {
//禁选工时时间区间
disabledDate(date) {
return date && date.valueOf() < Date.now() - 86400000
}
},
shebeiId: -1,
footerToolbar: false,
status: '1', //排产状态
footerMore: true, //CheckItem!=null&&CheckItem!=''
footerModel: false, //底部按钮
facilityModal: false, //设备抽屉
manModal: false, //人员抽屉
listSheBei: [], //设备列表
listMan: [], //人员列表
listTask: [], //工单列表数据
newList: [], //选中数据
entity: {
taskTime: '', //工时
userIds: null, //选中人员
remark: '' //备注
},
ruleValidate: {
taskTime: [{
required: true,
type: 'array',
message: "请选择工时时间段",
trigger: 'blur',
fields: {
0: {type: "date", required: true, message: "请选择工时时间段"},
1: {type: "date", required: true, message: "请选择工时时间段"}
}
}],
userIds: [
{
required: true,
message: '请选择人员!',
trigger: 'blur',
type: 'array'
}
]
},
pentity: {
taskTime: '', //工时
remark: '' //备注
},
rulepepole:{
taskTime: [{
required: true,
type: 'array',
message: "请选择工时时间段",
trigger: 'blur',
fields: {
0: {type: "date", required: true, message: "请选择工时时间段"},
1: {type: "date", required: true, message: "请选择工时时间段"}
}
}]
},
}
},
created() {
this.getUserInfoFn()
this.byheight = window.innerHeight - 208 + 'px'
},
mounted() {
this.byheight = window.innerHeight - 208 + 'px'
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
getUserInfoFn() {
let userId = this.$store.state.userInfo.userId
let infoid, departId
Api.getUserDepartment({ userId: userId }).then((res) => {
if (res.success) {
infoid = res.result.id
} else {
infoid = []
this.$Message.error('查询失败!')
}
})
Api.getUserInfo({ id: userId }).then((res) => {
if (res.success) {
departId = res.result.departmentId
this.getEntryList(departId)
this.getselectuser(departId)
this.getlistall(departId)
} else {
departId = ''
this.$Message.error('查询失败!')
}
})
},
setShebeiId(id) {
this.shebeiId = id
this.footerToolbar = true
},
// 获取查询人员 listTask
getselectuser(id) {
let parme = { departmentId: id, type: '2' }
Api.getUser(parme).then((res) => {
res.result.map((u) => {
u.checked = false
})
this.listMan = res.result
})
},
// 获取查询设备
getlistall(id) {
let parme = { shopid: id }
Api.getlistall(parme).then((res) => {
res.result.map((u) => {
u.checked = false
})
this.listSheBei = res.result
})
},
// 获取用户工单 JSON.stringify(parme)
getEntryList(id) {
let parme = { departmentId: id, DispatchStatus: this.status }
Api.getEntryList(parme).then((res) => {
this.listTask = res.result
})
},
// 时间改变方法
handleChange(daterange) {
this.newList.map((u) => {
u.beginTime = daterange[0]
u.endTime = daterange[1]
})
},
handleChangeTime(time) {
this.newList.map((u) => {
u.beginTime = time[0]
u.endTime = time[1]
})
},
// 过滤条件
changeStatus(a) {
this.getUserInfoFn()
},
// 打开抽屉
openDrawer() {
if (this.button2 == '设备') {
this.facilityModal = true
} else {
this.manModal = true
}
let chekids = this.ids
let formData = this.listTask
this.newList = []
chekids.forEach((v) => {
var item = formData.filter((u) => {
return u.id == v
})
if (item && item[0]) {
this.newList.push(item[0])
}
})
console.log('选中的数据', this.newList)
},
// 设备派工
sendSheBei() {
let item = this.newList
item.map((u) => {
u.userIds = this.entity.userIds
})
this.$refs['formValidate'].validate((valid) => {
if(valid){
Api.saveTeamentry(item).then((res) => {
if (res.success) {
this.$Message.success('设备派工成功。')
} else {
this.$Message.error('设备派工失败...')
}
})
}else{
this.$Message.error('校验不通过...')
}
})
},
// 人员派工
sendUser() {
let item = this.newList
item.map((u) => {
u.userIds = this.peploeId
})
this.$refs['formpepole'].validate((valid) => {
if(valid){
Api.saveTeamentry(item).then((res) => {
if (res.success) {
this.$Message.success('人员派工成功。')
this.manModal = false
} else {
this.$Message.error('人员派工失败...')
}
})
}else{
this.$Message.error('校验不通过...')
}
})
},
cancle() {
//取消
this.facilityModal = false
this.manModal = false
this.footerToolbar=false
},
},
computed: {
ids() {
let ids = []
this.listTask.map((u) => {
if (u.checked) {
ids.push(u.id)
}
})
if (ids.length > 0) {
this.footerToolbar = true
}
return ids
},
peploeId() {
let peploeId = []
this.listMan.map((u) => {
if (u.checked) {
peploeId.push(u.id)
}
})
this.footerToolbar = true
return peploeId
},
showOperate() {
return this.ids.length > 0 && (this.shebeiId > 0 || this.peploeId.length >0)
}
},
watch:{},
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('upId')" prop="upId">
<InputNumber v-model="entity.upId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mesCode')" prop="mesCode">
<Input v-model="entity.mesCode"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('taskType')" prop="taskType">
<Input v-model="entity.taskType"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('productId')" prop="productId">
<InputNumber v-model="entity.productId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('stage')" prop="stage">
<Input v-model="entity.stage"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('materialId')" prop="materialId">
<Input v-model="entity.materialId"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('quantity')" prop="quantity">
<InputNumber v-model="entity.quantity"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('guestName')" prop="guestName">
<Input v-model="entity.guestName"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('printSupply')" prop="printSupply">
<Input v-model="entity.printSupply"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('functionaryOffice')" prop="functionaryOffice">
<Input v-model="entity.functionaryOffice"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mainDepartmentId')" prop="mainDepartmentId">
<Input v-model="entity.mainDepartmentId"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('taskInputDate')" prop="taskInputDate">
<DatePicker type="date" v-model="entity.taskInputDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('taskRequire')" prop="taskRequire">
<Input v-model="entity.taskRequire"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('putintDocmentCode')" prop="putintDocmentCode">
<Input v-model="entity.putintDocmentCode"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('technologyDocmentCode')" prop="technologyDocmentCode">
<Input v-model="entity.technologyDocmentCode"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('outerDrawnNumber')" prop="outerDrawnNumber">
<Input v-model="entity.outerDrawnNumber"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('modelVersion')" prop="modelVersion">
<Input v-model="entity.modelVersion"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('taskCode')" prop="taskCode">
<Input v-model="entity.taskCode"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('designer')" prop="designer">
<Input v-model="entity.designer"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('officeFunctionary')" prop="officeFunctionary">
<Input v-model="entity.officeFunctionary"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mainRoutingPeople')" prop="mainRoutingPeople">
<Input v-model="entity.mainRoutingPeople"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="mes_xingchi_plan.mes_order.status" v-model="entity.status"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('workHours')" prop="workHours">
<InputNumber v-model="entity.workHours"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('printPeriod')" prop="printPeriod">
<InputNumber v-model="entity.printPeriod"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('equipment')" prop="equipment">
<Input v-model="entity.equipment"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('materialWeight')" prop="materialWeight">
<InputNumber v-model="entity.materialWeight"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isSupportingFinish')" prop="isSupportingFinish">
<Dictionary
code="mes_xingchi_plan.mes_order.is_supporting_finish"
v-model="entity.isSupportingFinish"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('demandStartDate')" prop="demandStartDate">
<DatePicker type="date" v-model="entity.demandStartDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('demandFinishDate')" prop="demandFinishDate">
<DatePicker type="date" v-model="entity.demandFinishDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('actualStartDate')" prop="actualStartDate">
<DatePicker type="date" v-model="entity.actualStartDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('actualFinishDate')" prop="actualFinishDate">
<DatePicker type="date" v-model="entity.actualFinishDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<Dictionary code="mes_xingchi_plan.mes_order.is_deleted" v-model="entity.isDeleted"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('orderQuotationStatus')" prop="orderQuotationStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.order_quotation_status"
v-model="entity.orderQuotationStatus"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('distributeMainRouting')" prop="distributeMainRouting">
<InputNumber v-model="entity.distributeMainRouting"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mainRoutingFinishDate')" prop="mainRoutingFinishDate">
<DatePicker type="date" v-model="entity.mainRoutingFinishDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('majorRoutingPeople')" prop="majorRoutingPeople">
<InputNumber v-model="entity.majorRoutingPeople"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('majorRoutingFinishDate')" prop="majorRoutingFinishDate">
<DatePicker type="date" v-model="entity.majorRoutingFinishDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('checkUpPeople')" prop="checkUpPeople">
<InputNumber v-model="entity.checkUpPeople"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('checkUpFinishDate')" prop="checkUpFinishDate">
<DatePicker type="date" v-model="entity.checkUpFinishDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('productingPreparationPeople')" prop="productingPreparationPeople">
<InputNumber v-model="entity.productingPreparationPeople"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem
:label="l('productingPreparationFinishDate')"
prop="productingPreparationFinishDate"
>
<DatePicker type="date" v-model="entity.productingPreparationFinishDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('quotationPeople')" prop="quotationPeople">
<InputNumber v-model="entity.quotationPeople"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('quotationFinishDate')" prop="quotationFinishDate">
<DatePicker type="date" v-model="entity.quotationFinishDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('routingMethod')" prop="routingMethod">
<Input v-model="entity.routingMethod"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('outerEnvelopeSize')" prop="outerEnvelopeSize">
<Input v-model="entity.outerEnvelopeSize"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('divideMark')" prop="divideMark">
<Dictionary code="mes_xingchi_plan.mes_order.divide_mark" v-model="entity.divideMark"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('productCode')" prop="productCode">
<Input v-model="entity.productCode" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('productName')" prop="productName">
<Input v-model="entity.productName"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('drawnNumber')" prop="drawnNumber">
<Input v-model="entity.drawnNumber"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('qualifiedQuantity')" prop="qualifiedQuantity">
<InputNumber v-model="entity.qualifiedQuantity"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('uncertificateQuantity')" prop="uncertificateQuantity">
<InputNumber v-model="entity.uncertificateQuantity"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mainRoutingSetStatus')" prop="mainRoutingSetStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.main_routing_set_status"
v-model="entity.mainRoutingSetStatus"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('majorRoutingSetStatus')" prop="majorRoutingSetStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.major_routing_set_status"
v-model="entity.majorRoutingSetStatus"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('materialBillSetStatus')" prop="materialBillSetStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.material_bill_set_status"
v-model="entity.materialBillSetStatus"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('routingDataSetStatus')" prop="routingDataSetStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.routing_data_set_status"
v-model="entity.routingDataSetStatus"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('rootId')" prop="rootId">
<InputNumber v-model="entity.rootId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mainRoutingExecuteStatus')" prop="mainRoutingExecuteStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.main_routing_execute_status"
v-model="entity.mainRoutingExecuteStatus"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('majorRoutingExecuteStatus')" prop="majorRoutingExecuteStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.major_routing_execute_status"
v-model="entity.majorRoutingExecuteStatus"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mainRoutingActualStartDate')" prop="mainRoutingActualStartDate">
<DatePicker type="date" v-model="entity.mainRoutingActualStartDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mainRoutingActualFinishDate')" prop="mainRoutingActualFinishDate">
<DatePicker type="date" v-model="entity.mainRoutingActualFinishDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('majorRoutingActualStartDate')" prop="majorRoutingActualStartDate">
<DatePicker type="date" v-model="entity.majorRoutingActualStartDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('majorRoutingActualFinishDate')" prop="majorRoutingActualFinishDate">
<DatePicker type="date" v-model="entity.majorRoutingActualFinishDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('batchNumber')" prop="batchNumber">
<Input v-model="entity.batchNumber"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('projectNumber')" prop="projectNumber">
<Input v-model="entity.projectNumber"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('urgencyLevel')" prop="urgencyLevel">
<Input v-model="entity.urgencyLevel"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('materialName')" prop="materialName">
<Input v-model="entity.materialName"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isPreschedule')" prop="isPreschedule">
<Dictionary
code="mes_xingchi_plan.mes_order.is_preschedule"
v-model="entity.isPreschedule"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('spareQty')" prop="spareQty">
<InputNumber v-model="entity.spareQty"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('demandStart')" prop="demandStart">
<DatePicker type="date" v-model="entity.demandStart"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('demandFinish')" prop="demandFinish">
<DatePicker type="date" v-model="entity.demandFinish"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('partNamePro')" prop="partNamePro">
<Input v-model="entity.partNamePro"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
v: Object
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
Api.create(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'mes_order' + '.' + key
return this.$t(key)
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v)
}
}
}
</script>
import Api from '@/plugins/request'
export default {
index: `${PlanUrl}/mesorders/planpaged`,
paged(params) {
return Api.post(`${PlanUrl}/mesorders/planpaged`, params);
},
get(params){
return Api.get(`${PlanUrl}/mesorders/get`, params);
},
create(params) {
return Api.post(`${PlanUrl}/mesorders/create`, params);
},
update(params) {
return Api.post(`${PlanUrl}/mesorders/update`, params);
},
//删除:
delete(params) {
return Api.delete(`${PlanUrl}/mesorders/delete`, {
params: params
});
},
moveinbatch(params) {//移入排产
return Api.post(`${PlanUrl}/messchedule/moveinbatch`, params);
},
routingdistribute(params) {//工艺派发
return Api.post(`${PlanUrl}/messchedule/routingdistribute`, params);
},
moveintoaps() {//跳转进入排产池前判断
return Api.post(`${PlanUrl}/messchedule/moveintoaps`);
},
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<!-- <Filed :span="12" :name="l('upId')">{{entity.upId}}</Filed> -->
<Filed :span="12" :name="l('mesCode')">{{entity.mesCode}}</Filed>
<Filed :span="12" :name="l('taskType')">{{entity.taskType}}</Filed>
<Filed :span="12" :name="l('productId')">{{entity.productId}}</Filed>
<Filed :span="12" :name="l('stage')">{{entity.stage}}</Filed>
<Filed :span="12" :name="l('materialId')">{{entity.materialId}}</Filed>
<Filed :span="12" :name="l('quantity')">{{entity.quantity}}</Filed>
<Filed :span="12" :name="l('guestName')">{{entity.guestName}}</Filed>
<Filed :span="12" :name="l('printSupply')">{{entity.printSupply}}</Filed>
<Filed :span="12" :name="l('functionaryOffice')">{{entity.functionaryOffice}}</Filed>
<Filed :span="12" :name="l('mainDepartmentId')">{{entity.mainDepartmentId}}</Filed>
<Filed :span="24" :name="l('remark')">{{entity.remark}}</Filed>
<Filed :span="12" :name="l('taskInputDate')">{{entity.taskInputDate}}</Filed>
<Filed :span="12" :name="l('taskRequire')">{{entity.taskRequire}}</Filed>
<Filed :span="12" :name="l('putintDocmentCode')">{{entity.putintDocmentCode}}</Filed>
<Filed :span="12" :name="l('technologyDocmentCode')">{{entity.technologyDocmentCode}}</Filed>
<Filed :span="12" :name="l('outerDrawnNumber')">{{entity.outerDrawnNumber}}</Filed>
<Filed :span="12" :name="l('modelVersion')">{{entity.modelVersion}}</Filed>
<Filed :span="12" :name="l('taskCode')">{{entity.taskCode}}</Filed>
<Filed :span="12" :name="l('designer')">{{entity.designer}}</Filed>
<Filed :span="12" :name="l('officeFunctionary')">{{entity.officeFunctionary}}</Filed>
<Filed :span="12" :name="l('mainRoutingPeople')">{{entity.mainRoutingPeople}}</Filed>
<Filed :span="12" :name="l('status')">{{entity.status}}</Filed>
<Filed :span="12" :name="l('workHours')">{{entity.workHours}}</Filed>
<Filed :span="12" :name="l('printPeriod')">{{entity.printPeriod}}</Filed>
<Filed :span="12" :name="l('equipment')">{{entity.equipment}}</Filed>
<Filed :span="12" :name="l('materialWeight')">{{entity.materialWeight}}</Filed>
<Filed :span="12" :name="l('isSupportingFinish')">{{entity.isSupportingFinish}}</Filed>
<Filed :span="12" :name="l('demandStartDate')">{{entity.demandStartDate}}</Filed>
<Filed :span="12" :name="l('demandFinishDate')">{{entity.demandFinishDate}}</Filed>
<Filed :span="12" :name="l('actualStartDate')">{{entity.actualStartDate}}</Filed>
<Filed :span="12" :name="l('actualFinishDate')">{{entity.actualFinishDate}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="12" :name="l('orderQuotationStatus')">{{entity.orderQuotationStatus}}</Filed>
<Filed :span="12" :name="l('distributeMainRouting')">{{entity.distributeMainRouting}}</Filed>
<Filed :span="12" :name="l('mainRoutingFinishDate')">{{entity.mainRoutingFinishDate}}</Filed>
<Filed :span="12" :name="l('majorRoutingPeople')">{{entity.majorRoutingPeople}}</Filed>
<Filed :span="12" :name="l('majorRoutingFinishDate')">{{entity.majorRoutingFinishDate}}</Filed>
<Filed :span="12" :name="l('checkUpPeople')">{{entity.checkUpPeople}}</Filed>
<Filed :span="12" :name="l('checkUpFinishDate')">{{entity.checkUpFinishDate}}</Filed>
<Filed
:span="12"
:name="l('productingPreparationPeople')"
>{{entity.productingPreparationPeople}}</Filed>
<Filed
:span="12"
:name="l('productingPreparationFinishDate')"
>{{entity.productingPreparationFinishDate}}</Filed>
<Filed :span="12" :name="l('quotationPeople')">{{entity.quotationPeople}}</Filed>
<Filed :span="12" :name="l('quotationFinishDate')">{{entity.quotationFinishDate}}</Filed>
<Filed :span="12" :name="l('routingMethod')">{{entity.routingMethod}}</Filed>
<Filed :span="12" :name="l('outerEnvelopeSize')">{{entity.outerEnvelopeSize}}</Filed>
<Filed :span="12" :name="l('divideMark')">{{entity.divideMark}}</Filed>
<Filed :span="24" :name="l('productCode')">{{entity.productCode}}</Filed>
<Filed :span="12" :name="l('productName')">{{entity.productName}}</Filed>
<Filed :span="12" :name="l('drawnNumber')">{{entity.drawnNumber}}</Filed>
<Filed :span="12" :name="l('qualifiedQuantity')">{{entity.qualifiedQuantity}}</Filed>
<Filed :span="12" :name="l('uncertificateQuantity')">{{entity.uncertificateQuantity}}</Filed>
<Filed :span="12" :name="l('mainRoutingSetStatus')">{{entity.mainRoutingSetStatus}}</Filed>
<Filed :span="12" :name="l('majorRoutingSetStatus')">{{entity.majorRoutingSetStatus}}</Filed>
<Filed :span="12" :name="l('materialBillSetStatus')">{{entity.materialBillSetStatus}}</Filed>
<Filed :span="12" :name="l('routingDataSetStatus')">{{entity.routingDataSetStatus}}</Filed>
<Filed :span="12" :name="l('rootId')">{{entity.rootId}}</Filed>
<Filed :span="12" :name="l('mainRoutingExecuteStatus')">{{entity.mainRoutingExecuteStatus}}</Filed>
<Filed :span="12" :name="l('majorRoutingExecuteStatus')">{{entity.majorRoutingExecuteStatus}}</Filed>
<Filed
:span="12"
:name="l('mainRoutingActualStartDate')"
>{{entity.mainRoutingActualStartDate}}</Filed>
<Filed
:span="12"
:name="l('mainRoutingActualFinishDate')"
>{{entity.mainRoutingActualFinishDate}}</Filed>
<Filed
:span="12"
:name="l('majorRoutingActualStartDate')"
>{{entity.majorRoutingActualStartDate}}</Filed>
<Filed
:span="12"
:name="l('majorRoutingActualFinishDate')"
>{{entity.majorRoutingActualFinishDate}}</Filed>
<Filed :span="12" :name="l('batchNumber')">{{entity.batchNumber}}</Filed>
<Filed :span="12" :name="l('projectNumber')">{{entity.projectNumber}}</Filed>
<Filed :span="12" :name="l('urgencyLevel')">{{entity.urgencyLevel}}</Filed>
<Filed :span="12" :name="l('materialName')">{{entity.materialName}}</Filed>
<Filed :span="12" :name="l('isPreschedule')">{{entity.isPreschedule}}</Filed>
<Filed :span="12" :name="l('spareQty')">{{entity.spareQty}}</Filed>
<Filed :span="12" :name="l('demandStart')">{{entity.demandStart}}</Filed>
<Filed :span="12" :name="l('demandFinish')">{{entity.demandFinish}}</Filed>
<Filed :span="12" :name="l('partNamePro')">{{entity.partNamePro}}</Filed>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'mes_order' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col span="24">
<FormItem :label="l('DistributeMainRouting')" prop="DistributeMainRouting">
<UserSelect ref="userSelected" v-model="entity.DistributeMainRouting" />
</FormItem>
</Col>
<Col span="24">
<FormItem label="完成时间" style="width:100%" prop="MainRoutingFinishDate">
<DatePicker
v-model="entity.MainRoutingFinishDate"
type="datetime"
placeholder="请选择日期"
style="width:240px"
@on-change="getTimeMainRFD"
></DatePicker>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Dispatch',
props: {
ids: Array
},
data() {
return {
disabled: false,
entity: {
DistributeMainRouting: null,
MainRoutingFinishDate: ''
},
rules: {
DistributeMainRouting: [
{
required: true,
message: '请选择人员',
trigger: 'change',
type: 'number'
}
],
MainRoutingFinishDate: [
{
required: true,
message: '请选择时间',
trigger: 'change'
}
]
}
}
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.entity.ids = this.ids
Api.routingdistribute(this.entity)
.then((r) => {
if (r.success) {
this.$Message.success('工艺派发成功')
this.$emit('on-ok')
} else {
this.$Message.error('工艺派发失败')
}
this.$emit('on-ok')
})
.catch((err) => {
this.$Message.error('工艺派发失败')
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'mes_order' + '.' + key
return this.$t(key)
},
getTimeMainRFD(value) {
this.entity.MainRoutingFinishDate = value
}
},
watch: {}
}
</script>
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12"><FormItem :label="l('upId')" prop="upId"> <InputNumber v-model="entity.upId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('mesCode')" prop="mesCode"> <Input v-model="entity.mesCode"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('taskType')" prop="taskType"> <Input v-model="entity.taskType"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('productId')" prop="productId"> <InputNumber v-model="entity.productId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('stage')" prop="stage"> <Input v-model="entity.stage"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('materialId')" prop="materialId"> <Input v-model="entity.materialId"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('quantity')" prop="quantity"> <InputNumber v-model="entity.quantity"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('guestName')" prop="guestName"> <Input v-model="entity.guestName"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('printSupply')" prop="printSupply"> <Input v-model="entity.printSupply"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('functionaryOffice')" prop="functionaryOffice"> <Input v-model="entity.functionaryOffice"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('mainDepartmentId')" prop="mainDepartmentId"> <Input v-model="entity.mainDepartmentId"> </Input>
</FormItem></Col>
<Col :span="24"><FormItem :label="l('remark')" prop="remark"> <Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('taskInputDate')" prop="taskInputDate"> <DatePicker type="date" v-model="entity.taskInputDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('taskRequire')" prop="taskRequire"> <Input v-model="entity.taskRequire"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('putintDocmentCode')" prop="putintDocmentCode"> <Input v-model="entity.putintDocmentCode"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('technologyDocmentCode')" prop="technologyDocmentCode"> <Input v-model="entity.technologyDocmentCode"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('outerDrawnNumber')" prop="outerDrawnNumber"> <Input v-model="entity.outerDrawnNumber"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('modelVersion')" prop="modelVersion"> <Input v-model="entity.modelVersion"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('taskCode')" prop="taskCode"> <Input v-model="entity.taskCode"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('designer')" prop="designer"> <Input v-model="entity.designer"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('officeFunctionary')" prop="officeFunctionary"> <Input v-model="entity.officeFunctionary"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('mainRoutingPeople')" prop="mainRoutingPeople"> <Input v-model="entity.mainRoutingPeople"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('status')" prop="status"> <Dictionary code="mes_xingchi_plan.mes_order.status" v-model="entity.status"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('workHours')" prop="workHours"> <InputNumber v-model="entity.workHours"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('printPeriod')" prop="printPeriod"> <InputNumber v-model="entity.printPeriod"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('equipment')" prop="equipment"> <Input v-model="entity.equipment"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('materialWeight')" prop="materialWeight"> <InputNumber v-model="entity.materialWeight"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isSupportingFinish')" prop="isSupportingFinish"> <Dictionary code="mes_xingchi_plan.mes_order.is_supporting_finish" v-model="entity.isSupportingFinish"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('demandStartDate')" prop="demandStartDate"> <DatePicker type="date" v-model="entity.demandStartDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('demandFinishDate')" prop="demandFinishDate"> <DatePicker type="date" v-model="entity.demandFinishDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('actualStartDate')" prop="actualStartDate"> <DatePicker type="date" v-model="entity.actualStartDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('actualFinishDate')" prop="actualFinishDate"> <DatePicker type="date" v-model="entity.actualFinishDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <Dictionary code="mes_xingchi_plan.mes_order.is_deleted" v-model="entity.isDeleted"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('orderQuotationStatus')" prop="orderQuotationStatus"> <Dictionary code="mes_xingchi_plan.mes_order.order_quotation_status" v-model="entity.orderQuotationStatus"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('distributeMainRouting')" prop="distributeMainRouting"> <InputNumber v-model="entity.distributeMainRouting"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('mainRoutingFinishDate')" prop="mainRoutingFinishDate"> <DatePicker type="date" v-model="entity.mainRoutingFinishDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('majorRoutingPeople')" prop="majorRoutingPeople"> <InputNumber v-model="entity.majorRoutingPeople"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('majorRoutingFinishDate')" prop="majorRoutingFinishDate"> <DatePicker type="date" v-model="entity.majorRoutingFinishDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('checkUpPeople')" prop="checkUpPeople"> <InputNumber v-model="entity.checkUpPeople"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('checkUpFinishDate')" prop="checkUpFinishDate"> <DatePicker type="date" v-model="entity.checkUpFinishDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('productingPreparationPeople')" prop="productingPreparationPeople"> <InputNumber v-model="entity.productingPreparationPeople"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('productingPreparationFinishDate')" prop="productingPreparationFinishDate"> <DatePicker type="date" v-model="entity.productingPreparationFinishDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('quotationPeople')" prop="quotationPeople"> <InputNumber v-model="entity.quotationPeople"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('quotationFinishDate')" prop="quotationFinishDate"> <DatePicker type="date" v-model="entity.quotationFinishDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('routingMethod')" prop="routingMethod"> <Input v-model="entity.routingMethod"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('outerEnvelopeSize')" prop="outerEnvelopeSize"> <Input v-model="entity.outerEnvelopeSize"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('divideMark')" prop="divideMark"> <Dictionary code="mes_xingchi_plan.mes_order.divide_mark" v-model="entity.divideMark"></Dictionary>
</FormItem></Col>
<Col :span="24"><FormItem :label="l('productCode')" prop="productCode"> <Input v-model="entity.productCode" type="textarea" :rows="5"></Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('productName')" prop="productName"> <Input v-model="entity.productName"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('drawnNumber')" prop="drawnNumber"> <Input v-model="entity.drawnNumber"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('qualifiedQuantity')" prop="qualifiedQuantity"> <InputNumber v-model="entity.qualifiedQuantity"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('uncertificateQuantity')" prop="uncertificateQuantity"> <InputNumber v-model="entity.uncertificateQuantity"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('mainRoutingSetStatus')" prop="mainRoutingSetStatus"> <Dictionary code="mes_xingchi_plan.mes_order.main_routing_set_status" v-model="entity.mainRoutingSetStatus"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('majorRoutingSetStatus')" prop="majorRoutingSetStatus"> <Dictionary code="mes_xingchi_plan.mes_order.major_routing_set_status" v-model="entity.majorRoutingSetStatus"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('materialBillSetStatus')" prop="materialBillSetStatus"> <Dictionary code="mes_xingchi_plan.mes_order.material_bill_set_status" v-model="entity.materialBillSetStatus"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('routingDataSetStatus')" prop="routingDataSetStatus"> <Dictionary code="mes_xingchi_plan.mes_order.routing_data_set_status" v-model="entity.routingDataSetStatus"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('rootId')" prop="rootId"> <InputNumber v-model="entity.rootId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('mainRoutingExecuteStatus')" prop="mainRoutingExecuteStatus"> <Dictionary code="mes_xingchi_plan.mes_order.main_routing_execute_status" v-model="entity.mainRoutingExecuteStatus"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('majorRoutingExecuteStatus')" prop="majorRoutingExecuteStatus"> <Dictionary code="mes_xingchi_plan.mes_order.major_routing_execute_status" v-model="entity.majorRoutingExecuteStatus"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('mainRoutingActualStartDate')" prop="mainRoutingActualStartDate"> <DatePicker type="date" v-model="entity.mainRoutingActualStartDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('mainRoutingActualFinishDate')" prop="mainRoutingActualFinishDate"> <DatePicker type="date" v-model="entity.mainRoutingActualFinishDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('majorRoutingActualStartDate')" prop="majorRoutingActualStartDate"> <DatePicker type="date" v-model="entity.majorRoutingActualStartDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('majorRoutingActualFinishDate')" prop="majorRoutingActualFinishDate"> <DatePicker type="date" v-model="entity.majorRoutingActualFinishDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('batchNumber')" prop="batchNumber"> <Input v-model="entity.batchNumber"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('projectNumber')" prop="projectNumber"> <Input v-model="entity.projectNumber"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('urgencyLevel')" prop="urgencyLevel"> <Input v-model="entity.urgencyLevel"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('materialName')" prop="materialName"> <Input v-model="entity.materialName"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isPreschedule')" prop="isPreschedule"> <Dictionary code="mes_xingchi_plan.mes_order.is_preschedule" v-model="entity.isPreschedule"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('spareQty')" prop="spareQty"> <InputNumber v-model="entity.spareQty"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('demandStart')" prop="demandStart"> <DatePicker type="date" v-model="entity.demandStart"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('demandFinish')" prop="demandFinish"> <DatePicker type="date" v-model="entity.demandFinish"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('partNamePro')" prop="partNamePro"> <Input v-model="entity.partNamePro"> </Input>
</FormItem></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Edit',
data() {
return {
disabled: false,
entity: {
},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.$emit('on-load')
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.update(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "mes_order" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
}
}
}
</script>
<template>
<div class="myBug">
<DataGrid
:columns="columns"
ref="grid"
:action="action"
@on-selection-change="selectInfo"
:batch="false"
>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input
search
enter-button
placeholder="请输入关键字订单编号/任务类型/甲方客户/3D打印承制单位(基础数据)/厂内责任机关(基础数据)/厂内主主体责任部门(基础数据)/备注/任务接点要求/上传文件名称/上传文件名称/外部图号/模型号/模型版本/甲方任务号/手输/手输/手输/设备/工艺方法/外包络尺寸(mm)/产品序号:No1~No99///批次号/项目号/紧急程度/材料名称/(APS)产品名称增强"
v-model="easySearch.keys.value"
@on-search="search"
/>
</FormItem>
</Form>
</template>
<template slot="searchBack">
<a href="javascript:;" @click="goAps">APS排产</a>
<a>智能排产</a>
<a>整机排产</a>
<a>流水排产</a>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons"></template>
</DataGrid>
<FooterToolbar extra v-if="footerBar">
<Row>
<Checkbox @on-change="handleSelectAll(single)" v-model="single">全选</Checkbox>
<span class="footerSpan">已选 {{selectCount}} 项</span>
&nbsp;&nbsp;&nbsp;&nbsp;
<Button type="primary" @click="modalDispatch">工艺派发</Button>&nbsp;&nbsp;&nbsp;&nbsp;
<Button type="primary" @click="modalSchedule">移入排产</Button>&nbsp;&nbsp;&nbsp;&nbsp;
<Button @click="canselFooter">取消</Button>
</Row>
</FooterToolbar>
<Modal v-model="addModal" title="新增" footer-hide>
<Add @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="editModal" title="编辑" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="detailModal" title="详情">
<Detail :eid="curId" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
<Modal v-model="dispatchModal" title="工艺派发" footer-hide width="800">
<Dispatch @on-close="cancel" :ids="listBatchIds" @on-ok="addOk" />
</Modal>
<Modal v-model="scheduleModal" title="移入排产" width="800" @on-ok="scheduleOk" @on-cancel="cancel">
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>确定将订单 {{resultsOrderList}} 移入排产?</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Add from "./add";
import Edit from "./edit";
import Detail from "./detail";
import Search from "./search";
import Dispatch from "./dispatch";
export default {
name: "list",
components: {
Add,
Edit,
Detail,
Search,
Dispatch
},
data() {
return {
action: Api.index,
easySearch: {
keys: {
op: "mesCode,taskType,stage,projectNumber,materialName",
value: null
}
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
dispatchModal: false,
scheduleModal: false,
curId: 0,
columns: [
{
type: "selection",
width: 70,
align: "center"
},
{
title: this.l("mesCode"),
key: "mesCode",
width: 240,
align: "left"
},
{
key: "productName",
title: this.l("productName"),
align: "left",
easy: true,
width: 160,
high: true,
tooltip: true
},
{
key: "status",
title: this.l("status"),
align: "center",
high: true,
code: "plan.order.status"
},
{
key: "mainRoutingSetStatus",
title: this.l("mainRoutingSetStatus"),
align: "center",
high: true,
code: "aps.plan.mainRoutingStatus"
},
{
key: "isSupportingFinish",
title: this.l("isSupportingFinish"),
align: "center",
high: true,
code: "aps.plan.supportingStatus"
},
{
key: "projectNumber",
title: this.l("projectNumber"),
align: "left",
easy: true,
high: true
},
{
key: "batchNumber",
title: this.l("batchNumber"),
align: "left",
easy: true,
high: true
},
{
key: "urgencyLevel",
title: this.l("urgencyLevel"),
align: "left",
easy: true,
high: true,
code: "plan.order.urgencyLevel",
},
{
key: "taskType",
title: this.l("taskType"),
align: "left",
easy: true,
high: true,
hide: true,
code: "plan.order.taskType"
},
{
key: "drawnNumber",
title: this.l("drawnNumber"),
align: "left",
easy: true,
high: true
},
{
key: "stage",
title: this.l("stage"),
align: "left",
easy: true,
high: true,
code: "plan.order.stage"
},
{
key: "materialName",
title: this.l("materialName"),
align: "left",
easy: true,
high: true
},
{
key: "quantity",
title: this.l("quantity"),
align: "left",
high: true
},
{
key: "routingMethod",
title: this.l("routingMethod"),
align: "left",
easy: true,
high: true,
code: "plan.order.routingMethod"
},
{
key: "materialWeight",
title: this.l("materialWeight"),
align: "left",
high: true,
hide: true
},
{
key: "productCode",
title: this.l("productCode"),
align: "left",
easy: true,
high: true,
hide: true
},
{
key: "isPreschedule",
title: this.l("isPreschedule"),
align: "left",
high: true,
code: "mes_xingchi_plan.mes_order.is_preschedule",
hide: true
},
{
key: "spareQty",
title: this.l("spareQty"),
align: "left",
high: true,
hide: true
},
{
key: "demandStart",
title: this.l("demandStart"),
align: "left",
high: true,
hide: true
},
{
key: "demandFinish",
title: this.l("demandFinish"),
align: "left",
high: true,
hide: true
},
{
key: "partNamePro",
title: this.l("partNamePro"),
align: "left",
easy: true,
high: true,
hide: true
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
style: {
color: params.row.mainRoutingSetStatus == 0 ? "red" : ""
},
on: {
click: () =>
params.row.mainRoutingSetStatus == 0 ||
params.row.mainRoutingSetStatus == 1
? this.goMethod(params.row)
: null
}
},
params.row.mainRoutingSetStatus == 0
? "工艺派发"
: params.row.mainRoutingSetStatus == 1
? "移入排产"
: ""
)
// h(
// 'op',
// {
// attrs: { oprate: 'edit' },
// on: { click: () => this.edit(params.row.id) }
// },
// '编辑'
// ),
// h(
// 'op',
// {
// attrs: { oprate: 'remove' },
// on: { click: () => this.remove(params.row.id) }
// },
// '删除'
// )
]);
}
}
],
selectCount: 0,
selectList: [],
footerBar: false,
results: [],
listBatchIds: [],
listBatchIds1: [], //临时存储选择的ids
single: false,
resultsStatusArr: [],
resultsStatus: 0,
dispatchStatus: 0, //派发标识
scheduleStatus: 0, //排产标识
resultsOrderList: ""
};
},
mounted() {
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
handleSelectAll(status) {
//选择列表数据
this.$refs.grid.selectAll(status);
},
selectInfo(value) {
if (value.length > 0) {
this.footerBar = true;
} else {
this.footerBar = false;
}
this.selectList = [];
this.selectList = value;
this.selectCount = this.selectList.length;
let statueArry = [];
let tempmesCodeList = [];
this.resultsStatusArr = [];
value.forEach(data => {
var that = this;
statueArry.push(data.id);
this.resultsStatusArr.push(data.mainRoutingSetStatus);
tempmesCodeList.push(data.mesCode);
});
let mainRS = this.uniq(this.resultsStatusArr); //数组去重
if (mainRS.length == 1) {
this.results = [];
this.results = statueArry;
this.getListId(statueArry);
this.resultsOrderList = JSON.stringify(tempmesCodeList) //提示mesCode
.replace("[", "")
.replace("]", "")
.replace(/\"/g, "");
if (mainRS[0] == 0) {
//未派发
this.dispatchStatus = 1;
this.scheduleStatus = 0;
} else if (mainRS[0] == 1) {
//已派发
this.dispatchStatus = 0;
this.scheduleStatus = 1;
} else {
//派发中
this.dispatchStatus = 0;
this.scheduleStatus = 0;
}
} else {
this.dispatchStatus = 0;
this.scheduleStatus = 0;
}
},
//得到需要批量操作的ids
getListId(value) {
this.listBatchIds1 = value;
if (this.listBatchIds1.length > 0) {
this.footerBar = true;
} else {
this.footerBar = false;
}
},
canselFooter() {
this.footerBar = false;
this.handleSelectAll(false);
},
modalDispatch() {
//打开工艺派发
this.listBatchIds = this.listBatchIds1; //用于列表操作时和多选时的listBatchId的冲突
if (this.dispatchStatus == 1) {
this.dispatchModal = true;
} else {
this.$Message.error("所选订单里存在已派发订单!");
}
},
modalSchedule() {
//移入排产
this.listBatchIds = this.listBatchIds1;
if (this.scheduleStatus == 1) {
this.scheduleModal = true;
} else {
this.$Message.error("所选订单里存在未派发订单!");
}
},
goMethod(value) {
//行内点击后面按钮
this.resultsOrderList = value.mesCode;
this.listBatchIds = [value.id];
if (value.mainRoutingSetStatus == 0) {
//this.dispatchStatus = 1
//this.scheduleStatus = 0
this.dispatchModal = true;
} else if (value.mainRoutingSetStatus == 1) {
//this.dispatchStatus = 0
//this.scheduleStatus = 1
this.scheduleModal = true;
}
},
scheduleOk() {
let params = { ids: this.listBatchIds };
Api.moveinbatch(params)
.then(r => {
if (r.success) {
this.$Message.success("移入排产成功");
} else {
this.$Message.error("移入排产失败");
}
})
.catch(err => {
this.$Message.error("移入排产失败");
});
this.canselFooter();
this.cancel();
},
//跳转到aps排产池(有判断)
goAps() {
Api.moveintoaps().then(res => {
if (res.success) {
if (res.result.res) {
this.$router.push({
name: "aps-aps"
// params: { customerId: id }
});
} else {
this.$Message.error(res.result.msg);
}
}
});
},
addOk() {
this.$refs.grid.load();
this.addModal = false;
this.detailModal = false;
this.editModal = false;
this.curId = 0;
//aps
this.dispatchModal = false;
this.scheduleModal = false;
this.listBatchIds = [];
this.listBatchIds1 = [];
this.canselFooter();
},
search() {
this.$refs.grid.reload(this.easySearch);
},
detail(id) {
this.detailModal = true;
this.curId = id;
},
edit(id) {
this.editModal = true;
this.curId = id;
},
remove(id) {
this.deletelModal = true;
this.curId = id;
},
removeOk() {
Api.delete({ id: this.curId }).then(r => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
this.$Message.success("删除成功");
}
});
},
removeCancel() {
this.deletelModal = false;
},
cancel() {
this.curId = 0;
this.addModal = false;
this.detailModal = false;
this.editModal = false;
this.deletedlModal = false;
//aps
this.dispatchModal = false;
this.scheduleModal = false;
// this.listBatchIds = []
// this.listBatchIds1 = []
// this.canselFooter()
},
l(key) {
let vkey = "mes_order" + "." + key;
return this.$t(vkey) || key;
},
uniq(array) {
//数组去重
array.sort();
var temp = [];
temp = [array[0]];
for (var i = 1; i < array.length; i++) {
if (array[i] !== temp[temp.length - 1]) {
temp.push(array[i]);
}
}
return temp;
}
}
};
</script>
<style lang="less">
.footerSpan {
width: 120px;
}
</style>
\ No newline at end of file
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col span="8" v-if="condition.id.show">
<FormItem :label="l('id')" prop="id">
<Input v-model="condition.id.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.upId.show">
<FormItem :label="l('upId')" prop="upId">
<Input v-model="condition.upId.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.mesCode.show">
<FormItem :label="l('mesCode')" prop="mesCode">
<Input v-model="condition.mesCode.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.taskType.show">
<FormItem :label="l('taskType')" prop="taskType">
<Input v-model="condition.taskType.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.productId.show">
<FormItem :label="l('productId')" prop="productId">
<Input v-model="condition.productId.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.stage.show">
<FormItem :label="l('stage')" prop="stage">
<Input v-model="condition.stage.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.materialId.show">
<FormItem :label="l('materialId')" prop="materialId">
<Input v-model="condition.materialId.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.quantity.show">
<FormItem :label="l('quantity')" prop="quantity">
<Input v-model="condition.quantity.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.guestName.show">
<FormItem :label="l('guestName')" prop="guestName">
<Input v-model="condition.guestName.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.printSupply.show">
<FormItem :label="l('printSupply')" prop="printSupply">
<Input v-model="condition.printSupply.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.functionaryOffice.show">
<FormItem :label="l('functionaryOffice')" prop="functionaryOffice">
<Input v-model="condition.functionaryOffice.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.mainDepartmentId.show">
<FormItem :label="l('mainDepartmentId')" prop="mainDepartmentId">
<Input v-model="condition.mainDepartmentId.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.remark.show">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="condition.remark.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.taskInputDate.show">
<FormItem :label="l('taskInputDate')" prop="taskInputDate">
<DatePicker type="daterange" v-model="condition.taskInputDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.taskRequire.show">
<FormItem :label="l('taskRequire')" prop="taskRequire">
<Input v-model="condition.taskRequire.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.putintDocmentCode.show">
<FormItem :label="l('putintDocmentCode')" prop="putintDocmentCode">
<Input v-model="condition.putintDocmentCode.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.technologyDocmentCode.show">
<FormItem :label="l('technologyDocmentCode')" prop="technologyDocmentCode">
<Input v-model="condition.technologyDocmentCode.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.outerDrawnNumber.show">
<FormItem :label="l('outerDrawnNumber')" prop="outerDrawnNumber">
<Input v-model="condition.outerDrawnNumber.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.modelVersion.show">
<FormItem :label="l('modelVersion')" prop="modelVersion">
<Input v-model="condition.modelVersion.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.taskCode.show">
<FormItem :label="l('taskCode')" prop="taskCode">
<Input v-model="condition.taskCode.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.designer.show">
<FormItem :label="l('designer')" prop="designer">
<Input v-model="condition.designer.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.officeFunctionary.show">
<FormItem :label="l('officeFunctionary')" prop="officeFunctionary">
<Input v-model="condition.officeFunctionary.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.mainRoutingPeople.show">
<FormItem :label="l('mainRoutingPeople')" prop="mainRoutingPeople">
<Input v-model="condition.mainRoutingPeople.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.status.show">
<FormItem :label="l('status')" prop="status">
<Dictionary code="mes_xingchi_plan.mes_order.status" v-model="condition.status.value"></Dictionary>
</FormItem>
</Col>
<Col span="8" v-if="condition.workHours.show">
<FormItem :label="l('workHours')" prop="workHours">
<Input v-model="condition.workHours.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.printPeriod.show">
<FormItem :label="l('printPeriod')" prop="printPeriod">
<Input v-model="condition.printPeriod.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.equipment.show">
<FormItem :label="l('equipment')" prop="equipment">
<Input v-model="condition.equipment.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.materialWeight.show">
<FormItem :label="l('materialWeight')" prop="materialWeight">
<Input v-model="condition.materialWeight.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.isSupportingFinish.show">
<FormItem :label="l('isSupportingFinish')" prop="isSupportingFinish">
<Dictionary
code="mes_xingchi_plan.mes_order.is_supporting_finish"
v-model="condition.isSupportingFinish.value"
></Dictionary>
</FormItem>
</Col>
<Col span="8" v-if="condition.demandStartDate.show">
<FormItem :label="l('demandStartDate')" prop="demandStartDate">
<DatePicker type="daterange" v-model="condition.demandStartDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.demandFinishDate.show">
<FormItem :label="l('demandFinishDate')" prop="demandFinishDate">
<DatePicker type="daterange" v-model="condition.demandFinishDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.actualStartDate.show">
<FormItem :label="l('actualStartDate')" prop="actualStartDate">
<DatePicker type="daterange" v-model="condition.actualStartDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.actualFinishDate.show">
<FormItem :label="l('actualFinishDate')" prop="actualFinishDate">
<DatePicker type="daterange" v-model="condition.actualFinishDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.isDeleted.show">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<Dictionary
code="mes_xingchi_plan.mes_order.is_deleted"
v-model="condition.isDeleted.value"
></Dictionary>
</FormItem>
</Col>
<Col span="8" v-if="condition.creatorUserId.show">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<Input v-model="condition.creatorUserId.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.creationTime.show">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.lastModifierUserId.show">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<Input v-model="condition.lastModifierUserId.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.lastModificationTime.show">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.orderQuotationStatus.show">
<FormItem :label="l('orderQuotationStatus')" prop="orderQuotationStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.order_quotation_status"
v-model="condition.orderQuotationStatus.value"
></Dictionary>
</FormItem>
</Col>
<Col span="8" v-if="condition.distributeMainRouting.show">
<FormItem :label="l('distributeMainRouting')" prop="distributeMainRouting">
<Input v-model="condition.distributeMainRouting.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.mainRoutingFinishDate.show">
<FormItem :label="l('mainRoutingFinishDate')" prop="mainRoutingFinishDate">
<DatePicker type="daterange" v-model="condition.mainRoutingFinishDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.majorRoutingPeople.show">
<FormItem :label="l('majorRoutingPeople')" prop="majorRoutingPeople">
<Input v-model="condition.majorRoutingPeople.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.majorRoutingFinishDate.show">
<FormItem :label="l('majorRoutingFinishDate')" prop="majorRoutingFinishDate">
<DatePicker type="daterange" v-model="condition.majorRoutingFinishDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.checkUpPeople.show">
<FormItem :label="l('checkUpPeople')" prop="checkUpPeople">
<Input v-model="condition.checkUpPeople.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.checkUpFinishDate.show">
<FormItem :label="l('checkUpFinishDate')" prop="checkUpFinishDate">
<DatePicker type="daterange" v-model="condition.checkUpFinishDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.productingPreparationPeople.show">
<FormItem :label="l('productingPreparationPeople')" prop="productingPreparationPeople">
<Input v-model="condition.productingPreparationPeople.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.productingPreparationFinishDate.show">
<FormItem
:label="l('productingPreparationFinishDate')"
prop="productingPreparationFinishDate"
>
<DatePicker type="daterange" v-model="condition.productingPreparationFinishDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.quotationPeople.show">
<FormItem :label="l('quotationPeople')" prop="quotationPeople">
<Input v-model="condition.quotationPeople.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.quotationFinishDate.show">
<FormItem :label="l('quotationFinishDate')" prop="quotationFinishDate">
<DatePicker type="daterange" v-model="condition.quotationFinishDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.routingMethod.show">
<FormItem :label="l('routingMethod')" prop="routingMethod">
<Input v-model="condition.routingMethod.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.outerEnvelopeSize.show">
<FormItem :label="l('outerEnvelopeSize')" prop="outerEnvelopeSize">
<Input v-model="condition.outerEnvelopeSize.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.divideMark.show">
<FormItem :label="l('divideMark')" prop="divideMark">
<Dictionary
code="mes_xingchi_plan.mes_order.divide_mark"
v-model="condition.divideMark.value"
></Dictionary>
</FormItem>
</Col>
<Col span="8" v-if="condition.productCode.show">
<FormItem :label="l('productCode')" prop="productCode">
<Input v-model="condition.productCode.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.productName.show">
<FormItem :label="l('productName')" prop="productName">
<Input v-model="condition.productName.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.drawnNumber.show">
<FormItem :label="l('drawnNumber')" prop="drawnNumber">
<Input v-model="condition.drawnNumber.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.qualifiedQuantity.show">
<FormItem :label="l('qualifiedQuantity')" prop="qualifiedQuantity">
<Input v-model="condition.qualifiedQuantity.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.uncertificateQuantity.show">
<FormItem :label="l('uncertificateQuantity')" prop="uncertificateQuantity">
<Input v-model="condition.uncertificateQuantity.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.mainRoutingSetStatus.show">
<FormItem :label="l('mainRoutingSetStatus')" prop="mainRoutingSetStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.main_routing_set_status"
v-model="condition.mainRoutingSetStatus.value"
></Dictionary>
</FormItem>
</Col>
<Col span="8" v-if="condition.majorRoutingSetStatus.show">
<FormItem :label="l('majorRoutingSetStatus')" prop="majorRoutingSetStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.major_routing_set_status"
v-model="condition.majorRoutingSetStatus.value"
></Dictionary>
</FormItem>
</Col>
<Col span="8" v-if="condition.materialBillSetStatus.show">
<FormItem :label="l('materialBillSetStatus')" prop="materialBillSetStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.material_bill_set_status"
v-model="condition.materialBillSetStatus.value"
></Dictionary>
</FormItem>
</Col>
<Col span="8" v-if="condition.routingDataSetStatus.show">
<FormItem :label="l('routingDataSetStatus')" prop="routingDataSetStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.routing_data_set_status"
v-model="condition.routingDataSetStatus.value"
></Dictionary>
</FormItem>
</Col>
<Col span="8" v-if="condition.rootId.show">
<FormItem :label="l('rootId')" prop="rootId">
<Input v-model="condition.rootId.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.mainRoutingExecuteStatus.show">
<FormItem :label="l('mainRoutingExecuteStatus')" prop="mainRoutingExecuteStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.main_routing_execute_status"
v-model="condition.mainRoutingExecuteStatus.value"
></Dictionary>
</FormItem>
</Col>
<Col span="8" v-if="condition.majorRoutingExecuteStatus.show">
<FormItem :label="l('majorRoutingExecuteStatus')" prop="majorRoutingExecuteStatus">
<Dictionary
code="mes_xingchi_plan.mes_order.major_routing_execute_status"
v-model="condition.majorRoutingExecuteStatus.value"
></Dictionary>
</FormItem>
</Col>
<Col span="8" v-if="condition.mainRoutingActualStartDate.show">
<FormItem :label="l('mainRoutingActualStartDate')" prop="mainRoutingActualStartDate">
<DatePicker type="daterange" v-model="condition.mainRoutingActualStartDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.mainRoutingActualFinishDate.show">
<FormItem :label="l('mainRoutingActualFinishDate')" prop="mainRoutingActualFinishDate">
<DatePicker type="daterange" v-model="condition.mainRoutingActualFinishDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.majorRoutingActualStartDate.show">
<FormItem :label="l('majorRoutingActualStartDate')" prop="majorRoutingActualStartDate">
<DatePicker type="daterange" v-model="condition.majorRoutingActualStartDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.majorRoutingActualFinishDate.show">
<FormItem :label="l('majorRoutingActualFinishDate')" prop="majorRoutingActualFinishDate">
<DatePicker type="daterange" v-model="condition.majorRoutingActualFinishDate.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.batchNumber.show">
<FormItem :label="l('batchNumber')" prop="batchNumber">
<Input v-model="condition.batchNumber.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.projectNumber.show">
<FormItem :label="l('projectNumber')" prop="projectNumber">
<Input v-model="condition.projectNumber.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.urgencyLevel.show">
<FormItem :label="l('urgencyLevel')" prop="urgencyLevel">
<Input v-model="condition.urgencyLevel.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.materialName.show">
<FormItem :label="l('materialName')" prop="materialName">
<Input v-model="condition.materialName.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.isPreschedule.show">
<FormItem :label="l('isPreschedule')" prop="isPreschedule">
<Dictionary
code="mes_xingchi_plan.mes_order.is_preschedule"
v-model="condition.isPreschedule.value"
></Dictionary>
</FormItem>
</Col>
<Col span="8" v-if="condition.spareQty.show">
<FormItem :label="l('spareQty')" prop="spareQty">
<Input v-model="condition.spareQty.value"></Input>
</FormItem>
</Col>
<Col span="8" v-if="condition.demandStart.show">
<FormItem :label="l('demandStart')" prop="demandStart">
<DatePicker type="daterange" v-model="condition.demandStart.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.demandFinish.show">
<FormItem :label="l('demandFinish')" prop="demandFinish">
<DatePicker type="daterange" v-model="condition.demandFinish.value"></DatePicker>
</FormItem>
</Col>
<Col span="8" v-if="condition.partNamePro.show">
<FormItem :label="l('partNamePro')" prop="partNamePro">
<Input v-model="condition.partNamePro.value"></Input>
</FormItem>
</Col>
</Row>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
condition: {
id: { op: 'Equal', value: null, show: false },
upId: { op: 'Equal', value: null, show: false },
mesCode: { op: 'Equal', value: null, show: true },
taskType: { op: 'Equal', value: null, show: true },
productId: { op: 'Equal', value: null, show: false },
stage: { op: 'Equal', value: null, show: true },
materialId: { op: 'Equal', value: null, show: false },
quantity: { op: 'Equal', value: null, show: false },
guestName: { op: 'Equal', value: null, show: false },
printSupply: { op: 'Equal', value: null, show: false },
functionaryOffice: { op: 'Equal', value: null, show: false },
mainDepartmentId: { op: 'Equal', value: null, show: false },
remark: { op: 'Equal', value: null, show: false },
taskInputDate: { op: 'Range', value: null, show: true },
taskRequire: { op: 'Equal', value: null, show: false },
putintDocmentCode: { op: 'Equal', value: null, show: false },
technologyDocmentCode: { op: 'Equal', value: null, show: false },
outerDrawnNumber: { op: 'Equal', value: null, show: false },
modelVersion: { op: 'Equal', value: null, show: false },
taskCode: { op: 'Equal', value: null, show: false },
designer: { op: 'Equal', value: null, show: false },
officeFunctionary: { op: 'Equal', value: null, show: false },
mainRoutingPeople: { op: 'Equal', value: null, show: false },
status: { op: 'Equal', value: null, show: true },
workHours: { op: 'Equal', value: null, show: true },
printPeriod: { op: 'Equal', value: null, show: false },
equipment: { op: 'Equal', value: null, show: false },
materialWeight: { op: 'Equal', value: null, show: true },
isSupportingFinish: { op: 'Equal', value: null, show: true },
demandStartDate: { op: 'Range', value: null, show: true },
demandFinishDate: { op: 'Range', value: null, show: true },
actualStartDate: { op: 'Range', value: null, show: false },
actualFinishDate: { op: 'Range', value: null, show: false },
isDeleted: { op: 'Equal', value: null, show: false },
creatorUserId: { op: 'Equal', value: null, show: false },
creationTime: { op: 'Range', value: null, show: false },
lastModifierUserId: { op: 'Equal', value: null, show: false },
lastModificationTime: { op: 'Range', value: null, show: false },
orderQuotationStatus: { op: 'Equal', value: null, show: false },
distributeMainRouting: { op: 'Equal', value: null, show: false },
mainRoutingFinishDate: { op: 'Range', value: null, show: false },
majorRoutingPeople: { op: 'Equal', value: null, show: false },
majorRoutingFinishDate: { op: 'Range', value: null, show: false },
checkUpPeople: { op: 'Equal', value: null, show: false },
checkUpFinishDate: { op: 'Range', value: null, show: false },
productingPreparationPeople: { op: 'Equal', value: null, show: false },
productingPreparationFinishDate: {
op: 'Range',
value: null,
show: false
},
quotationPeople: { op: 'Equal', value: null, show: false },
quotationFinishDate: { op: 'Range', value: null, show: false },
routingMethod: { op: 'Equal', value: null, show: true },
outerEnvelopeSize: { op: 'Equal', value: null, show: false },
divideMark: { op: 'Equal', value: null, show: false },
productCode: { op: 'Equal', value: null, show: false },
productName: { op: 'Equal', value: null, show: true },
drawnNumber: { op: 'Equal', value: null, show: true },
qualifiedQuantity: { op: 'Equal', value: null, show: true },
uncertificateQuantity: { op: 'Equal', value: null, show: true },
mainRoutingSetStatus: { op: 'Equal', value: null, show: true },
majorRoutingSetStatus: { op: 'Equal', value: null, show: false },
materialBillSetStatus: { op: 'Equal', value: null, show: false },
routingDataSetStatus: { op: 'Equal', value: null, show: false },
rootId: { op: 'Equal', value: null, show: false },
mainRoutingExecuteStatus: { op: 'Equal', value: null, show: false },
majorRoutingExecuteStatus: { op: 'Equal', value: null, show: false },
mainRoutingActualStartDate: { op: 'Range', value: null, show: false },
mainRoutingActualFinishDate: { op: 'Range', value: null, show: false },
majorRoutingActualStartDate: { op: 'Range', value: null, show: false },
majorRoutingActualFinishDate: { op: 'Range', value: null, show: false },
batchNumber: { op: 'Equal', value: null, show: true },
projectNumber: { op: 'Equal', value: null, show: true },
urgencyLevel: { op: 'Equal', value: null, show: true },
materialName: { op: 'Equal', value: null, show: true },
isPreschedule: { op: 'Equal', value: null, show: true },
spareQty: { op: 'Equal', value: null, show: false },
demandStart: { op: 'Range', value: null, show: false },
demandFinish: { op: 'Range', value: null, show: false },
partNamePro: { op: 'Equal', value: null, show: false }
}
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'mes_order' + '.' + key
return this.$t(key)
}
}
}
</script>
import Api from '@/plugins/request'
export default {
// index: `${apsUrl}/scheduletotal/getall`,
paged(params) {
return Api.get(`${apsUrl}/scheduletotal/getall`, params);
},
getall(params) {
return Api.get(`${apsUrl}/schema/getall`, params);
},
clearall(params) {
return Api.post(`${apsUrl}/schema/clearall`, params);
},
getdetail(params) {
return Api.get(`${apsUrl}/scheduletotal/getdetail`, params);
},
}
<template>
<div class="results">
<Layout>
<Sider hide-trigger width="300">
<h4>排产方案列表</h4>
<div class="btn">
<a href="#" @click="clear">
<Icon type="ios-trash" />
<span>清空列表</span>
</a>
</div>
<div
class="left-body"
v-for="(li,index) in list"
:key="index"
@click="listData(li.schedule_Id,index)"
:class="isactive == index ? 'addclass' : '' "
>
<div class="title-t">排产方案:{{li.schedule_Id}}</div>
<div class="fa">排产时间:{{li.plan_Date}}</div>
<div class="fa">
<span>{{li.iNSERTFLAG}} /</span>
<span>参数级别:{{li.routing_schema}} /</span>
<span>参数应用:{{li.routing_version}}</span>
</div>
</div>
</Sider>
<Content>
<h4>排产结果</h4>
<div class="btn">
<Button type="primary" @click="parameter">下发</Button>
<!-- <Button type="primary">导出</Button> -->
<Button type="primary" icon="ios-redo" @click="comeBlck">返回</Button>
</div>
<div>
<Table :columns="columns" :data="data"></Table>
</div>
</Content>
</Layout>
</div>
</template>
<script>
import Api from "./api";
import expandRow from "./table-expand.vue";
export default {
components: { expandRow },
data() {
return {
isactive: 0,
data: [],
list: [],
columns: [
{
type: "expand",
width: 50,
render: (h, params) => {
return h(expandRow, {
props: {
row: params.row
}
});
}
},
{
title: "超期预警",
key: "id",
align: "center",
render: (h, params) => {
return h("div", [
h("Icon", {
props: {
type:
params.row.id == 1
? "ios-information-circle-outline"
: "ios-remove-circle-outline"
},
style: {
marginRight: "5px",
fontSize: "18px",
fontWeight: "bold",
color: params.row.id == 1 ? "#FE7777" : "#0DD78D"
}
})
]);
}
},
{
title: "零件图号",
key: "part_id",
align: "center"
},
{
title: "零件名称",
key: "part_name",
align: "center"
},
{
title: "计划开始时间",
key: "plan_start",
width: 220,
align: "center"
},
{
title: "计划结束时间",
key: "plan_start",
width: 220,
align: "center"
},
{
title: "投料时间",
key: "demand_start",
width: 220,
align: "center"
},
{
title: "节点时间",
key: "demand_finish",
width: 220,
align: "center"
},
{
title: "计划数量",
key: "plan_qty",
align: "center"
}
]
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
this.orderlist();
},
methods: {
orderlist() {
Api.getall()
.then(r => {
if (r.success) {
this.list = r.result;
if (r.result) {
this.listData(r.result[0].schedule_Id, 0);
} else {
this.listData(0, null);
}
}
})
.catch(error => {
this.$$Message.error("请求失败");
});
},
listData(id, index) {
this.isactive = index;
Api.paged({ scheduleId: id })
.then(r => {
if (r.success) {
this.data = r.result;
}
})
.catch(error => {
this.$$Message.error("请求失败");
});
},
clear() {
if (this.list.length > 0) {
this.$Modal.confirm({
title: "清空列表",
content: "您确定要清空列表吗",
onOk: () => {
Api.clearall().then(r => {
if (r.success) {
this.$Message.success("清空列表成功");
this.orderlist();
}
});
},
onCancel: () => {
this.$Message.info("已取消");
}
});
}
},
parameter() {},
addOk() {},
cancel() {},
comeBlck() {
this.$router.push({ path: "/aps/aps" });
}
}
};
</script>
<style lang="less" scoped>
.results {
font-family: Microsoft YaHei;
.ivu-layout-sider {
background: none;
height: 90vh;
border-right: 1px solid #e4e6ed;
.btn {
float: right;
margin-top: -44px;
margin-right: 15px;
}
}
.addclass {
border-color: #2680eb !important;
}
h4 {
height: 38px;
line-height: 38px;
border-bottom: 1px solid #e4e6ed;
margin-bottom: 15px;
margin-right: 15px;
}
.left-body:hover {
cursor: pointer;
border-color: #2680eb;
}
.left-body {
margin: 10px 15px 0 0;
border: 1px solid rgba(228, 230, 237, 1);
border-radius: 4px;
padding: 5px 8px;
.title-t {
height: 30px;
line-height: 30px;
color: #2680eb;
font-size: 15px;
font-weight: bold;
}
.fa {
height: 30px;
line-height: 30px;
}
}
.ivu-layout-content {
margin-left: 15px;
.btn {
float: right;
margin-top: -52px;
margin-right: 15px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="parameter">
<Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row :gutter="20">
<Col span="12">
<div class="left-up">
<p class="title-c">参数设置</p>
<FormItem :label="l('plan_method')" prop="plan_method">
<i-switch v-model="entity.plan_method" size="large">
<span slot="open">On</span>
<span slot="close">Off</span>
</i-switch>
</FormItem>
<FormItem :label="l('cal_id')" prop="cal_id">
<Select v-model="entity.cal_id" style="width:150px">
<Option value="beijing">策略1</Option>
<Option value="shanghai">策略2</Option>
<Option value="shenzhen">策略3</Option>
</Select>
</FormItem>
<FormItem :label="l('over_time')" prop="over_time">
<i-switch v-model="entity.over_time" size="large">
<span slot="open">On</span>
<span slot="close">Off</span>
</i-switch>
</FormItem>
<FormItem :label="l('efficiency_value')" prop="efficiency_value">
<Input v-model="entity.efficiency_value" style="width:150px"></Input>
</FormItem>
<FormItem :label="l('run_time')" prop="run_time">
<InputNumber v-model="entity.run_time"></InputNumber>
</FormItem>
<FormItem :label="l('isdiscrete')" prop="isdiscrete">
<i-switch v-model="entity.isdiscrete" size="large">
<span slot="open">On</span>
<span slot="close">Off</span>
</i-switch>
</FormItem>
<FormItem :label="l('discrete_value')" prop="discrete_value">
<InputNumber v-model="entity.discrete_value"></InputNumber>
</FormItem>
<FormItem :label="l('discrete_percent')" prop="discrete_percent">
<InputNumber v-model="entity.discrete_percent"></InputNumber>
</FormItem>
</div>
<div class="left-donw">
<p class="title-c">参数级别</p>
<div class="icon">
<Dropdown trigger="custom" :visible="visible" style="width:150px">
<a href="javascript:void(0)" @click="handleOpen">
<Icon type="md-git-compare" />
</a>
<DropdownMenu slot="list" style="text-align: center;">
<DropdownItem>
<a href="#">
<Icon type="md-apps" />
</a>
<span>转序规则</span>
</DropdownItem>
<DropdownItem>
<a href="#">
<Icon type="md-apps" />
</a>
<span>加班策略</span>
</DropdownItem>
<DropdownItem>
<a href="#">
<Icon type="md-apps" />
</a>
<span>任务平衡</span>
</DropdownItem>
<DropdownItem>
<a href="#">
<Icon type="md-apps" />
</a>
<span>是否离散</span>
</DropdownItem>
<div style="margin:10px;">
<Button type="primary" @click="handleOk">确定</Button>
<Button type="primary" @click="handle">关闭</Button>
</div>
</DropdownMenu>
</Dropdown>
</div>
<div class="slider">
<Slider v-model="entity.value1" :step="25" show-stops></Slider>
<div class="slow"></div>
<div class="fast"></div>
</div>
</div>
</Col>
<Col span="12">
<div class="right-up">
<p class="title-d">多台分配设置</p>
<div class="duo">
<Row>
<Col :span="12">
<FormItem :label="l('multi_machine')" prop="multi_machine">
<i-switch v-model="entity.switch4" size="large">
<span slot="open">On</span>
<span slot="close">Off</span>
</i-switch>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="多台数量" prop="abbre">
<InputNumber v-model="entity.abbre"></InputNumber>
</FormItem>
</Col>
</Row>
<FormItem label="班组结构">
<Select v-model="entity.select6" style="width:150px">
<Option value="beijing">结构1</Option>
<Option value="shanghai">结构2</Option>
<Option value="shenzhen">结构3</Option>
<Option value="shenzhen">结构4</Option>
</Select>
</FormItem>
<div class="check-box">
<CheckboxGroup v-model="entity.fruit">
<Checkbox label="10985553333(数控车床 车工班)"></Checkbox>
<br />
<Checkbox label="10985553333(数控车床 车工班)"></Checkbox>
<br />
<Checkbox label="10985553333(数控车床 车工班)"></Checkbox>
<br />
<Checkbox label="10985553333(数控车床 车工班)"></Checkbox>
<br />
</CheckboxGroup>
</div>
</div>
</div>
<div class="left-donw right-down">
<p class="title-c">参数应用</p>
<div class="slider">
<Slider v-model="entity.value2" :step="33.3" show-stops></Slider>
<div class="slow">工序</div>
<div class="ding">订单</div>
<div class="ling">零件</div>
<div class="fast">所有</div>
</div>
</div>
</Col>
</Row>
<FormItem class="click-btn">
<Button type="primary" @click="handleSubmit">确定</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</div>
</template>
<script>
export default {
data() {
return {
entity: {
value1: '100',
value2: '100',
fruit: []
},
visible: false,
rules: {
businessName: [{ required: true, message: '必填', trigger: 'blur' }],
businessCode: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
methods: {
handleSubmit() {},
handleClose() {},
handleOpen() {
this.visible = true
},
handle() {
this.visible = false
},
handleOk() {},
l(key) {
let vkey = 'mes_op_task_plan_simulate' + '.' + key
return this.$t(vkey) || key
}
}
}
</script>
<style lang="less" scoped>
.parameter {
margin: 10px;
.left-up {
position: relative;
border: 1px solid #e0e0e0;
padding: 25px 0;
.title-c {
width: 68px;
padding-left: 5px;
background: #fff;
position: absolute;
top: -9px;
left: 25px;
color: #2680eb;
}
}
.left-donw {
margin-top: 15px;
position: relative;
border: 1px solid #e0e0e0;
padding: 25px 0;
.title-c {
width: 68px;
padding-left: 5px;
background: #fff;
position: absolute;
top: -9px;
left: 25px;
color: #2680eb;
}
.slider {
margin: 0 50px 0 50px;
position: relative;
.slow {
position: absolute;
top: 7px;
left: -5px;
}
.fast {
position: absolute;
top: 7px;
right: -10px;
}
.ding {
position: absolute;
top: 7px;
left: 30%;
}
.ling {
position: absolute;
top: 7px;
right: 30%;
}
}
.icon {
text-align: right;
padding-right: 15px;
margin-top: -15px;
}
}
.right-up {
position: relative;
border: 1px solid #e0e0e0;
padding: 25px 0;
.title-d {
width: 95px;
padding-left: 5px;
margin-left: 10px;
background: #fff;
position: absolute;
top: -9px;
left: 25px;
color: #2680eb;
}
.check-box {
height: 300px;
border-top: 1px solid #e0e0e0;
padding: 15px;
padding-left: 0;
margin-left: 25px;
overflow: auto;
}
}
.right-down {
height: 100px;
}
.click-btn {
text-align: right;
margin-top: 15px;
}
}
</style>
\ No newline at end of file
<template>
<div class="result-aps">
<Row class="expand-row">
<Col span="4">
<span class="expand-key">工序序号</span>
</Col>
<Col span="3">
<span class="expand-key">工序名称</span>
</Col>
<Col span="3">
<span class="expand-key">投入数量</span>
</Col>
<Col span="3">
<span class="expand-key">派工数量</span>
</Col>
<Col span="4">
<span class="expand-key">计划开始时间</span>
</Col>
<Col span="4">
<span class="expand-key">计划结束时间</span>
</Col>
<Col span="3">
<span class="expand-key">设备编号</span>
</Col>
</Row>
<Row v-for="(item,index) in dataList" :key="item.id">
<Col span="4">
<span class="expand-value">{{ item.op_task_pk }}</span>
</Col>
<Col span="3">
<span class="expand-value">{{ item.task_name }}</span>
</Col>
<Col span="3">
<span class="expand-value">{{ item.put_into_qty }}</span>
</Col>
<Col span="3">
<span class="expand-value">{{ item.dispatch_qty }}</span>
</Col>
<Col span="4">
<span class="expand-value">{{ item.plan_start }}</span>
</Col>
<Col span="4">
<span class="expand-value">{{ item.plan_finish }}</span>
</Col>
<Col span="3">
<span class="expand-value">{{ row.equip_id }}</span>
</Col>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
props: {
row: Object
},
data() {
return {
dataList: []
}
},
mounted() {
this.getList(this.row)
},
methods: {
getList(row) {
Api.getdetail({
part_task_pk: row.id,
scheduleId: row.schedule_id
}).then((r) => {
if (r.success) {
this.dataList = r.result
}
})
}
}
}
</script>
<style lang='less'>
.result-aps {
.expand-row {
text-align: center;
}
// .ivu-row {
// font-weight: bold !important;
// }
}
td.ivu-table-expanded-cell {
padding: 0 !important;
}
</style>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
getmesorder(params) {
return Api.get(`${apsManualUrl}/aps/getmesorder`, params); //待排产订单数据
},
gettaskseqinfo(params) {
return Api.get(`${apsManualUrl}/aps/gettaskseqinfo`, params); //根据订单获取全部工序数据
},
getlist(params) {
return Api.get(`${apsManualUrl}/mes_sys_shop_info/getlist`, params); //手工排产:查询所在车间下的所有班组信息
},
getbyshopid(params) {
return Api.get(`${apsManualUrl}/mes_sys_user_info/getuserbyshopid`, params); //手工排产:根据班组ID,加载人员信息
},
getlistEquip(params) {
return Api.get(`${apsManualUrl}/mes_equip_info/getlist`, params); //手工排产:获取所在车间的设备
},
getbyequippk(params) {
return Api.get(`${apsManualUrl}/mes_sys_user_info/getuserbyequippk`, params); //手工排产:根据设备ID,加载人员信息
},
}
\ No newline at end of file
<template>
<div class="checkbox-list">
<Row style="border-bottom: 1px solid #e9e9e9;margin-bottom:6px;">
<Col span="20">
<div>
<!-- :indeterminate="indeterminate" -->
<Checkbox
:label="resourcesType==0?singleList.shop_name:resourcesType==2?singleList.equip_name:''"
v-model="checkAll"
@click.prevent.native="handleCheckAll(singleList.shop_id)"
>{{resourcesType==0?singleList.shop_name:resourcesType==2?singleList.equip_name:''}}</Checkbox>
</div>
</Col>
<Col span="4">
<div class="icon-down">
<Icon type="ios-arrow-down" v-if="!singleList.isClick" @click="upDown(singleList)"></Icon>
<Icon type="ios-arrow-up" v-if="singleList.isClick" @click="upDown(singleList)"></Icon>
</div>
</Col>
</Row>
<CheckboxGroup
v-model="checkAllGroup"
@on-change="checkAllGroupChange"
v-if="singleList.isClick"
>
<Checkbox
:label="resourcesType==0?item.user_name:resourcesType==2?item.equip_name:''"
v-for="(item,index) in list"
:key="item.user_id"
></Checkbox>
</CheckboxGroup>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'CheckboxList',
props: ['singleList', 'resourcesType'],
data() {
return {
indeterminate: true,
checkAll: false,
checkAllGroup: [],
typeIcon: 'ios-arrow-down',
show: -1,
list: [],
taglistData: []
}
},
mounted() {
// this.checkList()
},
methods: {
handleCheckAll(id) {
// console.log(this.list)
// this.list.map((u) => {
// console.log(u)
// })
// this.checkList(id)
this.checkAll = !this.checkAll
if (this.checkAll) {
let listNew = []
this.list.map((u) => {
if (this.resourcesType == 0) {
listNew.push(u.user_name)
} else if (this.resourcesType == 2) {
listNew.push(u.equip_name)
}
})
this.checkAllGroup = listNew
this.$emit('changeData', this.checkAllGroup)
} else {
this.checkAllGroup = []
}
},
checkAllGroupChange(data) {
console.log(data)
console.log(this.list)
this.checkAllGroup = data
this.$emit('changeData', this.checkAllGroup)
if (data.length === this.list.length) {
this.indeterminate = false
this.checkAll = true
} else if (data.length > 0) {
this.indeterminate = true
this.checkAll = false
} else {
this.indeterminate = false
this.checkAll = false
}
},
checkList(id) {
if (this.resourcesType == 0) {
//班组
Api.getbyshopid({ shop_id: id }).then((r) => {
// console.log(r)
if (r.success) {
r.result.forEach((e) => {
e.ischeckBox = false
})
this.list = r.result
}
})
} else if (this.resourcesType == 2) {
//设备
Api.getbyequippk({ equip_pk: 91 }).then((r) => {
// console.log(r)
if (r.success) {
r.result.forEach((e) => {
e.ischeckBox = false
})
this.list = r.result
}
})
}
},
upDown(post) {
if (!post.isClick) {
this.$set(post, 'isClick', true)
this.checkList(post.shop_id)
} else {
this.$set(post, 'isClick', false)
}
}
}
// watch: {
// list: {
// handler(newVal, oldVal) {
// console.log('深度监听', newVal, oldVal)
// },
// deep: true
// }
// }
}
</script>
<style lang="less" scoped>
.checkbox-list {
.icon-down {
text-align: right;
}
}
</style>
\ No newline at end of file
<template>
<div class="scheduling">
<div class="aps-l">
<Row class="row-p">
<Col :span="9" class="chan-chi">排产池</Col>
</Row>
<div
class="left-body"
v-for="(li,index) in list"
:key="index"
@click="listData(li.part_task_pk,index)"
:class="isactive == index ? 'addclass' : '' "
>
<Row class="title-i">
<Col :span="20" class="order-code">订单号:{{li.order_id}}</Col>
<Col :span="4" class="order-ringht">
<Icon type="md-close" @click="close" />
</Col>
</Row>
<div class="fa">{{li.routing_version}}</div>
<div class="gong-xu">
<Icon type="ios-copy" />
<span>工序:{{li.routing_schema}}</span>
</div>
<div class="time-s">{{li.demand_start}}{{li.demand_finish}}</div>
</div>
</div>
<div class="aps-r">
<!-- <div class="g-list">工序列表</div> -->
<Row class="g-list">
<Col :span="2" class="chan-chi">工序列表</Col>
<Col :span="22" class="l-ringht">
<Tabs v-model="selectName" type="card" @on-click="tagClick">
<TabPane label="全部" name="all"></TabPane>
<TabPane label="已排产" name="yi"></TabPane>
<TabPane label="未排产" name="wei"></TabPane>
</Tabs>
</Col>
</Row>
<div class="right-body">
<List :result="result"></List>
</div>
</div>
</div>
</template>
<script>
import List from './list.vue'
import Api from './api'
export default {
name: 'list',
components: {
List
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
activeindex: 1,
list: [],
status: '', //为空是全部排产,0为未排产;13为已排查;
partTaskPk: '', //车间
result: [],
isactive: 0,
selectName: 'all'
}
},
created() {
this.orderlist()
},
methods: {
orderlist() {
Api.getmesorder({ status: 2, workshop_id: 3 }).then((r) => {
// console.log(r)
if (r.success) {
this.list = r.result
this.listData(r.result[0].part_task_pk, 0)
}
})
},
listData(li, index) {
this.status = ''
this.partTaskPk = li
this.tagClick('all')
this.isactive = index
},
tagClick(name) {
this.selectName = name
this.tagTata(this.selectName)
},
tagTata(name) {
if (name == 'all') {
this.status = ''
}
if (name == 'yi') {
this.status = 13
}
if (name == 'wei') {
this.status = 0
}
let data = {
part_task_pk: this.partTaskPk,
status: this.status
}
Api.gettaskseqinfo(data).then((r) => {
// console.log(r)
if (r.success) {
this.result = r.result
}
})
},
close() {}
}
}
</script>
<style lang="less" scoped>
.addclass {
border-color: #249e91 !important;
.title-i {
background: #249e91 !important;
}
}
.scheduling {
display: flex;
display: -webkit-flex;
height: 100%;
.aps-l {
width: 25%;
border-right: 1px solid #e4e6ed;
height: 100%;
padding: 0 15px 10px 10px;
overflow: auto;
.row-p {
border-bottom: 1px solid #e4e6ed;
.chan-chi {
font-size: 14px;
font-weight: bold;
margin-top: 3px;
}
.l-ringht {
text-align: right;
}
}
.left-body {
margin-top: 15px;
border: 1px solid rgba(228, 230, 237, 1);
border-radius: 4px;
.title-i {
padding: 0 8px;
height: 34px;
line-height: 34px;
color: #515a6e;
background: #e4e6ed;
.order-ringht {
text-align: right;
.ivu-icon {
cursor: pointer;
}
}
}
.fa {
height: 32px;
line-height: 32px;
color: #249e91;
padding: 5px 8px 0 8px;
}
.gong-xu {
padding: 0 8px;
height: 32px;
line-height: 32px;
color: #515a6e;
}
.time-s {
padding: 0 8px;
height: 32px;
line-height: 32px;
color: #515a6e;
}
}
}
.aps-r {
width: 75%;
padding: 0 15px;
.g-list {
font-size: 14px;
font-weight: bold;
.chan-chi {
font-size: 14px;
font-weight: bold;
margin-top: 3px;
padding-bottom: 6px;
border-bottom: 1px solid #e4e6ed;
}
.l-ringht {
text-align: left;
}
}
.right-body {
margin-top: 15px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="list">
<Timeline>
<TimelineItem v-for="(item, index) in result" :key="index">
<Badge :count="index+ 1" slot="dot" :type="type(index)"></Badge>
<div @click="sets(item.resources_Type)" class="set-name">{{item.taskname}}</div>
<div>{{item.equip_id}}</div>
<div>{{item.equip_type}}</div>
<div>{{item.resources_Type_Name}}</div>
</TimelineItem>
</Timeline>
<div>
<Drawer title="排产设置盘" :closable="false" v-model="set" width="45%">
<Set :resourcesType="resourcesType"></Set>
</Drawer>
</div>
</div>
</template>
<script>
import Set from './set'
import Api from './api'
export default {
name: 'set',
components: {
Set
},
props: {
result: Array
},
data() {
return {
set: false,
dataList: [],
resourcesType: null
}
},
methods: {
type(i) {
if (i == 0) {
return 'normal'
} else if (i == 1) {
return 'normal'
} else if (i == 2) {
return 'normal'
} else if (i === this.result.length) {
return 'success'
}
},
sets(name) {
this.resourcesType = name
if (this.resourcesType == 0 || this.resourcesType == 2) {
this.set = true
} else {
this.set = false
// this.$Message.info('没有设置盘')
}
}
}
}
</script>
<style lang="less" scoped>
.list {
padding-left: 10px;
.set-name {
font-weight: bold;
}
.set-name:hover {
cursor: pointer;
}
}
</style>
\ No newline at end of file
<template>
<div class="set">
<Form :model="formItem" :label-width="100">
<FormItem label="工时">
<DatePicker
type="datetimerange"
format="yyyy-MM-dd HH:mm"
placeholder="请选择工时"
v-model="formItem.time"
style="width:300px"
></DatePicker>
</FormItem>
<FormItem label="人员分组形式">
<Dictionary
disabled
code="aps.scheduling.groupingForm"
v-model="formItem.resourcesType"
type="radio"
></Dictionary>
</FormItem>
<FormItem>
<div v-for="(li,index) in listGroup" :key="index">
<Checkbox-List
:single-list="li"
ref="groups"
@changeData="setData"
:resourcesType="resourcesType"
></Checkbox-List>
</div>
</FormItem>
<FormItem label="已选择">
<Tag closable @on-close="handleClose" :key="index" v-for="(val, index) in tagGroup">{{val}}</Tag>
</FormItem>
<FormItem label="备注">
<Input
v-model="formItem.textarea"
type="textarea"
:autosize="{minRows: 2,maxRows: 5}"
placeholder="Enter something..."
></Input>
</FormItem>
<FormItem>
<Button style="margin-left: 8px">取消</Button>
<Button type="primary">排产</Button>
</FormItem>
</Form>
</div>
</template>
<script>
import CheckboxList from './checkboxList'
import Api from './api'
export default {
name: 'set',
components: {
CheckboxList
},
props: {
resourcesType: Number
},
data() {
return {
formItem: {
resourcesType: 0,
input: '',
select: '',
radio: 'male',
checkbox: [],
switch: true,
date: '',
time: '',
slider: [20, 50],
textarea: '',
day: 0
},
tagdata: [],
listGroup: [],
tagGroup: []
}
},
mounted() {},
// computed: {
// tagList() {
// if (this.tagdata.length > 0) {
// let items = this.tagdata.filter((u) => {
// return
// })
// return items
// } else {
// return []
// }
// }
// },
methods: {
getList(v) {
if (v == 0) {
//班组
Api.getlist({ workshop_pk: 3 }).then((r) => {
console.log(r)
if (r.success) {
r.result.forEach((u) => {
u.isClick = false
})
this.listGroup = r.result
}
})
} else if (v == 2) {
//设备
Api.getlistEquip({ workshop_pk: 3 }).then((r) => {
console.log(r)
r.result.forEach((u) => {
u.isClick = false
})
this.listGroup = r.result
})
}
},
handleClose(nodeKey) {
// this.$refs.users.handleCheck({ checked: false, nodeKey: nodeKey });
},
setData(val) {
this.tagGroup = val
}
},
watch: {
resourcesType(v) {
if (v != null) {
this.formItem.resourcesType = v
this.getList(v)
}
}
}
}
</script>
<template>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :show-message="false" :label-width="90">
<Row>
<FormItem label="类型" prop="typeid">
<Select v-model="formValidate.typeid" placeholder="请选择" style="width:240px;">
<Option v-for="(item,index) in alltype " :key="item.index" :value="item.value">{{item.label}}</Option>
</Select>
</FormItem>
</Row>
<Row>
<FormItem label="名称" prop="name">
<Input v-model="formValidate.name" style="width:240px;"></Input>
</FormItem>
</Row>
<Row>
<FormItem label="描述" prop="description">
<Input v-model="formValidate.description" style="width:240px;"></Input>
</FormItem>
</Row>
<!-- <FormItem label="编号" prop="number">
<Input v-model="formValidate.number" number></Input>
</FormItem> -->
</Form>
</template>
<script>
export default {
name:'addDictionary',
props:['alltype'],
data(){
return {
formValidate:{typeid:'',name:'',description:''},
ruleValidate:{
name:[{required: true}],
// number:[{required: true,type:'number'}],
typeid:[{required: true}]
}
}
}
}
</script>
<style scoped>
.ivu-form-item {width:48%;display:inline-block;}
.ivu-form-item:nth-child(odd) {
margin-left: 10px
}
</style>
\ No newline at end of file
<template>
<div>
<div class="contentRight">
<label>类型:</label>
<Select v-model="model1" @on-change="change" placeholder="请选择" style="width: 200px">
<Option v-for="(item,index) in selectdata" :key="item.index" :value="item.value">{{item.label}}</Option>
</Select>
<div style="float:right" class="paddingbtn">
<Button type="primary" @click="add('formValidate')">新增</Button>
<!-- <Button type="primary" @click="edit">编辑</Button>
<Button type="primary" @click="del">删除</Button> -->
</div>
<tb :tbPro="tbPro" ref="table" v-on:rowclick="rowclick" class="margin-top-10"></tb>
</div>
<Modal v-model="modal1" title="新增字典数据" :width="440" :mask-closable="false"
:loading="myloading"
ok-text="保存" cancel-text="取消" @on-ok="ok('formValidate')" @on-cancel='cancel'
>
<add-dictionary ref="datadictionary" :alltype="selectdata"></add-dictionary>
<!-- <div slot="footer" style="text-align:center">
<Button type="primary" @click="ok('formValidate')">保存</Button>
<Button
type="primary"
style="border-color: rgb(204, 204, 204);background-color:white;color:black"
@click="cancel"
>取消</Button>
</div> -->
</Modal>
<myconfirm ref="mysel" v-on:confirmok="okmysel" v-on:confirmcancel="cancelmysel"></myconfirm>
</div>
</template>
<script>
import tb from '../roleManagent/components/tb'
import addDictionary from './components/add'
import myconfirm from '../../processDesign/productTree/components/myconfirm'
import service from '@/plugins/request'
export default {
components:{tb,addDictionary,myconfirm},
data(){
return {
myloading:true,
model1:'',
modal1:false,
isEdit:false,
formValidate1:{},
keyid:0,
clickdata:{},
//xia la
selectdata:[
{
value:'产品类型',
label:'产品类型'
},
{
value:'产品分类',
label:'产品分类'
},
{
value:'工艺类型',
label:'工艺类型'
},
{
value:'工艺阶段',
label:'工艺阶段'
},
{
value:'产品型号',
label:'产品型号'
},
],
//表格数据和属性
tbPro:{
height:"",
isBorder: true,
stripe: true,//斑马纹
highlight:true,//高亮显示
columns: [
{
type: 'index',
width: 60,
align: 'center'
},
{
title: '名称',
key: 'name'
},
{
title: '描述',
key: 'description'
},
{
title: '编码',
key: 'code'
},
{
title: '操作',
key: 'action',
align: 'center',
width:400,
render: (h, params) => {
return h('div', [
h(
'span',
{
props: {
type: 'text',
ghost:true
},
style: {
color: '#249E91',
marginRight:"5px",
cursor:"pointer"
},
on: {
click: () => {
this.edit(params)
}
}
},
'编辑'
),
h(
'span',
{
props: {
type: 'text',
ghost:true
},
style: {
color: '#F56C6C',
marginRight:"5px",
cursor:"pointer"
},
on: {
click: () => {
this.del(params)
}
}
},
'删除'
)
])
}
}
],
data: [
]
}
}
},
created(){
var url=`${systemUrl}/DictionaryType/GetPaged`
service.get(`${url}`).then(response=>{
//console.log(response.result.items)
this.selectdata=response.result.items
this.model1=this.selectdata[0].value
this.loaddata(this.model1)
});
this.tbPro.height = window.innerHeight - 180;
},
mounted(){
window.onresize = () => {
return (() => {
this.tbPro.height = window.innerHeight - 180;
})()
}
},
computed:{
alldata:function(){
return this.tbPro.data
}
},
methods:{
loaddata(id){
var url=`${systemUrl}/Dictionary/GetPaged`
service.get(`${url}`,{params:{TypeId:id}}).then(response=>{
this.tbPro.data=response.result.items
})
},
change(data){
// console.log(data);
this.loaddata(data)
},
add:function(name){
this.isEdit=false;
var a = this.$refs.datadictionary;
a.$refs[name].resetFields();
this.modal1=true;
this.$refs.datadictionary.formValidate={typeid:'',description:'',name:''}
},
edit(params){
var a = this.$refs.datadictionary;
a.$refs['formValidate'].resetFields();
this.modal1=true;
this.isEdit=true;
let {typeId,name,description,id,code}=params.row;
// console.log(typeId)
// console.log(number);
this.$refs.datadictionary.formValidate={typeid:typeId,name:name,description:description,id:id,code:code}
},
del(params){
console.log(params)
this.keyid=params.row.id
console.log(this.keyid)
this.$refs.mysel.confirmmodal=true;
},
okmysel(bl){
var url=`${systemUrl}/Dictionary/Delete?id=${this.keyid}`
service.delete(`${url}`).then(response=>{
if(response.success)
{
this.$Message.success('删除成功')
this.loaddata(this.model1)
}
}).catch(error=>{
this.$Message.error('删除失败')
})
this.$refs.mysel.confirmmodal=bl
},
cancelmysel(bl){
this.$refs.mysel.confirmmodal=bl
},
//保存增加修改
ok(name){
var a = this.$refs.datadictionary;
var url=`${systemUrl}/Dictionary/CreateOrUpdate`
var ar=this.alldata.find((val)=>{
return (val.name==this.$refs.datadictionary.formValidate.name)
})
if(ar){
this.$Message.error('已存在字典项的名字');
setTimeout(() => {
this.myloading = false
this.$nextTick(() => {
this.myloading = true
})
}, 500)
return;
}
a.$refs[name].validate((valid) => {
if (valid) {
this.formValidate1 = this.$refs.datadictionary.formValidate
if (this.isedit)
{
//this.formValidate1.id=
}
service.post(`${url}`,{Dictionary:this.formValidate1}).then(response=>{
if(response.success){
this.$Message.success('保存成功')
this.loaddata(this.model1)
this.modal1 = false
}
}).catch(error=>{
//console.log(123)
// console.log(error)
this.$Message.error('保存失败')
})
} else {
setTimeout(() => {
this.myloading = false
this.$nextTick(() => {
this.myloading = true
})
}, 500)
this.$Message.error('请输入必填项')
}
})
},
cancel(){
this.modal1=false;
},
rowclick(data,index){
console.log(typeof(data));
this.clickdata=data;
// console.log(this.clickdata);
}
}
}
</script>
<style scoped>
</style>
<template id="addPRi">
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :show-message="false" :label-width="80" >
<FormItem label="父权限" prop="up_id">
<Select v-model="formValidate.up_id" style="width:240px;">
<Option v-for="(item,index) in list " :key="index" :value="item.value" style="display:none">{{item.label}} </Option>
<Tree v-show="isShow" :data="seldata" @on-select-change="handleSelect"></Tree>
</Select>
</FormItem>
<FormItem label="权限名称" prop="name">
<Input v-model="formValidate.name" style="width:240px;"></Input>
</FormItem>
<FormItem label="系统" prop="from_system">
<Select v-model="formValidate.from_system" @on-change="selectSys" style="width:240px;">
<Option v-for="(item,index) in allsystem " :key="index+1" :value="item.value">{{item.label}}</Option>
</Select>
</FormItem>
<FormItem label="操作类型" prop="type">
<Select v-model="formValidate.type" placeholder="请选择" style="width:240px;">
<Option value=1>菜单</Option>
<Option value=2>系统</Option>
<Option value=3>页面</Option>
</Select>
</FormItem>
<FormItem label="地址" prop="url">
<Input v-model="formValidate.url" style="width:240px;"></Input>
<!-- <Select v-model="formValidate.url" placeholder="请选择">
<Option v-for="(item,index) in allpages " :key="item.value" :value="item.value">{{item.label}}</Option>
</Select> -->
</FormItem>
<!-- <FormItem label="密级" prop="secret_class">
<Select v-model="formValidate.secret_class" placeholder="请选择" style="width:240px;">
<Option v-for="(item,index) in mijis " :key="item.value" :value="item.value">{{item.label}}</Option>
</Select>
</FormItem> -->
<FormItem label="状态" prop="status">
<Select v-model="formValidate.status" placeholder="请选择" style="width:240px;">
<Option value=0>启用</Option>
<Option value=1>禁用</Option>
</Select>
</FormItem>
<!-- <FormItem label="打开方式" prop="target">
<Select v-model="formValidate.target" placeholder="请选择" style="width:240px;">
<Option value="系统内">系统内</Option>
<Option value="新页面">新页面</Option>
</Select>
</FormItem> -->
<FormItem label="排序" prop="priority">
<Input v-model="formValidate.priority" style="width:240px;"></Input>
</FormItem>
</Form>
</template>
<script>
import service from '@/plugins/request'
export default {
name:'addPrivilege',
tit:'',
props:[
'seldata'
],
data(){
return {
formValidate:{name:'',up_id:-1,from_system:'',type:'',url:'',status:'',target:'',priority:'',secret_class:''},
ruleValidate: {
up_id:[{required: true}],
name:[{required: true}],
from_system:[{required: true}],
type:[{required: true}],
url:[{required: true}]
// priority:[ { required: true, message: '排序不能为空' },
// { type: 'number', message: '请输入排序,只能填写数字' }]
},
list:[],
isShow:true,
allsystem:[
{
value:'0',
label:'三车间MES'
},
{
value:'1',
label:'机加MES'
}
],
allpages:[
{
value:'/a/index.html',
label:'/a/index.html'
},
{
value:'/a/port.html',
label:'/a/port.html'
},
{
value:'/a/default.html',
label:'/a/default.html'
}
],
mijis:[
{
value:'机密',
label:'机密'
},
{
value:'一般',
label:'一般'
},
{
value:'内部',
label:'内部'
}
]
}
},
created(){
this.formValidate.from_system=this.allsystem[0].value
//this.gettree(this.formValidate.from_system);
},
computed:{
},
methods:{
selectSys(){
this.$emit('selectSys',this.formValidate.from_system)
},
handleSelect(data){
this.list=[];
this.list.push({label:data[0].title,value:data[0].value});
console.log(this.list);
this.formValidate.up_id=data[0].value;
},
getdata(){
return this.formValidate
}
}
}
</script>
<style scoped>
.ivu-form-item {width:48%;display:inline-block;}
.ivu-form-item:nth-child(odd) {
margin-left: 10px
}
</style>
\ No newline at end of file
<!--
* @Author: 黄龙
* @pageName: 'tree-grid 树型表格'
* @Date: 2017-07-17 16:48:44
* @Last Modified by: 黄龙
* @Last Modified time: 2017-07-17 16:48:44
* @events @on-row-click 单击行或者单击操作按钮方法
@on-selection-change 多选模式下 选中项变化时触发
@on-sort-change 排序时有效,当点击排序时触发
@props items 显示的结构化数据
columns 表格列的配置描述 sortable:true 开启排序功能
type: 'selection'为多选功能 type: 'action' 为操作功能 actions:[{}] 操作按钮
-->
<template>
<div :style="{width:tableWidth,height:tableWidth}" class='autoTbale'>
<table class="table table-bordered" id='hl-tree-table' ref="hl-tree-table">
<thead>
<tr>
<th v-for="(column,index) in cloneColumns" :key="index" style="background:#F5F6FA">
<label v-if="column.type === 'selection'">
<input type="checkbox" v-model="checks" @click="handleCheckAll">
</label>
<label v-else>
{{ renderHeader(column, index) }}
<span class="ivu-table-sort" v-if="column.sortable">
<Icon type="arrow-up-b" :class="{on: column._sortType === 'asc'}" @click.native="handleSort(index, 'asc')" />
<Icon type="arrow-down-b" :class="{on: column._sortType === 'desc'}" @click.native="handleSort(index, 'desc')" />
</span>
</label>
</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in initItems" :key="item.index" v-show="show(item)" :class="{'child-tr':item.parent}" class="mytr noacitve" @click="clicktr(item,$event,index)">
<td v-for="(column,snum) in columns" :key="column.key" :style=tdStyle(column)>
<label v-if="column.type === 'selection'">
<input type="checkbox" :value="item.id" v-model="checkGroup" @click="handleCheckClick(item,$event,index)">
</label>
<div v-if="column.type === 'action'" class="action">
<op :oprate="action.oprate" :class="action.class" @click="RowClick(item,$event,index,action.text)" v-for='action in (column.actions)' :key="action.text">{{action.text}}</op>
</div>
<label @click="toggle(index,item)" v-if="!column.type">
<span v-if='snum==iconRow()'>
<i v-html='item.spaceHtml'></i>
<i v-if="item.children&&item.children.length>0" class="ivu-icon" style="font-size:20px" :class="{'ivu-icon-md-arrow-dropright':!item.expanded,'ivu-icon-md-arrow-dropdown':item.expanded }"></i>
<i v-else class="ms-tree-space"></i>
</span> {{renderBody(item,column) }}
</label>
</td>
</tr>
</tbody>
</table>
</div>
</template>
<script>
export default {
name: 'treeGrid',
props: {
columns: Array,
items: {
type: Array,
default: function() {
return [];
}
}
},
data() {
return {
initItems: [], //处理后数据数组
cloneColumns: [], //处理后的表头数据
checkGroup: [], //复选框数组
checks: false, //全选
screenWidth: document.body.clientWidth, //自适应宽
tdsWidth: 0, //td总宽
timer: false, //控制监听时长
dataLength: 0, //树形数据长度
isActive:false,
leftWidth:0
}
},
computed: {
tableWidth() {
return this.tdsWidth > this.screenWidth && this.screenWidth > 0 ? this.screenWidth + 'px' : '100%'
}
},
watch: {
screenWidth(val) {
if (!this.timer) {
this.screenWidth = val
this.timer = true
setTimeout(() => {
this.timer = false
}, 400)
}
},
items() {
if (this.items) {
this.dataLength = this.Length(this.items)
this.initData(this.deepCopy(this.items), 1, null);
this.checkGroup = this.renderCheck(this.items)
if (this.checkGroup.length == this.dataLength) {
this.checks = true
} else {
this.checks = false
}
}
},
columns: {
handler() {
this.cloneColumns = this.makeColumns();
},
deep: true
},
checkGroup(data) {
this.checkAllGroupChange(data)
},
},
mounted() {
if (this.items) {
this.dataLength = this.Length(this.items)
this.initData(this.deepCopy(this.items), 1, null);
this.cloneColumns = this.makeColumns();
this.checkGroup = this.renderCheck(this.items)
if (this.checkGroup.length == this.dataLength) {
this.checks = true
} else {
this.checks = false
}
}
// 绑定onresize事件 监听屏幕变化设置宽
this.$nextTick(() => {
this.screenWidth = document.body.clientWidth
})
window.onresize = () => {
return (() => {
window.screenWidth = document.body.clientWidth;
this.screenWidth = window.screenWidth;
})()
}
},
methods: {
clicktr(data,e,i){
//console.log(e);
let result = this.makeData(data);
//console.log(result);
this.$emit('on-row-click', result, e, i)
var boxArr = document.querySelectorAll(".mytr");
// console.log(boxArr)
boxArr.forEach(function(item,index){
item.classList.remove('acitvetr');
if(i !==index){
item.classList.add('noacitve');
}
});
boxArr[i].classList.remove('noacitve');
boxArr[i].classList.add('acitvetr');
},
// 有无多选框折叠位置优化
iconRow() {
for (var i = 0, len = this.columns.length; i < len; i++) {
if (this.columns[i].type == 'selection') {
return 1
}
}
return 0
},
// 设置td宽度,td的align
tdStyle(column) {
var style = {}
if (column.align) {
style["text-align"] = column.align;
}
if (column.width) {
style["min-width"] = column.width + 'px';
}
return style;
},
// 排序事件
handleSort(index, type) {
this.cloneColumns.forEach((col) => col._sortType = 'normal');
if (this.cloneColumns[index]._sortType === type) {
this.cloneColumns[index]._sortType = 'normal'
} else {
this.cloneColumns[index]._sortType = type
}
this.$emit('on-sort-change', this.cloneColumns[index]['key'], this.cloneColumns[index]['_sortType'])
},
// 点击某一行事件
RowClick(data, event, index, text) {
let result = this.makeData(data)
this.$emit('on-row-click', result, event, index, text)
},
// 点击事件 返回数据处理
makeData(data) {
const t = this.type(data);
let o;
if (t === 'array') {
o = [];
} else if (t === 'object') {
o = {};
} else {
return data;
}
if (t === 'array') {
for (let i = 0; i < data.length; i++) {
o.push(this.makeData(data[i]));
}
} else if (t === 'object') {
for (let i in data) {
if (i != 'spaceHtml' && i != 'parent' && i != 'level' && i != 'expanded' && i != 'isShow' && i !=
'load') {
o[i] = this.makeData(data[i]);
}
}
}
return o;
},
// 处理表头数据
makeColumns() {
let columns = this.deepCopy(this.columns);
this.tdsWidth = 0
columns.forEach((column, index) => {
column._index = index;
column._width = column.width ? column.width : '';
column._sortType = 'normal';
this.tdsWidth += column.width ? parseFloat(column.width) : 0;
});
return columns;
},
// 数据处理 增加自定义属性监听
initData(items, level, parent) {
this.initItems = []
let spaceHtml = "";
for (var i = 1; i < level; i++) {
spaceHtml += "<i class='ms-tree-space'></i>"
}
items.forEach((item, index) => {
item = Object.assign({}, item, {
"parent": parent,
"level": level,
"spaceHtml": spaceHtml
});
if ((typeof item.expanded) == "undefined") {
item = Object.assign({}, item, {
"expanded": false
});
}
if ((typeof item.show) == "undefined") {
item = Object.assign({}, item, {
"isShow": false
});
}
if ((typeof item.isChecked) == "undefined") {
item = Object.assign({}, item, {
"isChecked": false
});
}
item = Object.assign({}, item, {
"load": (item.expanded ? true : false)
});
this.initItems.push(item);
if (item.children && item.expanded) {
this.initData(item.children, level + 1, item);
}
})
},
// 隐藏显示
show(item) {
return ((item.level == 1) || (item.parent && item.parent.expanded && item.isShow));
},
toggle(index, item) {
let level = item.level + 1;
let spaceHtml = "";
for (var i = 1; i < level; i++) {
spaceHtml += "<i class='ms-tree-space'></i>"
}
if (item.children) {
if (item.expanded) {
item.expanded = !item.expanded;
this.close(index, item);
} else {
item.expanded = !item.expanded;
if (item.load) {
this.open(index, item);
} else {
item.load = true;
item.children.forEach((child, childIndex) => {
this.initItems.splice((index + childIndex + 1), 0, child);
//设置监听属性
this.$set(this.initItems[index + childIndex + 1], 'parent', item);
this.$set(this.initItems[index + childIndex + 1], 'level', level);
this.$set(this.initItems[index + childIndex + 1], 'spaceHtml', spaceHtml);
this.$set(this.initItems[index + childIndex + 1], 'isShow', true);
this.$set(this.initItems[index + childIndex + 1], 'expanded', false);
})
}
}
}
},
open(index, item) {
if (item.children) {
item.children.forEach((child, childIndex) => {
child.isShow = true;
if (child.children && child.expanded) {
this.open(index + childIndex + 1, child);
}
})
}
},
close(index, item) {
if (item.children) {
item.children.forEach((child, childIndex) => {
child.isShow = false;
child.expanded = false;
if (child.children) {
this.close(index + childIndex + 1, child);
}
})
}
},
//点击check勾选框,判断是否有children节点 如果有就一并勾选
handleCheckClick(data, event, index){
data.isChecked = !data.isChecked;
var arr = data.children;
if(arr){
if(data.isChecked){
this.checkGroup.push(data.id);
for (let i=0; i<arr.length; i++){
this.checkGroup.push(arr[i].id)
}
}else {
for (var i=0; i<this.checkGroup.length; i++){
if(this.checkGroup[i] == data.id){
this.checkGroup.splice(i,1)
}
for (var j=0; j<arr.length; j++){
if(this.checkGroup[i] == arr[j].id){
this.checkGroup.splice(i,1);
}
}
}
}
}
},
//checkbox 全选 选择事件
handleCheckAll() {
this.checks = !this.checks;
if (this.checks) {
this.checkGroup = this.getArray(this.checkGroup.concat(this.All(this.items)))
} else {
this.checkGroup = []
}
// this.$emit('on-selection-change', this.checkGroup)
},
// 数组去重
getArray(a) {
var hash = {},
len = a.length,
result = [];
for (var i = 0; i < len; i++) {
if (!hash[a[i]]) {
hash[a[i]] = true;
result.push(a[i]);
}
}
return result;
},
checkAllGroupChange(data) {
if (this.dataLength > 0 && data.length === this.dataLength) {
this.checks = true;
} else {
this.checks = false;
}
this.$emit('on-selection-change', this.checkGroup)
},
All(data) {
let arr = []
data.forEach((item) => {
arr.push(item.id)
if (item.children && item.children.length > 0) {
arr = arr.concat(this.All(item.children));
}
})
return arr
},
// 返回树形数据长度
Length(data) {
let length = data.length
data.forEach((child) => {
if (child.children) {
length += this.Length(child.children)
}
})
return length;
},
// 返回表头
renderHeader(column, $index) {
if ('renderHeader' in this.columns[$index]) {
return this.columns[$index].renderHeader(column, $index);
} else {
return column.title || '#';
}
},
// 返回内容
renderBody(row, column, index) {
return row[column.key]
},
// 默认选中
renderCheck(data) {
let arr = []
data.forEach((item) => {
if (item._checked) {
arr.push(item.id)
}
if (item.children && item.children.length > 0) {
arr = arr.concat(this.renderCheck(item.children));
}
})
return arr
},
// 深度拷贝函数
deepCopy(data) {
var t = this.type(data),
o, i, ni;
if (t === 'array') {
o = [];
} else if (t === 'object') {
o = {};
} else {
return data;
}
if (t === 'array') {
for (i = 0, ni = data.length; i < ni; i++) {
o.push(this.deepCopy(data[i]));
}
return o;
} else if (t === 'object') {
for (i in data) {
o[i] = this.deepCopy(data[i]);
}
return o;
}
},
type(obj) {
var toString = Object.prototype.toString;
var map = {
'[object Boolean]': 'boolean',
'[object Number]': 'number',
'[object String]': 'string',
'[object Function]': 'function',
'[object Array]': 'array',
'[object Date]': 'date',
'[object RegExp]': 'regExp',
'[object Undefined]': 'undefined',
'[object Null]': 'null',
'[object Object]': 'object'
};
return map[toString.call(obj)];
}
},
beforeDestroy() {
window.onresize = null
}
}
</script>
<style scoped>
.autoTbale {
overflow: auto;
}
table {
width: 100%;
border-spacing: 0;
border-collapse: collapse;
}
.table-bordered {
border: 1px solid #EBEBEB;
}
.table>tbody>tr>td,
.table>tbody>tr>th,
.table>thead>tr>td,
.table>thead>tr>th {
border-top: 1px solid #e7eaec;
line-height: 1.42857;
padding: 8px ;
vertical-align: middle;
text-align: center
}
.table>tbody>tr>td:nth-child(1){
padding: 8px 8px 8px 30px;
text-align: left;
}
.table-bordered>tbody>tr>td,
.table-bordered>tbody>tr>th,
.table-bordered>tfoot>tr>td,
.table-bordered>tfoot>tr>th,
.table-bordered>thead>tr>td,
.table-bordered>thead>tr>th {
border: 1px solid #e7e7e7;
}
.table>thead>tr>th {
border-bottom: 1px solid #DDD;
}
.table-bordered>thead>tr>td,
.table-bordered>thead>tr>th {
background-color: #F5F5F6;
}
#hl-tree-table>tbody>tr {
height: 48px;
}
#hl-tree-table>tbody>tr:hover{
background-color: #ebf7ff;
}
.noacitve {
background-color: #fbfbfb;
}
.acitvetr {
background-color: #ebf7ff;
}
/deep/.ms-tree-space {
position: relative;
top: 1px;
display: inline-block;
font-style: normal;
font-weight: 400;
line-height: 1;
width: 14px;
height: 14px;
}
/deep/.ms-tree-space::before {
content: ""
}
#hl-tree-table th>label {
margin: 0;
}
</style>
<template>
<div>
<div class="contentRight " :style="{height:divHeihgt}">
<div style="height:32px;">
<div style="display:inline-block;">
<span class="margriht6">系统</span>
<Select
v-model="model1"
label-in-value
@on-change="model1Change"
style="width:240px"
placeholder="请选择"
>
<Option v-for="item in sysdata" :value="item.value" :key="item.value">{{item.label }}</Option>
</Select>
<span class="margriht6 marleft10">状态</span>
<Select v-model="model2" style="width:80px" placeholder="请选择">
<Option v-for="item in roleStatus" :value="item.value" :key="item.value">{{item.label }}</Option>
</Select>
<Button type="primary" @click="search">查询</Button>
</div>
<div style="float:right" class="paddingbtn">
<Button type="primary" @click="add">新增</Button>
<Button type="primary" @click="edit">编辑</Button>
<Button type="primary" @click="del">删除</Button>
</div>
</div>
<div class="margin-top-10">
<tree-grid
:items="data"
ref="table"
:columns="columns"
@on-row-click="rowClick"
@on-selection-change="selectionClick"
@on-sort-change="sortClick"
></tree-grid>
</div>
</div>
<Modal
v-model="modal1"
:mask-closable="false"
title="新增权限菜单"
:width="800"
:loading="myloading"
ok-text="保存"
cancel-text="取消"
@on-ok="ok('formValidate')"
@on-cancel="cancel"
>
<add-privilege :seldata="seldata" ref="addpri" v-on:selectSys="selectSys"></add-privilege>
<!-- <div slot="footer" style="text-align:center">
<Button type="primary" @click="ok('formValidate')">保存</Button>
<Button
type="primary"
style="border-color: rgb(204, 204, 204);background-color:white;color:black"
@click="cancel"
>取消</Button>
</div>-->
</Modal>
<myconfirm ref="mysel" v-on:confirmok="okmysel" v-on:confirmcancel="cancelmysel"></myconfirm>
</div>
</template>
<script>
import treeGrid from './components/treeGrid'
import addPrivilege from './components/add'
import myconfirm from '../../processDesign/productTree/components/myconfirm'
import service from '@/plugins/request'
export default {
components: {
treeGrid,
addPrivilege,
myconfirm
},
data() {
return {
model1: '',
model1Name: '',
model2: '',
modal1: false,
keyid: 0,
divHeihgt:"",
myloading:true,
//点击的行号
clickindex: -1,
clickdata: {},
checkids: [],
//添加还是编辑
isedit: false,
//添加时候表单数据
formValidate1: {},
sysdata: [
// {
// value: '-1',
// label: '全部'
// },
{
value: '0',
label: '3车间MES'
},
{
value: '1',
label: '机加MES'
}
],
roleStatus: [
{
value: '-1',
label: '不限'
},
{
value: '0',
label: '启用'
},
{
value: '1',
label: '禁用'
}
],
columns: [
// {
// type: 'selection'
// },
{
title: '权限名称',
key: 'name',
width: '150',
sortable: true
},
// {
// title: '父权限',
// key: 'up_id'
// },
{
title: '系统',
key: 'system_name',
align:"left",
},
{
title: '地址',
key: 'url',
width: '200',
align:"left",
},
// {
// title: '密级',
// key: 'secret_class'
// },
{
title: '状态',
key: 'status_name',
render: (h, params) => {
return h(
'span',
{
on: {
click: () => {}
}
},
params.status == '0' ? '启用' : '禁用'
)
}
},
{
title: '类型',
key: 'type_name'
},
// {
// title: '打开方式',
// key: 'target'
// },
{
title: '排序',
key: 'priority'
},
{
title: '创建时间',
key: 'creationTime',
width: '150',
},
{
title: '修改时间',
key: 'lastModificationTime',
width: '150',
}
// {
// title: '操作',
// type: 'action',
// actions: [{
// type: 'primary',
// text: '编辑'
// }, {
// type: 'error',
// text: '删除'
// }],
// width: '150',
// }
],
data: [],
//父权限菜单树
seldata: [],
//父权限名
parent_name: ''
}
},
methods: {
loaddata: function() {
var url = `${systemUrl}/Privilege/getprivileges`
var that = this
service.get(`${url}`, this.searchdata ).then((response) => {
// console.log(response)
that.data = response.result
})
},
lodataByid: function(data1) {
var url = `${systemUrl}/Privilege/GetById`
service
.get(`${url}`, { id: this.clickindex })
.then((response) => {
//console.log(response)
data1 = response.result
//console.log(data1)
this.gettree(data1.from_system, data1)
})
},
gettree(sid, data1) {
service
.get(`${systemUrl}/Privilege/getTree`, { from_system: sid,id:this.clickindex})
.then((response) => {
this.seldata = response.result
this.$refs.addpri.list = []
if (this.clickindex >= 0) {
if (data1) {
//下拉列表切换的时候
if (data1 == 'selectSys') {
//alert(1)
this.$refs.addpri.formValidate.up_id = 0
this.$refs.addpri.list.push({ label: '根节点', value: 0 })
this.setSelect(this.seldata, 0)
} else {
// alert(2)
console.log(data1)
if (this.isedit) {
// alert(12)
this.setSelect(this.seldata, data1.up_id)
this.$refs.addpri.list.push({
label: this.parent_name,
value: data1.up_id
})
this.$refs.addpri.formValidate = data1
this.$refs.addpri.formValidate.from_system=data1.from_system+''
this.$refs.addpri.formValidate.status = data1.status + ''
this.$refs.addpri.formValidate.type = data1.type + ''
} else {
// alert(13)
this.setSelect(this.seldata, data1.id)
this.$refs.addpri.formValidate={}
this.$refs.addpri.formValidate.up_id = data1.id
this.$refs.addpri.formValidate.from_system = data1.from_system+''
//this.$refs.addpri.formValidate.id=''
this.$refs.addpri.list.push({
label: this.parent_name,
value: data1.id
})
}
}
}
} else {
}
})
},
search: function() {
this.isedit = false
this.clickindex=-1
this.loaddata()
this.gettree(this.searchdata.from_system)
},
selectSys: function(val) {
this.gettree(val, 'selectSys')
},
setnoselect: function(data, val) {
data.forEach((item, index) => {
item.selected = false
if (item.children) {
this.setnoselect(item.children)
}
})
},
setSelect: function(data, val) {
//data=this.seldata;
this.setnoselect(data)
data.forEach((item, index) => {
item.selected = false
if (item.value == val) {
// alert(11)
item.selected = true
this.parent_name = item.title
} else {
if (item.children) {
this.setSelect(item.children, val)
}
}
})
//console.log(data)
},
add: function() {
// if(this.datacount>=1 && this.clickindex < 0){
// this.$Message.error("请选中一个根节点后再添加");
// return;
// }
this.isedit = false
this.setnoselect(this.seldata)
this.$refs.addpri.$refs['formValidate'].resetFields()
this.modal1 = true
this.$refs.addpri.list = []
if (this.clickindex < 0) {
this.$refs.addpri.formValidate.up_id = 0
this.$refs.addpri.list.push({ label: '根节点', value: 0 })
this.setSelect(this.seldata, 0)
console.log(this.searchdata.from_system)
this.$refs.addpri.formValidate.from_system = this.searchdata.from_system+''
}
//选中一行
else {
var data1 = {}
this.lodataByid(data1)
}
},
//新增,编辑保存
ok: function(name) {
var a = this.$refs.addpri
a.$refs[name].validate((valid) => {
if (valid) {
//this.$Message.success('Success!');
var url = `${systemUrl}/Privilege/CreateOrUpdate`
var that = this
if(!this.$refs.addpri.formValidate.status){
this.$refs.addpri.formValidate.status=0
}
if(!this.$refs.addpri.formValidate.priority){
this.$refs.addpri.formValidate.priority=0
}
if(this.$refs.addpri.formValidate.priority){
if(typeof(this.$refs.addpri.formValidate.priority) !='number'){
that.$Message.error('排序字段只能输入数字');
return;
}
}
this.formValidate1 = this.$refs.addpri.formValidate
//console.log(this.formValidate1)
service
.post(`${url}`, { Privilege: this.formValidate1 })
.then((response) => {
if (response.success) {
that.$Message.success('保存成功')
that.loaddata()
// that.gettree();
this.modal1 = false
}
})
.catch((error) => {
that.$Message.error('保存失败')
})
//
} else {
setTimeout(() => {
this.myloading = false
this.$nextTick(() => {
this.myloading = true
})
}, 500)
this.$Message.error('请输入必填项')
}
})
},
edit: function() {
if (this.clickindex >= 0) {
this.modal1 = true
this.isedit = true
this.$refs.addpri.$refs['formValidate'].resetFields()
var data1 = {}
this.lodataByid(data1)
//编辑页面父权限下拉设置
// this.$refs.addpri.formValidate.up_id=data.up_id;
} else {
this.$Message.warning('请选中一行数据')
}
},
del: function() {
if (this.clickindex >= 0 || this.checkids.length > 0) {
var data = this.clickdata
this.keyid = data.id
this.$refs.mysel.confirmmodal = true
} else {
this.$Message.warning('请选中一行数据')
}
},
okmysel(bl) {
var url = `${systemUrl}/Privilege/Delete`
var that = this
service
.delete(`${url}?id=${this.keyid}`)
.then((response) => {
if (response.success) {
that.$Message.success('删除成功')
that.loaddata()
}
})
.catch((error) => {
that.$Message.error('删除失败')
})
that.$refs.mysel.confirmmodal = bl
},
cancelmysel(bl) {
this.$refs.mysel.confirmmodal = bl
},
cancel: function() {
this.isedit=false
this.modal1 = false
},
rowClick(data, event, index, txt) {
//console.log('当前行数据:' + data)
//console.log('点击行号:' + index)
//console.log('点击事件:' + event)
data = JSON.stringify(data)
data = JSON.parse(data)
this.clickindex = data.id
this.clickdata = data
},
selectionClick(arr) {
//console.log('选中数据id数组:' + arr)
this.checkids = arr
},
sortClick(key, type) {
//console.log('排序字段:' + key)
//console.log('排序规则:' + type)
},
model1Change: function(v) {
//console.log(v);
this.model1Name = v.label
}
},
created() {
this.model1 = this.sysdata[0].value
this.model1Name = this.sysdata[0].label
this.model2 = this.roleStatus[0].value
this.loaddata()
//this.gettree(this.model1)
this.divHeihgt= window.innerHeight - 100+"px";
},
mounted() {
// this.tbPro.height = window.innerHeight - this.$refs.table.$el.offsetTop - 70
window.onresize = () => {
return (() => {
this.divHeihgt = window.innerHeight - 100+"px";
})()
}
},
computed: {
searchdata: function() {
return {
from_system: this.model1,
status: this.model2,
system_name: this.model1Name
}
},
datacount:function(){
return this.data.length
}
}
}
</script>
<style scoped>
.margriht6 {
display: inline-block;
margin-right: 6px;
}
.marleft10 {
margin-left: 10px;
}
.marleft20 {
margin-left: 20px;
}
</style>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${workflowUrl}/instance/getpaged`,
paged(params) {
return Api.post(`${workflowUrl}/instance/getpaged`, params);
},
//待办事项--获取审批类型:
getAll() {
return Api.get(`${workflowUrl}/schema/getall`);
},
getdetail(params) {
return Api.get(`${workflowUrl}/instance/getdetail`, params);
},
//获取当前订单信息
get(params) {
return Api.get(`${workflowUrl}/instance/get`, params);
},
//审核通过工作流实例中的流程节点
pass(params) {
return Api.post(`${workflowUrl}/instance/pass`, params);
},
//驳回工作流实例中的流程节点
reject(params) {
return Api.post(`${workflowUrl}/instance/reject`, params);
},
//终止工作流实例流程
terminate(params) {
return Api.post(`${workflowUrl}/instance/terminate`, params);
},
}
\ No newline at end of file
<template>
<div class="detail" style="width:90%;margin:0 auto">
<Row>
<Filed :span="6" :name="l('productName')">{{entity.productName}}</Filed>
<Filed :span="6" :name="l('mesCode')">{{entity.mesCode}}</Filed>
<Filed :span="6" :name="l('drawnNumber')">{{entity.drawnNumber}}</Filed>
<Filed :span="6" :name="l('stage')"><state code="plan.order.stage" :value="entity.stage+''" type="text"></state></Filed>
<Filed :span="6" :name="l('taskType')"><state code="plan.order.taskType" :value="entity.taskType+''" type="text"></state></Filed>
<Filed :span="6" :name="l('quantity')">{{entity.quantity}}</Filed>
<Filed :span="6" :name="l('materialId')"><state code="plan.order.material" :value="entity.materialId+''" type="text"></state></Filed>
<Filed :span="6" :name="l('routing_Method')"><state code="plan.order.routingMethod" :value="entity.routing_Method+''" type="text"></state></Filed>
<Filed :span="6" :name="l('outer_Envelope_Size')">{{entity.outer_Envelope_Size}}</Filed>
<Filed :span="6" :name="l('demandStartDate')">{{entity.demandStartDate}}</Filed>
<Filed :span="6" :name="l('demandFinishDate')">{{entity.demandFinishDate}}</Filed>
<Filed :span="6" :name="l('printSupply')"><state code="plan.order.printSupply" :value="entity.printSupply+''" type="text"></state></Filed>
<Filed :span="6" :name="l('guestName')"><state code="plan.order.guestName" :value="entity.guestName+''" type="text"></state></Filed>
<Filed :span="6" :name="l('functionaryOffice')">{{entity.functionaryOffice}}</Filed>
<Filed :span="6" :name="l('taskRequire')">{{entity.taskRequire}}</Filed>
<Filed :span="6" :name="l('taskInputDate')">{{entity.taskInputDate}}</Filed>
<Filed :span="6" :name="l('mainDepartmentId')"><state code="plan.order.mainDepartment" :value="entity.mainDepartmentId+''" type="text"></state></Filed>
<Filed :span="6" :name="l('technologyDocmentCode')">{{entity.technologyDocmentCode}}</Filed>
<Filed :span="6" :name="l('putintDocmentCode')">{{entity.putintDocmentCode}}</Filed>
<Filed :span="6" :name="l('outerDrawnNumber')">{{entity.outerDrawnNumber}}</Filed>
<Filed :span="6" :name="l('modelVersion')">{{entity.modelVersion}}</Filed>
<Filed :span="6" :name="l('designer')">{{entity.designer}}</Filed>
<Filed :span="6" :name="l('taskCode')">{{entity.taskCode}}</Filed>
<Filed :span="6" :name="l('mainRoutingPeople')">{{entity.mainRoutingPeople}}</Filed>
<Filed :span="6" :name="l('officeFunctionary')">{{entity.officeFunctionary}}v</Filed>
<Filed :span="24" :name="l('remark')">{{entity.remark}}</Filed>
</Row>
</div>
</template>
<script>
import Api from '../api'
export default {
name: 'detail',
components: {
},
props: {
idVal: {
type: String,
default: ''
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
entity: {
state:'',
},
}
},
created() {
this.dataImmut = []
this.dataMut = []
Api.get({ Id: this.idVal }).then((r) => {
if (r.success) {
let formStr=r.result.formData.replace(/\"/g, '"')
this.entity = JSON.parse(formStr)[0]
} else {
this.$Message.error('加载失败')
}
})
},
methods: {
load(v) {},
l(key) {
key = 'orderInfo' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<style lang="less">
.detail {
display: table;
border-collapse: collapse;
.ivu-row {
display: table-row;
.filed-col {
display: table-cell;
border: 1px solid #ddd;
margin: 0 0 -1px -1px;
line-height: 30px;
box-sizing: border-box;
.label {
background: #e8eaf1;
display: inline-block;
width: 120px;
text-align: right;
padding: 0 5px;
}
}
}
}
</style>
<template>
<div style="padding:40px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" @node-click="show"/>
<!-- <Footer :idVal="detailId" :footerStatu="footerStatu" @showModalCheckOk='modalCheckOk=true'></Footer> -->
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form
:model="formMyCheck"
:label-width="100"
:rules="ruleValidate"
inline
ref="formValidate"
>
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem
label="驳回节点:"
v-if="formMyCheck.radioSp === '驳回'"
prop="rejectToNodeId"
>
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<!-- 订单审里通过form -->
<Modal
v-model="modalCheckOk"
title="订单审里"
width="800"
:scrollable="true"
>
<Form :model="formMyCheck" :label-width="100">
<Row>
<Col span="12">
<FormItem label="工时:" style="width:100%">
<InputNumber
v-model="formMyCheck.workHours"
:step="1"
:min="2"
style="width:240px"
/>
</FormItem>
</Col>
<Col span="12">
<FormItem label="打印周期:" style="width:100%">
<InputNumber
v-model="formMyCheck.printPeriod"
:step="1"
:min="2"
style="width:240px"
/>
</FormItem>
</Col>
</Row>
<Row>
<Col span="12">
<FormItem label="设备:" style="width:100%">
<Input v-model="formMyCheck.equipment" style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="材料重量:" style="width:100%">
<Input v-model="formMyCheck.materialWeight" style="width:240px" />
</FormItem>
</Col>
</Row>
</Form>
<div slot="footer">
<Button @click="modalCheckOk = false">取消</Button>
<Button type="primary" @click="checkOk" v-show="footerStatue">确定</Button>
</div>
</Modal>
<Modal
v-model="modalCheckNo"
title="订单审批"
width="800"
:scrollable="true"
>
<br />
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process,
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
footerStatue:true,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.footerStatue=true
this.modalCheckOk = true
} else if (this.formMyCheck.radioSp == '驳回') {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
}
})
} else {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '终止'
} else {
}
})
}
},
show(a){
this.footerStatue=false
let contextDate=JSON.parse(a.contextData)
this.formMyCheck=contextDate
this.modalCheckOk=true
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
this.testObj = r
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId=r.result.currentRecordId
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//根据当前登录用户返回records的id
getRecordsId(records) {
records.forEach((data) => {
if (data.operatorId == this.currentUserId) {
this.passId = data.id
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
//根据当前nodeid找到下一节点的defaultUser
// this.nextNodeUserIdList = []
// if (index + 1 < nodes.length) {
// this.nextNodeUserIdList = nodes[index + 1].defaultUsers.immutable
// }
//返回当前节点的records,用于查找在records里当前登录用户的对应的id
//this.getDetailRecords = nodes[index].records
//this.getRecordsId(this.getDetailRecords)
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
workHours: this.formMyCheck.workHours,
printPeriod: this.formMyCheck.printPeriod,
equipment: this.formMyCheck.equipment,
materialWeight: this.formMyCheck.materialWeight
}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckOk = false
},
//审批驳回
checkNo() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
checkCancel() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
this.footerStatu = 3
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<template>
<div class="detail" style="width:90%;margin:0 auto">
<Row>
<Filed :span="8" :name="l('code')">{{formValidate.code}}</Filed>
<Filed :span="8" :name="l('creationTime')">{{formValidate.creationTime}}</Filed>
<Filed :span="8" :name="l('lastModificationTime')">{{formValidate.creationTime}}</Filed>
<Filed :span="8" :name="l('repair_file_name')">{{formValidate.repair_file_name}}</Filed>
<Filed :span="8" :name="l('repair_file_status')">
<state
code="process.formDataStatus"
:value="formValidate.repair_file_status+''"
type="text"
></state>
</Filed>
<Filed :span="8" :name="l('repair_file_url')">{{formValidate.repair_file_url}}</Filed>
<Filed :span="8" :name="l('supporting_file_name')">{{formValidate.supporting_file_name}}</Filed>
<Filed :span="8" :name="l('supporting_file_status')">
<state
code="process.formDataStatus"
:value="formValidate.supporting_file_status+''"
type="text"
></state>
</Filed>
<Filed :span="8" :name="l('supporting_file_url')">{{formValidate.supporting_file_ulr}}</Filed>
<Filed :span="8" :name="l('slicing_file_name')">{{formValidate.slicing_file_name}}</Filed>
<Filed :span="8" :name="l('slicing_file_status')">
<state
code="process.formDataStatus"
:value="formValidate.slicing_file_status+''"
type="text"
></state>
</Filed>
<Filed :span="8" :name="l('slicing_file_url')">{{formValidate.slicing_file_url}}</Filed>
</Row>
</div>
</template>
<script>
import Api from '../api'
export default {
name: 'detail',
components: {},
props: {
idVal: {
type: String,
default: ''
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
formValidate: {
state: ''
}
}
},
created() {
this.dataImmut = []
this.dataMut = []
Api.get({ Id: this.idVal }).then((r) => {
if (r.success) {
let farmData = {}
farmData = JSON.parse(r.result.formData)
console.log(farmData)
this.formValidate = farmData
// let formStr = r.result.formData.replace(/\"/g, '"')
// this.formValidate = JSON.parse(formStr)[0]
} else {
this.$Message.error('加载失败')
}
})
},
methods: {
load(v) {},
l(key) {
key = 'OrderDataReview' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<style lang="less">
.detail {
display: table;
border-collapse: collapse;
.ivu-row {
display: table-row;
.filed-col {
display: table-cell;
border: 1px solid #ddd;
margin: 0 0 -1px -1px;
line-height: 30px;
box-sizing: border-box;
.label {
background: #e8eaf1;
display: inline-block;
width: 120px;
text-align: right;
padding: 0 5px;
}
}
}
}
</style>
<template>
<div style="padding:40px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal v-model="modalCheckNo" title="修复文件审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此修复文件审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.modalCheckNo = true
} else if (this.formMyCheck.radioSp == '驳回') {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
}
})
} else {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '终止'
} else {
}
})
}
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
this.testObj = r
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId=r.result.currentRecordId
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
this.modalCheckNo = true
}
})
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.modalCheckNo = false
} else {
this.$Message.error('加载失败')
this.modalCheckNo = true
}
})
},
//审批终止
checkCancel() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
//alert(JSON.stringify(param))
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.modalCheckNo = false
} else {
this.$Message.error('加载失败')
this.modalCheckNo = true
}
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
} else if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
}
this.footerStatu = 3
},
l(key) {
key = 'OrderDataReview' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<template>
<div class="detail" style="width:90%;margin:0 auto">
<Row>
<Filed :span="8" :name="l('code')">{{formValidate.code}}</Filed>
<Filed :span="8" :name="l('creationTime')">{{formValidate.creationTime}}</Filed>
<Filed :span="8" :name="l('lastModificationTime')">{{formValidate.creationTime}}</Filed>
<Filed :span="8" :name="l('repair_file_name')">{{formValidate.repair_file_name}}</Filed>
<Filed :span="8" :name="l('repair_file_status')">
<state
code="process.formDataStatus"
:value="formValidate.repair_file_status+''"
type="text"
></state>
</Filed>
<Filed :span="8" :name="l('slicing_file_url')">{{formValidate.slicing_file_url}}</Filed>
<Filed :span="8" :name="l('supporting_file_name')">{{formValidate.supporting_file_name}}</Filed>
<Filed :span="8" :name="l('supporting_file_status')">
<state
code="process.formDataStatus"
:value="formValidate.supporting_file_status+''"
type="text"
></state>
</Filed>
<Filed :span="8" :name="l('repair_file_url')">{{formValidate.repair_file_url}}</Filed>
<Filed :span="8" :name="l('slicing_file_name')">{{formValidate.slicing_file_name}}</Filed>
<Filed :span="8" :name="l('slicing_file_status')">
<state
code="process.formDataStatus"
:value="formValidate.slicing_file_status+''"
type="text"
></state>
</Filed>
<Filed :span="8" :name="l('supporting_file_url')">{{formValidate.supporting_file_ulr}}</Filed>
</Row>
</div>
</template>
<script>
import Api from '../api'
export default {
name: 'detail',
components: {},
props: {
idVal: {
type: String,
default: ''
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
formValidate: {
state: ''
}
}
},
created() {
this.dataImmut = []
this.dataMut = []
Api.get({ Id: this.idVal }).then((r) => {
// console.log(r)
if (r.success) {
let farmData = {}
farmData = JSON.parse(r.result.formData)
console.log(farmData)
this.formValidate = farmData
// let formStr = r.result.formData.replace(/\"/g, '"')
// this.formValidate = JSON.parse(formStr)[0]
} else {
this.$Message.error('加载失败')
}
})
},
methods: {
load(v) {},
l(key) {
key = 'OrderDataReview' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<style lang="less">
.detail {
display: table;
border-collapse: collapse;
.ivu-row {
display: table-row;
.filed-col {
display: table-cell;
border: 1px solid #ddd;
margin: 0 0 -1px -1px;
line-height: 30px;
box-sizing: border-box;
.label {
background: #e8eaf1;
display: inline-block;
width: 120px;
text-align: right;
padding: 0 5px;
}
}
}
}
</style>
<template>
<div style="padding:40px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal v-model="modalCheckNo" title="支撑文件审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此支撑文件审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.modalCheckNo = true
} else if (this.formMyCheck.radioSp == '驳回') {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
}
})
} else {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '终止'
} else {
}
})
}
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
this.testObj = r
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId=r.result.currentRecordId
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
this.modalCheckNo = true
}
})
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.modalCheckNo = false
} else {
this.$Message.error('加载失败')
this.modalCheckNo = true
}
})
},
//审批终止
checkCancel() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
//alert(JSON.stringify(param))
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.modalCheckNo = false
} else {
this.$Message.error('加载失败')
this.modalCheckNo = true
}
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
} else if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
}
this.footerStatu = 3
},
l(key) {
key = 'OrderDataReview' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<template>
<div class="detail" style="width:90%;margin:0 auto">
<Row>
<Filed :span="8" :name="l('code')">{{formValidate.code}}</Filed>
<Filed :span="8" :name="l('creationTime')">{{formValidate.creationTime}}</Filed>
<Filed :span="8" :name="l('lastModificationTime')">{{formValidate.creationTime}}</Filed>
<Filed :span="8" :name="l('repair_file_name')">{{formValidate.repair_file_name}}</Filed>
<Filed :span="8" :name="l('repair_file_status')">
<state
code="process.formDataStatus"
:value="formValidate.repair_file_status+''"
type="text"
></state>
</Filed>
<Filed :span="8" :name="l('repair_file_url')">{{formValidate.repair_file_url}}</Filed>
<Filed :span="8" :name="l('supporting_file_name')">{{formValidate.supporting_file_name}}</Filed>
<Filed :span="8" :name="l('supporting_file_status')">
<state
code="process.formDataStatus"
:value="formValidate.supporting_file_status+''"
type="text"
></state>
</Filed>
<Filed :span="8" :name="l('supporting_file_url')">{{formValidate.supporting_file_ulr}}</Filed>
<Filed :span="8" :name="l('slicing_file_name')">{{formValidate.slicing_file_name}}</Filed>
<Filed :span="8" :name="l('slicing_file_status')">
<state
code="process.formDataStatus"
:value="formValidate.slicing_file_status+''"
type="text"
></state>
</Filed>
<Filed :span="8" :name="l('slicing_file_url')">{{formValidate.slicing_file_url}}</Filed>
</Row>
</div>
</template>
<script>
import Api from '../api'
export default {
name: 'detail',
components: {},
props: {
idVal: {
type: String,
default: ''
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
formValidate: {
state: ''
}
}
},
created() {
this.dataImmut = []
this.dataMut = []
Api.get({ Id: this.idVal }).then((r) => {
console.log(r)
if (r.success) {
let farmData = {}
farmData = JSON.parse(r.result.formData)
console.log(farmData)
this.formValidate = farmData
// let formStr = r.result.formData.replace(/\"/g, '"')
// this.formValidate = JSON.parse(formStr)[0]
} else {
this.$Message.error('加载失败')
}
})
},
methods: {
load(v) {},
l(key) {
key = 'OrderDataReview' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<style lang="less">
.detail {
display: table;
border-collapse: collapse;
.ivu-row {
display: table-row;
.filed-col {
display: table-cell;
border: 1px solid #ddd;
margin: 0 0 -1px -1px;
line-height: 30px;
box-sizing: border-box;
.label {
background: #e8eaf1;
display: inline-block;
width: 120px;
text-align: right;
padding: 0 5px;
}
}
}
}
</style>
<template>
<div style="padding:40px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal v-model="modalCheckNo" title="切片文件审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此切片文件审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.modalCheckNo = true
} else if (this.formMyCheck.radioSp == '驳回') {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
}
})
} else {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '终止'
} else {
}
})
}
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
this.testObj = r
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId=r.result.currentRecordId
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
this.modalCheckNo = true
}
})
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.modalCheckNo = false
} else {
this.$Message.error('加载失败')
this.modalCheckNo = true
}
})
},
//审批终止
checkCancel() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
//alert(JSON.stringify(param))
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.modalCheckNo = false
} else {
this.$Message.error('加载失败')
this.modalCheckNo = true
}
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
} else if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
}
this.footerStatu = 3
},
l(key) {
key = 'OrderDataReview' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<template>
<div class="detail" style="width:80%;margin:0 auto">
<Row>
<Metal-Details
ref="metalDetail"
:resultDetils="resultDetils"
v-if="detailStatu == 1"
></Metal-Details>
<photosensitive-details
v-else
ref="photosensitiveDetail"
:resultDetils="resultDetils"
></photosensitive-details>
</Row>
</div>
</template>
<script>
import Api from '../api'
import MetalDetails from '../../order/quotation/components/metalDetailsExamine.vue' //报价历史记录铺粉详情弹框
import PhotosensitiveDetails from '../../order/quotation/components/photosensitiveDetailsExamine.vue' //报价历史记录光敏详情弹框
export default {
name: 'detail',
components: {
MetalDetails,
PhotosensitiveDetails
},
props: {
idVal: {
type: String,
default: ''
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
entity: {
state: ''
},
resultDetils: [], //报价记录详情
detailStatu: 1
}
},
created() {
Api.get({ Id: this.idVal }).then((r) => {
if (r.success) {
let formStr = r.result.formData.replace(/\"/g, '"')
this.entity = JSON.parse(formStr)
this.infoDetail(this.entity)
} else {
this.$Message.error('加载失败')
}
})
},
methods: {
load(v) {},
//详情
infoDetail(row) {
//判断报价单类型是金属还是光敏
if (row.quotationType == 'AlSi10Mg') {
// this.$refs.metalDetail.modalShow = true
this.detailStatu = 1
}
if (row.quotationType == '光敏树脂') {
// this.$refs.photosensitiveDetail.modalShow = true
this.detailStatu = 2
}
this.$http.quotation
.orderList({
id: row.id
})
.then((res) => {
this.resultDetils = res.result
})
.catch((error) => {
this.$Message.error('请求失败')
})
}
},
watch: {}
}
</script>
<style lang="less">
.detail {
display: table;
border-collapse: collapse;
.ivu-row {
display: table-row;
.filed-col {
display: table-cell;
border: 1px solid #ddd;
margin: 0 0 -1px -1px;
line-height: 30px;
box-sizing: border-box;
.label {
background: #e8eaf1;
display: inline-block;
width: 120px;
text-align: right;
padding: 0 5px;
}
}
}
}
</style>
<template>
<div style="padding:40px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form
:model="formMyCheck"
:label-width="100"
:rules="ruleValidate"
inline
ref="formValidate"
>
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem
label="驳回节点:"
v-if="formMyCheck.radioSp === '驳回'"
prop="rejectToNodeId"
>
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal
v-model="modalCheckNo"
title="订单审批"
width="800"
:scrollable="true"
>
<br />
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.modalCheckNo = true
this.statuTitle = '通过'
} else if (this.formMyCheck.radioSp == '驳回') {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
}
})
} else {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '终止'
} else {
}
})
}
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId=r.result.currentRecordId
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu=3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
this.footerStatu=3
},
//审批驳回
checkNo() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu=3
} else {
this.$Message.error('加载失败')
}
})
this.modalCheckNo = false
},
//审批终止
checkCancel() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
//alert(JSON.stringify(param))
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.footerStatu=3
} else {
this.$Message.error('加载失败')
}
})
this.modalCheckNo = false
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
} else if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<style lang="less">
@import '../../processDesign/Process/menu.less';
</style>
<template>
<div class="outP" style="width:80%;margin:0 auto">
<Processview ref="processview" :isoutpdf="false"></Processview>
</div>
</template>
<script>
import Api from '../api'
import Processview from '../../processDesign/Process/processview.vue'
export default {
name: 'detail',
components: {
Processview
},
props: {
idVal: {
type: String,
default: ''
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
entity: {
state: ''
},
resultDetils: [], //报价记录详情
detailStatu: 1
}
},
created() {
this.load(this.idVal)
},
methods: {
load(v) {
Api.get({ Id: this.idVal }).then((r) => {
if (r.success) {
this.$refs.processview.loaddata(r.result.fromIds)
} else {
this.$Message.error('加载失败')
}
})
}
//详情
},
mounted() {},
watch: {
idVal(v) {
this.load(v)
}
}
}
</script>
<style lang="less">
.logoimg {
width: 100%;
height: 80px;
}
.h3title {
height: 30px;
padding-right: 10px;
}
.center {
text-align: center;
}
.table_box {
border: 1px solid #000;
.table_row {
height: 40px;
line-height: 40px;
border-bottom: 1px solid #000;
div {
text-align: center;
}
.row_label {
border-right: 1px solid #000;
}
.row_cont {
width: 370px;
height: 40px;
border-right: 1px solid #000;
}
.row_cont02 {
height: 40px;
border-right: 1px solid #000;
}
.img_line {
border-right: 1px solid #000;
}
.userse {
border-right: 1px solid #000;
}
.user02 {
width: 165px;
}
.userse02 {
width: 165px;
height: 40px;
border-right: 1px solid #000;
}
}
.img_row {
height: 300px;
.fu {
text-align: left;
text-indent: 18px;
height: 280px;
img {
max-width: 90%;
}
overflow: auto;
}
}
.footer_text {
text-align: left !important;
padding: 0 0 0 14px;
}
.border_none {
border: none !important;
}
}
</style>
<template>
<div style="padding:40px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form
:model="formMyCheck"
:label-width="100"
:rules="ruleValidate"
inline
ref="formValidate"
>
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem
label="驳回节点:"
v-if="formMyCheck.radioSp === '驳回'"
prop="rejectToNodeId"
>
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal
v-model="modalCheckNo"
title="订单审批"
width="800"
:scrollable="true"
>
<br />
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此工艺规程审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.modalCheckNo = true
this.statuTitle = '通过'
} else if (this.formMyCheck.radioSp == '驳回') {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
}
})
} else {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '终止'
} else {
}
})
}
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId=r.result.currentRecordId
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
},
//审批驳回
checkNo() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
checkCancel() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
//alert(JSON.stringify(param))
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
} else if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<template>
<div class="detail" style="width:90%;margin:0 auto">
<Row>
<Filed :span="8" :name="l('documentCode')">{{processData.orderMaterial.code}}</Filed>
<Filed :span="8" :name="l('platesNum')">{{processData.orderMaterial.platesnum}}</Filed>
<Filed :span="8" :name="l('perBoard')">{{processData.orderMaterial.quota_per_board}}</Filed>
<Filed :span="8" :name="l('powderName')">{{processData.orderMaterialList.name}}</Filed>
<Filed :span="8" :name="l('powderBrand')">{{processData.orderMaterialList.pate_number}}</Filed>
<Filed :span="8" :name="l('powderSpec')">{{processData.orderMaterialList.spec}}</Filed>
<Filed :span="8" :name="l('powderCategory')">
<state code="mes_xingchi_resource.material.powderType" :value="processData.orderMaterialList.categories+''" type="text">
</state>
</Filed>
<Filed :span="8" :name="l('powderTotal')">{{processData.orderMaterialList.quantity}}</Filed>
<Filed :span="8" :name="l('partHeight')">{{processData.orderMaterialList.estimated_part_height}}</Filed>
<Filed :span="8" :name="l('PlacodeName')">{{processData.orderMaterialList01.name}}</Filed>
<Filed :span="8" :name="l('PlacodeBrand')">{{processData.orderMaterialList01.pate_number}}</Filed>
<Filed :span="8" :name="l('PlacodeSpec')">{{processData.orderMaterialList01.spec}}</Filed>
<Filed :span="8" :name="l('PlacodeDevice')">{{processData.orderMaterialList01.use_equip}}</Filed>
<Filed :span="8" :name="l('Placodeland')">{{processData.orderMaterialList01.lower_basal_plate}}</Filed>
<Filed :span="8" :name="l('PlacodeTotal')">{{processData.orderMaterialList01.quantity}}</Filed>
<Filed :span="8" :name="l('ScraperSpec')">{{processData.orderMaterialList02.spec}}</Filed>
<Filed :span="8" :name="l('ScraperTotal')">{{processData.orderMaterialList02.quantity}}</Filed>
</Row>
</div>
</template>
<script>
import Api from '../api'
export default {
name: 'detail',
components: {
},
props: {
idVal: {
type: String,
default: ''
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
processData: {
orderMaterial:[],
orderMaterialList:[],
orderMaterialList01:[],
orderMaterialList02:[],
state:'',
},
}
},
created() {
this.dataImmut = []
this.dataMut = []
Api.get({ Id: this.idVal }).then((r) => {
if (r.success) {
let itemData = JSON.parse(r.result.formData)
this.processData.orderMaterial = itemData.orderMaterial
this.processData.orderMaterialList = itemData.orderMaterialList[0]
this.processData.orderMaterialList01 = itemData.orderMaterialList[1]
this.processData.orderMaterialList02 = itemData.orderMaterialList[2]
// console.log(this.processData)
} else {
this.$Message.error('加载失败')
}
})
},
methods: {
load(v) {},
l(key) {
key = 'materialInfo' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<style lang="less">
.detail {
display: table;
border-collapse: collapse;
.ivu-row {
display: table-row;
.filed-col {
display: table-cell;
border: 1px solid #ddd;
margin: 0 0 -1px -1px;
line-height: 30px;
box-sizing: border-box;
.label {
background: #e8eaf1;
display: inline-block;
width: 120px;
text-align: right;
padding: 0 5px;
}
}
}
}
</style>
<template>
<div style="padding:40px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj"/>
<div class="footers" v-if="footerStatu === '2'">
<Form :model="formMyCheck" :label-width="100">
<Row>
<Col span="18">
<FormItem label="审批意见:" style="width:100%;text-align:left;">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<!-- <Radio label="终止"></Radio> -->
</RadioGroup>
<Select
v-if="formMyCheck.radioSp === '驳回'"
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup
v-if="formMyCheck.radioSp === '驳回'"
type="button"
size="small"
@on-change="changeToNode"
>
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
<Input
v-if="formMyCheck.radioSp === '驳回'"
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请填写原因"/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">确定</Button>
</Col>
</Row>
</Form>
</div>
<Modal
v-model="modalCheckNo"
title="材料消耗单审批"
width="800"
:scrollable="true"
>
<br />
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此材料消耗单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId:0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj:{}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
let rejectToNode = this.formMyCheck.rejectToNodeId
let commasge = this.formMyCheck.comment
if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
} else if (this.formMyCheck.radioSp == '驳回') {
if(rejectToNode == null){
this.$Message.error('请选择驳回节点')
return
}
if(commasge == ''){
this.$Message.error('请填写驳回原因')
return
}
this.modalCheckNo = true
this.statuTitle = '驳回'
}
// else {
// if(commasge==''){
// this.$Message.error('请填写终止原因')
// return
// }
// this.modalCheckNo = true
// this.statuTitle = '终止'
// }
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
this.testObj=r
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId=r.result.currentRecordId
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
let param = {
id: this.passId,
comment: '',
nextOperationIdList: [],
data: {}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckOk = false
},
//审批驳回
checkNo() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
checkCancel() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
// if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
// }
// else if (this.formMyCheck.radioSp == '终止') {
// this.checkCancel()
// }
this.footerStatu=3
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<template>
<div class="detail"style="width:90%;margin:0 auto" >
<Row>
<Filed :span="120" :name="'工艺更改单'">{{results.changeorder_code}}</Filed>
<Filed :span="120" :name="'提出人'">{{results.propose_user_name}}</Filed>
<Filed :span="120" :name="'申请部门'">{{results.department_name}}</Filed>
<Filed :span="120" :name="'技术文件名称'">{{results.technical_name}}</Filed>
</Row>
<Row>
<Filed :span="120" :name="'数量'">{{results.quantity}}</Filed>
<Filed :span="120" :name="'发行日期'">{{results.print_data}}</Filed>
<Filed :span="120" :name="'更改原因'">{{results.change_reason}}</Filed>
<Filed :span="120" :name="'技术文件编号'">{{results.technical_code}}</Filed>
</Row>
<Row>
<Filed :span="120" :name="'有效日期'">{{results.effective_date}}</Filed>
<Filed :span="120" :name="'执行部门'">{{results.executive_branch}}</Filed>
<Filed :span="120" :name="'更改后版本号'"><state code="Process.Routing.version" :value="results.changed_version+''" type="text"></state></Filed>
<Filed :span="120" :name="'在制品意见'"><state code="Process.Routing.opinion" :value="results.handling_opinions+''" type="text"></state></Filed>
</Row>
<!-- <Row>
<Filed :span="120" :name="'变更前描述'">{{info.changeInfo.before_change_content}}</Filed>
<Filed :span="120 " :name="'变更后描述'">{{info.changeInfo.after_change_content}}</Filed>
</Row> -->
</div>
</template>
<script>
import Api from '../api'
export default {
name: 'detail',
components: {},
props: {
idVal: {
type: String,
default: ''
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
results: {
state: ''
}
}
},
created() {
this.dataImmut = []
this.dataMut = []
Api.get({ Id: this.idVal }).then((r) => {
if (r.success) {
this.results = JSON.parse(r.result.formData)
// let formStr = r.result.formData.replace(/\"/g, '"')
// this.results = JSON.parse(formStr)[0]
} else {
this.$Message.error('加载失败')
}
})
},
methods: {
load(v) {},
l(key) {
key = 'waitOpened' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<style lang="less" scoped>
.pdf-detail {
margin: 0 20px 20px 20px;
.pdf-out {
text-align: right;
}
.pdf-img {
text-align: center;
}
.pdf-title {
text-align: center;
font-size: 20px;
font-weight: bold;
line-height: 34px;
color: rgba(0, 0, 0, 1);
}
.bian-hao {
text-align: right;
margin-bottom: 5px;
padding-right: 5px;
font-weight: bold;
line-height: 24px;
color: rgba(0, 0, 0, 1);
}
.body-d {
.row-border {
border-top: 1px solid #333;
.col-border {
border-left: 1px solid #333;
height: 35px;
line-height: 35px;
padding-left: 10px;
}
.content {
text-align: center;
font-weight: bold;
}
}
.right-border {
border-right: 1px solid #333;
}
.bottom-border {
border-bottom: 1px solid #333;
}
}
}
</style>
<style lang="less">
.detail {
display: table;
border-collapse: collapse;
.ivu-row {
display: table-row;
.filed-col {
display: table-cell;
border: 1px solid #ddd;
margin: 0 0 -1px -1px;
line-height: 30px;
box-sizing:border-box;
.label {
background: #E8EAF1;
display: inline-block;
width: 120px;
text-align: right;
padding: 0 5px;
}
}
}
}
</style>
<template>
<div style="padding:40px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form
:model="formMyCheck"
:label-width="100"
:rules="ruleValidate"
inline
ref="formValidate"
>
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem
label="驳回节点:"
v-if="formMyCheck.radioSp === '驳回'"
prop="rejectToNodeId"
>
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<!-- 订单审里通过form -->
<!-- <Modal v-model="modalCheckOk" title="订单审里" width="800" :scrollable="true">
<Form :model="formMyCheck" :label-width="100">
<Row>
<Col span="12">
<FormItem label="工时:" style="width:100%">
<InputNumber v-model="formMyCheck.workHours" :step="1" :min="2" style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="打印周期:" style="width:100%">
<InputNumber
v-model="formMyCheck.printPeriod"
:step="1"
:min="2"
style="width:240px"
/>
</FormItem>
</Col>
</Row>
<Row>
<Col span="12">
<FormItem label="设备:" style="width:100%">
<Input v-model="formMyCheck.equipment" style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="材料重量:" style="width:100%">
<Input v-model="formMyCheck.materialWeight" style="width:240px" />
</FormItem>
</Col>
</Row>
</Form>
<div slot="footer">
<Button @click="modalCheckOk = false">取消</Button>
<Button type="primary" @click="checkOk">确定</Button>
</div>
</Modal>-->
<Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
console.log(this.detailId)
console.log(this.footerStatu)
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.modalCheckNo = true
this.statuTitle = '通过'
} else if (this.formMyCheck.radioSp == '驳回') {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
}
})
} else {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '终止'
} else {
}
})
}
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
this.testObj = r
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId=r.result.currentRecordId
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,//this.nextNodeUserIdList
data: {}
}
console.log(param)
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu=3
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu=3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
checkCancel() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
//alert(JSON.stringify(param))
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.footerStatu=3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
} else if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
}
this.footerStatu = 3
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<template>
<div class="detail" style="width:90%;margin:0 auto">
<Row>
<Filed :span="8" :name="l('unqualifiedCode')">{{entity.unqualified_order_code}}</Filed>
<Filed :span="8" :name="l('department')">{{entity.department_name}}</Filed>
<Filed :span="8" :name="l('customer')">{{entity.customer_name}}</Filed>
<Filed :span="8" :name="l('outsourcing')">{{entity.outsourcing_name}}</Filed>
<Filed :span="8" :name="l('product')">{{entity.product_name}}</Filed>
<Filed :span="8" :name="l('material')">{{entity.material}}</Filed>
<Filed :span="8" :name="l('quantity')">{{entity.quantity}}</Filed>
<Filed :span="8" :name="l('code')">{{entity.code}}</Filed>
<Filed :span="8" :name="l('problemDesc')">{{entity.problem_desc}}</Filed>
<Filed :span="8" :name="l('inspectionPerson')">{{entity.inspection_person_name}}</Filed>
<Filed :span="8" :name="l('inspectionDate')">{{entity.inspection_date}}</Filed>
</Row>
</div>
</template>
<script>
import Api from '../api'
export default {
name: 'detail',
components: {
},
props: {
idVal: {
type: String,
default: ''
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
entity: {
state:'',
},
}
},
created() {
this.dataImmut = []
this.dataMut = []
Api.get({ Id: this.idVal }).then((r) => {
if (r.success) {
let formStr = r.result.formData.replace(/\"/g, '"')
let formStr01 = JSON.parse(formStr)
// console.log(formStr01)
// this.entity = JSON.parse(formStr)[0]
this.entity = formStr01
} else {
this.$Message.error('加载失败')
}
})
},
methods: {
load(v) {},
l(key) {
key = 'Unqualified' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<style lang="less">
.detail {
display: table;
border-collapse: collapse;
.ivu-row {
display: table-row;
.filed-col {
display: table-cell;
border: 1px solid #ddd;
margin: 0 0 -1px -1px;
line-height: 30px;
box-sizing: border-box;
.label {
background: #e8eaf1;
display: inline-block;
width: 120px;
text-align: right;
padding: 0 5px;
}
}
}
}
</style>
<template>
<div style="padding:40px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" @node-click="show"/>
<div class="footers" v-if="footerStatu === '2'">
<Form :model="formMyCheck" :label-width="150">
<Row>
<Col span="18">
<FormItem label="审批意见:" style="width:100%;text-align:left;">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<!-- <Radio label="终止"></Radio> -->
</RadioGroup>
<Select
v-if="formMyCheck.radioSp === '驳回'"
style="width:200px" clearable ransfer
placeholder="请选择驳回节点" class="selectBox"
v-model="formMyCheck.rejectToNodeId">
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup
v-if="formMyCheck.radioSp === '驳回'"
type="button"
size="small"
@on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
<Input
v-if="formMyCheck.radioSp === '驳回' ||
formMyCheck.radioSp === '终止'"
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请如如驳回原因"/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<!-- 不合格品通过form -->
<Modal
v-model="modalCheckOk"
title="不合格品审理"
width="800" :mask-closable="false"
:scrollable="true">
<div v-if="showSize==2">
<Form :model="formMyCheck" ref="formMyCheck" :rules="ruleValidate" :label-width="150">
<Row>
<Col span="24">
<FormItem label="问题产生原因分析:" prop="causeAnalysis" style="width:100%">
<Input type="textarea" :autosize="{minRows: 1,maxRows: 5}" v-model="formMyCheck.causeAnalysis"
:disabled="disabledFlag" style="width: 600px"/>
</FormItem>
</Col>
<Col span="24">
<FormItem label="审理结论:" prop="conclusion" style="width:100%">
<CheckboxGroup v-model="formMyCheck.conclusion">
<Checkbox label="返工" value='1' :disabled="disabledFlag"></Checkbox>
<Checkbox label="返修" value='2' :disabled="disabledFlag"></Checkbox>
<Checkbox label="降级使用" value='3' :disabled="disabledFlag"></Checkbox>
<Checkbox label="让步" value='4' :disabled="disabledFlag"></Checkbox>
<Checkbox label="报废" value='5' :disabled="disabledFlag"></Checkbox>
<Checkbox label="通知顾客" value='6' :disabled="disabledFlag"></Checkbox>
</CheckboxGroup>
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="纠正措施:" prop="measures" style="width:100%">
<Input type="textarea" :autosize="{minRows: 1,maxRows: 5}" v-model="formMyCheck.measures"
:disabled="disabledFlag" style="width: 600px"/>
</FormItem>
</Col>
<Col span="24">
<FormItem label="审理级别:" prop="triaLevel" style="width:100%">
<CheckboxGroup v-model="formMyCheck.triaLevel">
<Checkbox label="一级审理" value='1' :disabled="disabledFlag"></Checkbox>
<Checkbox label="二级审理" value='2' :disabled="disabledFlag"></Checkbox>
<Checkbox label="三级审理" value='3' :disabled="disabledFlag"></Checkbox>
</CheckboxGroup>
</FormItem>
</Col>
</Row>
</Form>
</div>
<div v-if="showSize==4">
<Form :model="formResultText" ref="formResultText" :rules="ruleValidate" :label-width="150">
<Row>
<Col span="24">
<FormItem label="落实情况验证结果:" prop="resultText" style="width:100%">
<Input type="textarea" :autosize="{minRows:3,maxRows: 7}" v-model="formResultText.resultText"
:disabled="disabledFlag" style="width: 600px"/>
</FormItem>
</Col>
</Row>
</Form>
</div>
<div slot="footer">
<Button @click="cancelFn">取消</Button>
<Button type="primary" @click="checkOk()" v-show="footerStatue">确定</Button>
</div>
</Modal>
<Modal
v-model="ResultModal"
title="测试步骤"
width="800" :scrollable="true">
<div>
{{'第'+this.showSize+'布'}}
{{'id'+this.typeId}}
</div>
<div slot="footer">
<Button @click="cancelFn02">取消</Button>
<Button type="primary" @click="checkOk6">确定</Button>
</div>
</Modal>
<Modal
v-model="modalCheckNo"
title="不合格品审批"
width="800" :scrollable="true">
<br/>
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此不合格品审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId:0,
formMyCheck: {
radioSp: '通过',
comment: '',
causeAnalysis: '', //问题产生原因分析
conclusion: [], //审理结论
measures: '', //纠正措施
triaLevel: [], //审理级别
rejectToNodeId: null
},
formResultText:{resultText: ''},//落实情况
ResultModal: false,//落实情况
footerStatue: true,//详情隐藏确定
disabledFlag: false,//是否可用
stepeFlag: null,//审核flag
showSize:1,// 弹框默认展示内容
ruleValidate: {
causeAnalysis: [{ required: true, message: '请填写原因分析', trigger: 'blur' }],
conclusion: [
{ required: true, type: 'array', min: 1, message: '至少选择一个审理结论', trigger: 'change' },
// { type: 'array', max: 2, message: '最多选两个审理结论', trigger: 'change' }
],
measures: [{ required: true, message: '请填写纠正措施', trigger: 'blur' }],
resultText: [{ required: true, message: '请填写落实情况', trigger: 'blur' }],
triaLevel: [{ required: true, type: 'array', min: 1, message: '至少选择一个审理级别', trigger: 'change' }],
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
typeId: null,//审批节点
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj:{}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
let rejectToNode = this.formMyCheck.rejectToNodeId
let commasge = this.formMyCheck.comment
if (this.formMyCheck.radioSp == '通过') {
if( this.typeId==2){
this.modalCheckNo = true
this.statuTitle = '通过'
}
else{
this.footerStatue = true
this.modalCheckOk = true
}
} else if (this.formMyCheck.radioSp == '驳回') {
if(rejectToNode == null){
this.$Message.error('请选择驳回节点')
return
}
if(commasge == ''){
this.$Message.error('请填写驳回原因')
return
}
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
this.$Message.error('请选择审批意见')
// if(commasge==''){
// this.$Message.error('请填写终止原因')
// return
// }
// this.modalCheckNo = true
// this.statuTitle = '终止'
}
},
show(a){
this.disabledFlag = true
let contextDate = JSON.parse(a.contextData)
console.log(a)
if(contextDate.measures){
this.showSize = 2
this.stepeFlag = 2//第二步
this.formMyCheck = contextDate
}else if(contextDate.resultText){
this.showSize = 4
this.stepeFlag = 4
this.formResultText = contextDate
}
// else{
// alert('第三步')
// }
this.modalCheckOk = true
this.footerStatue = false
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId = r.result.currentRecordId
this.typeId = r.result.currentIndexId
this.showSize = this.typeId + 1
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
cancelFn(){
this.modalCheckOk = false
this.formMyCheck.radioSp = '通过'
this.disabledFlag = false
if(this.stepeFlag = 2){
this.showSize = 4
}
},
cancelFn02(){
this.ResultModal = false
},
checkOk6(){
this.ResultModal = false
},
//审批通过
checkOk() {
if(this.typeId==1){
this.$refs['formMyCheck'].validate((valid) => {
// console.log(valid)
if (valid) {
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
causeAnalysis: this.formMyCheck.causeAnalysis,
conclusion: this.formMyCheck.conclusion,
measures: this.formMyCheck.measures,
triaLevel: this.formMyCheck.triaLevel
}
}
Api.pass(param).then((r) => {
// console.log(param)
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu=3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckOk = false
} else {
console.log("审核不通过")
}
})
}else if(this.typeId==3){
this.$refs['formResultText'].validate((valid) => {
if (valid){
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
resultText: this.formResultText.resultText
}
}
Api.pass(param).then((r) => {
// console.log(param)
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu=3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckOk = false
}
})
}
},
//审批驳回
checkNo() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
checkCancel() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
// 通过
passFn(){
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu=3
} else {
this.$Message.error('审批通过失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
}else if(this.formMyCheck.radioSp == '通过'){
this.passFn()
}
else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
this.footerStatu=3
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<template>
<div class="detail" style="width:90%;margin:0 auto" >
<Row>
<Filed :span="120" :name="'生产协调单'">{{results.technical_coordination_code}}</Filed>
<Filed :span="120" :name="'任务号'">{{results.taskCode}}</Filed>
<Filed :span="120" :name="'数量'">{{results.quantity}}</Filed>
<Filed :span="120" :name="'阶段'">{{results.phase}}</Filed>
</Row>
<Row>
<Filed :span="120" :name="'产品名称'">{{results.product_name}}</Filed>
<Filed :span="120" :name="'产品标识'">{{results.product_mark}}</Filed>
<Filed :span="120" :name="'协调内容'">{{results.coordinate_content}}</Filed>
<Filed :span="120" :name="'图号'">{{results.drawing}}</Filed>
<!-- <Filed :span="120" :name="'协调结果'">{{results.coordinate_results}}</Filed>
<Filed :span="120" :name="'在制品意见'">{{results.handling_suggestion}}</Filed> -->
</Row>
<Row>
<!-- <Filed :span="120" :name="'更改设计文件'">{{results.change_design_file}}</Filed>
<Filed :span="120" :name="'更改工艺文件'">{{results.change_process_file}}</Filed>
<Filed :span="120" :name="'编写临时工艺'">{{results.compilation_temporary_process}}</Filed> -->
<Filed :span="120" :name="'检验员'">{{results.inspection_person_name}}</Filed>
<Filed :span="120" :name="'检验时间'">{{results.inspection_date}}</Filed>
</Row>
<!-- <Row>
<Filed :span="120" :name="'变更前描述'">{{info.changeInfo.before_change_content}}</Filed>
<Filed :span="120 " :name="'变更后描述'">{{info.changeInfo.after_change_content}}</Filed>
</Row> -->
</div>
</template>
<script>
import Api from '../api'
export default {
name: 'detail',
components: {},
props: {
idVal: {
type: String,
default: ''
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
results: {
state: ''
}
}
},
created() {
this.dataImmut = []
this.dataMut = []
Api.get({ Id: this.idVal }).then((r) => {
if (r.success) {
this.results = JSON.parse(r.result.formData)
// let formStr = r.result.formData.replace(/\"/g, '"')
// this.results = JSON.parse(formStr)[0]
} else {
this.$Message.error('加载失败')
}
})
},
methods: {
load(v) {},
l(key) {
key = 'waitOpened' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<style lang="less" scoped>
.pdf-detail {
margin: 0 20px 20px 20px;
.pdf-out {
text-align: right;
}
.pdf-img {
text-align: center;
}
.pdf-title {
text-align: center;
font-size: 20px;
font-weight: bold;
line-height: 34px;
color: rgba(0, 0, 0, 1);
}
.bian-hao {
text-align: right;
margin-bottom: 5px;
padding-right: 5px;
font-weight: bold;
line-height: 24px;
color: rgba(0, 0, 0, 1);
}
.body-d {
.row-border {
border-top: 1px solid #333;
.col-border {
border-left: 1px solid #333;
height: 35px;
line-height: 35px;
padding-left: 10px;
}
.content {
text-align: center;
font-weight: bold;
}
}
.right-border {
border-right: 1px solid #333;
}
.bottom-border {
border-bottom: 1px solid #333;
}
}
}
</style>
<style lang="less">
.detail {
display: table;
border-collapse: collapse;
.ivu-row {
display: table-row;
.filed-col {
display: table-cell;
border: 1px solid #ddd;
margin: 0 0 -1px -1px;
line-height: 30px;
box-sizing:border-box;
.label {
background: #E8EAF1;
display: inline-block;
width: 120px;
text-align: right;
padding: 0 5px;
}
}
}
}
</style>
<template>
<div style="padding:40px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" @node-click="show"/>
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form
:model="formMyCheck"
:label-width="100"
:rules="ruleValidate"
inline
ref="formValidate"
>
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem
label="驳回节点:"
v-if="formMyCheck.radioSp === '驳回'"
prop="rejectToNodeId"
>
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<!-- 订单审里通过form -->
<Modal v-model="modalCheckOk" title="协调单审理" width="800" :scrollable="true">
<Form :model="formMyCheck" :label-width="100">
<Row>
<Col span="12">
<FormItem label="闭环情况" style="width:100%">
<Input v-model="formMyCheck.close_situation" style="width:500px" />
</FormItem>
</Col>
</Row>
</Form>
<div slot="footer" v-show="footerStatue === true">
<Button @click="modalCheckOk = false">取消</Button>
<Button type="primary" @click="checkOk">确定</Button>
</div>
</Modal>
<!-- 订单审里通过form -->
<Modal v-model="modalCheckOk1" title="协调单审理" width="800" :scrollable="true">
<Form :model="formMyCheck" :label-width="100">
<Row>
<FormItem label="协调结果">
<textarea v-model="formMyCheck.coordinate_results" style="width: 600px"></textarea>
</FormItem>
</Row>
<Row>
<FormItem label="在制品处理意见">
<textarea v-model="formMyCheck.handling_suggestion" style="width: 600px"></textarea>
</FormItem>
</Row>
<Row>
<FormItem label="是否更改设计文件">
<Select v-model="formMyCheck.change_design_file" placeholder="请选择" style="width:225px;">
<Option value="是"></Option>
<Option value="否"></Option>
</Select>
</FormItem>
</Row>
<Row>
<FormItem label="是否更改工艺文件">
<Select v-model="formMyCheck.change_process_file" placeholder="请选择" style="width:225px;">
<Option value="是"></Option>
<Option value="否"></Option>
</Select>
</FormItem>
</Row>
<Row>
<FormItem label="是否编写临时工艺">
<Select
v-model="formMyCheck.compilation_temporary_process"
placeholder="请选择"
style="width:225px;"
>
<Option value="是"></Option>
<Option value="否"></Option>
</Select>
</FormItem>
</Row>
</Form>
<div slot="footer" v-show="footerStatue === true">
<Button @click="modalCheckOk1 = false">取消</Button>
<Button type="primary" @click="checkOk">确定</Button>
</div>
</Modal>
<Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
coordinate_results:'',
handling_suggestion:'',
change_design_file:'',
change_process_file:'',
close_situation:'',
compilation_temporary_process:'',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: '', //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckOk1:false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
footerStatue:true,
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
console.log(this.footerStatu)
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
console.log(this.currentNodeID)
if (this.formMyCheck.radioSp == '通过') {
if(this.currentNodeID==165)
{
this.footerStatue=true
this.modalCheckOk = true
}
else if(this.currentNodeID==163)
{
this.footerStatue=true
this.modalCheckOk1 = true
}
else{
this.modalCheckNo = true
this.statuTitle = '通过'
}
} else if (this.formMyCheck.radioSp == '驳回') {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
}
})
} else {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '终止'
} else {
}
})
}
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
this.testObj = r
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId=r.result.currentRecordId
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
// alert(this.passId)
var param = {
// id: this.passId,
// comment: '',
// nextOperationIdList: this.nextNodeUserIdList,
// data: {}
}
if(this.currentNodeID==165)
{
if (!this.formMyCheck.close_situation) {
this.$Message.error('请填写闭环情况')
return
}
param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
close_situation: this.formMyCheck.close_situation
}
}
}
else if(this.currentNodeID==163)
{
if (!this.formMyCheck.coordinate_results) {
this.$Message.error('请填写协调结果')
return
}
if (!this.formMyCheck.handling_suggestion) {
this.$Message.error('请填写在制品处理意见')
return
}
if (!this.formMyCheck.change_design_file) {
this.$Message.error('请选择是否更改设计文件')
return
}
if (!this.formMyCheck.change_process_file) {
this.$Message.error('请选择是否更改工艺文件')
return
}
if (!this.formMyCheck.compilation_temporary_process) {
this.$Message.error('请选择是否编写临时工艺')
return
}
param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
coordinate_results: this.formMyCheck.coordinate_results,
handling_suggestion: this.formMyCheck.handling_suggestion,
change_design_file: this.formMyCheck.change_design_file,
change_process_file: this.formMyCheck.change_process_file,
compilation_temporary_process: this.formMyCheck.compilation_temporary_process
}
}
}
else{
param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
}
console.log(param)
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu=3
this.modalCheckNo = false
this.modalCheckOk = false
this.modalCheckOk1 = false
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu=3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
checkCancel() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
//alert(JSON.stringify(param))
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.footerStatu=3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
} else if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
}
this.footerStatu = 3
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
},
show(a){
console.log(a)
this.footerStatue = false
let contextDate = JSON.parse(a.contextData)
this.formMyCheck = contextDate
if(a.nodeId==163)
{
this.modalCheckOk1 = true
}
else if(a.nodeId==165)
{
this.modalCheckOk = true
}
},
},
watch: {}
}
</script>
<template>
<div class="pdf-detail" style="width:85%;margin:0 auto">
<div class="cerioficate-pdf-detail">
<div class="bian-hao">产品合格证编号:{{results.serialNumber}}</div>
<div class="body-d">
<Row class="row-border right-border">
<Col :span="4" class="col-border">用户单位</Col>
<Col :span="20" class="col-border">{{results.userUnit}}</Col>
</Row>
<Row class="row-border right-border">
<Col :span="4" class="col-border">任务依据</Col>
<Col :span="20" class="col-border">{{results.taskBased}}</Col>
</Row>
<Row class="row-border right-border">
<Col :span="4" class="col-border">产品名称</Col>
<Col :span="8" class="col-border">{{results.productName}}</Col>
<Col :span="4" class="col-border">产品状态</Col>
<Col :span="8" class="col-border">{{results.productStatus}}</Col>
</Row>
<Row class="row-border right-border">
<Col :span="4" class="col-border">产品编号</Col>
<Col :span="8" class="col-border">{{results.productSerialNumber}}</Col>
<Col :span="4" class="col-border">原材料批号</Col>
<Col :span="8" class="col-border">{{results.materialSerialNumber}}</Col>
</Row>
<Row class="row-border right-border">
<Col :span="4" class="col-border">原材料编号</Col>
<Col :span="8" class="col-border">{{results.materialCode}}</Col>
<Col :span="4" class="col-border">产品代号(图号)</Col>
<Col :span="8" class="col-border">{{results.productCode}}</Col>
</Row>
<Row class="row-border right-border">
<Col :span="4" class="col-border">原材料合格证编号</Col>
<Col :span="8" class="col-border">{{results.materialCertificationNumber}}</Col>
<Col :span="4" class="col-border">数量</Col>
<Col :span="8" class="col-border">{{results.productQuantity}}</Col>
</Row>
<Row class="row-border right-border">
<Col :span="4" class="col-border">增材制造批次号</Col>
<Col :span="20" class="col-border">{{results.addMaterialBatch}}</Col>
</Row>
<Row class="row-border right-border">
<Col :span="24" class="col-border content">检验内容</Col>
</Row>
<Row class="row-border right-border">
<Col :span="1" class="col-border">序号</Col>
<Col :span="5" class="col-border">检验项目</Col>
<Col :span="5" class="col-border">要求</Col>
<Col :span="3" class="col-border">测试结果</Col>
<Col :span="5" class="col-border">结论</Col>
<Col :span="5" class="col-border">备注</Col>
</Row>
<Row class="row-border right-border" v-for="(item,index) in results.items" :key="index">
<Col :span="1" class="col-border">{{index+1}}</Col>
<Col :span="5" class="col-border">{{item.name}}</Col>
<Col :span="5" class="col-border">{{item.require}}</Col>
<Col :span="3" class="col-border">{{item.result}}</Col>
<Col :span="5" class="col-border">{{item.conclusion}}</Col>
<Col :span="5" class="col-border">{{item.remark}}</Col>
</Row>
<Row class="row-border right-border">
<Col :span="4" class="col-border">结论</Col>
<Col :span="20" class="col-border">{{results.conclusion}}</Col>
</Row>
<Row class="row-border right-border bottom-border">
<Col :span="4" class="col-border">检验员 / 时间</Col>
<Col :span="8" class="col-border">{{results.examUser}} {{results.examDate}}</Col>
<Col :span="4" class="col-border">批准人 / 时间</Col>
<Col :span="8" class="col-border">{{results.approveUser}} {{results.approveDate}}</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
import Api from '../api'
export default {
name: 'detail',
components: {},
props: {
idVal: {
type: String,
default: ''
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
results: {
state: ''
}
}
},
created() {
this.dataImmut = []
this.dataMut = []
Api.get({ Id: this.idVal }).then((r) => {
if (r.success) {
this.results = JSON.parse(r.result.formData)
// let formStr = r.result.formData.replace(/\"/g, '"')
// this.results = JSON.parse(formStr)[0]
} else {
this.$Message.error('加载失败')
}
})
},
methods: {
load(v) {},
l(key) {
key = 'waitOpened' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<style lang="less" scoped>
.pdf-detail {
margin: 0 20px 20px 20px;
.pdf-out {
text-align: right;
}
.pdf-img {
text-align: center;
}
.pdf-title {
text-align: center;
font-size: 20px;
font-weight: bold;
line-height: 34px;
color: rgba(0, 0, 0, 1);
}
.bian-hao {
text-align: right;
margin-bottom: 5px;
padding-right: 5px;
font-weight: bold;
line-height: 24px;
color: rgba(0, 0, 0, 1);
}
.body-d {
.row-border {
border-top: 1px solid #333;
.col-border {
border-left: 1px solid #333;
height: 35px;
line-height: 35px;
padding-left: 10px;
}
.content {
text-align: center;
font-weight: bold;
}
}
.right-border {
border-right: 1px solid #333;
}
.bottom-border {
border-bottom: 1px solid #333;
}
}
}
</style>
<template>
<div style="padding:40px 0">
<Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" />
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal v-model="modalCheckNo" title="合格证审批" width="800" :scrollable="true">
<br />
<h4>
您确定
<span class="new-red">{{ statuTitle }}</span> 此合格证审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
Process
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.modalCheckNo = true
} else if (this.formMyCheck.radioSp == '驳回') {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
}
})
} else {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '终止'
} else {
}
})
}
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
this.testObj = r
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId=r.result.currentRecordId
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
// alert(this.passId)
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {}
}
// alert(JSON.stringify(param))
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.modalCheckNo = false
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckNo = false
},
//审批驳回
checkNo() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
// alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
checkCancel() {
// alert(this.passId)
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
//alert(JSON.stringify(param))
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
} else if (this.formMyCheck.radioSp == '通过') {
this.checkOk()
}
this.footerStatu = 3
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
}
</script>
<template>
<div style="width:100%;">
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form
:model="formMyCheck"
:label-width="100"
:rules="ruleValidate"
inline
ref="formValidate"
>
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem
label="驳回节点:"
v-if="formMyCheck.radioSp === '驳回'"
prop="rejectToNodeId"
>
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<Modal v-model="modalCheckNo" title="审批" width="800" :scrollable="true">
<br />
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'footer',
props: {
footerStatu: {
type: String,
default: ''
},
idVal: {
type: String,
default: ''
}
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
rejectToNodeId: null
},
statuTitle: '',
modalCheckOk: false,
modalCheckNo: false,
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
created() {
this.getDetailInfos(this.idVal)
this.currentUserId=this.$store.state.userInfo.userId
},
methods: {
nextCheckOk() {
this.$emit('showModalCheckOk')
// if (this.formMyCheck.radioSp == '通过') {
// this.$emit('showModalCheckOk')
// } else if (this.formMyCheck.radioSp == '驳回') {
// this.$refs['formValidate'].validate((valid) => {
// if (valid) {
// this.modalCheckNo = true
// this.statuTitle = '驳回'
// } else {
// }
// })
// } else {
// this.$refs['formValidate'].validate((valid) => {
// if (valid) {
// this.modalCheckNo = true
// this.statuTitle = '终止'
// } else {
// }
// })
// }
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
this.testObj = r
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//根据当前登录用户返回records的id
getRecordsId(records) {
records.forEach((data) => {
if (data.operatorId == this.currentUserId) {
this.passId = data.id
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
//根据当前nodeid找到下一节点的defaultUser
this.nextNodeUserIdList = []
if (index + 1 < nodes.length) {
this.nextNodeUserIdList = nodes[index + 1].defaultUsers.immutable
}
//返回当前节点的records,用于查找在records里当前登录用户的对应的id
this.getDetailRecords = nodes[index].records
this.getRecordsId(this.getDetailRecords)
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: {
workHours: this.formMyCheck.workHours,
printPeriod: this.formMyCheck.printPeriod,
equipment: this.formMyCheck.equipment,
materialWeight: this.formMyCheck.materialWeight
}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckOk = false
},
//审批驳回
checkNo() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
alert(JSON.stringify(param))
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
checkCancel() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
alert(JSON.stringify(param))
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
this.footerStatu = 3
},
},
watch: {}
}
</script>
<template>
<div class="myBug">
<Tabs :animated="false" @on-click="tab" value="3">
<TabPane label="我发起的" name="0"></TabPane>
<TabPane label="待我审批的" name="1"></TabPane>
<TabPane label="我已审批的" name="2"></TabPane>
<TabPane label="待办任务" name="3">
<Task v-if='tabIndex==4'></Task>
</TabPane>
</Tabs>
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
:high="false"
v-show="tabIndex != 4"
:height="gridHeight"
>
<template slot="easySearch">
<Row style="line-height:32px;width:1000px;">
<Col span="5">
<Select
v-model="easySearch.schemaId.value"
style="width:200px"
clearable
placeholder="请选择审批类别"
transfer
>
<Option value class="option-text">请选择审批类别</Option>
<Option
:value="item.id"
:label="item.name"
:key="index"
v-for="(item, index) in schemaList"
></Option>
</Select>
</Col>
<Col span="10">
<DTSearch
v-model="easySearch.range.value"
@on-change="setTime"
type="date"
></DTSearch>
</Col>
<Col span="9">
<Input
search
enter-button
placeholder="请输入编号"
@on-search="search"
v-model="easySearch.keys.value"
/>
</Col>
</Row>
</template>
</DataGrid>
<!-- 审批modal -->
<Modal
v-model="modalOrderExamine"
:title="titleOrderExamine"
footer-hide
fullscreen
@on-cancel="cancelModal"
>
<iframe
width="100%"
id="mainFrame"
:height="iframeHeight"
frameborder="0"
:src="srcUrl"
></iframe>
</Modal>
</div>
</template>
<script>
import Api from './api'
import Task from './task'
export default {
name: 'handle',
components: {
Task
},
data() {
return {
show: false,
action: Api.index,
easySearch: {
type: { op: 'Equal', value: 1 }, // 1我发起的 2待我审批的 3 我已审批的
keys: { op: 'code', value: '' },
schemaId: { op: 'Equal', value: null }, //审批类别
range: { op: 'Range', value: null }
},
schemaList: [],
results: [],
footerBar: false,
modalInfo: false,
tabIndex: 4,
columns: [
{
key: 'id',
width: 80,
title: this.l('id'),
hide: true
},
{
key: 'code',
width: 240,
title: this.l('code')
},
{
title: this.l('schemaId'),
key: 'schemaId',
hide: true
},
{
title: this.l('schemaName'),
key: 'schemaName'
},
// {
// title: this.l('status'),
// key: 'status',
// hide: true
// },
{
title: this.l('startRecordId'),
key: 'startRecordId',
hide: true
},
{
title: this.l('currentNodeId'),
key: 'currentNodeId',
hide: true
},
{
title: this.l('currentNodeName'),
key: 'currentNodeName'
},
{
title: this.l('nextNodeId'),
key: 'nextNodeId',
hide: true
},
{
title: this.l('nextNodeName'),
key: 'nextNodeName'
},
{
title: this.l('status'),
key: 'status',
high: true,
code: 'Handle.todoList.status'
},
{
title: this.l('creatorUserId'),
key: 'creatorUserId',
hide: true
},
{
title: this.l('creator'),
key: 'creator',
align: 'center'
},
{
title: this.l('creationTime'),
key: 'creationTime',
align: 'center'
},
{
title: '操作',
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'op',
{
attrs: {
oprate: 'detail'
},
on: {
click: () => {
this.listInfo(
params.row.schemaId,
params.row.schemaName,
params.row.code,
params.row.id
)
}
}
},
this.tabIndex == 2 ? '审核' : '查看'
)
])
}
}
],
codeTypeName: '', //审核类型
gridHeight: '',
//订单审核开始
modalOrderExamine: false,
srcUrl: '',
iframeHeight: '',
titleOrderExamine: '',
OrderExamine: ''
//订单审核结束
}
},
created() {
window.screenHeight = window.innerHeight
this.iframeHeight = window.screenHeight - 58
this.gridHeight = window.screenHeight - 260
},
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight
this.iframeHeight = window.screenHeight - 58
this.gridHeight = window.screenHeight - 260
})()
}
this.getSchema()
},
computed: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
setTime(v) {
this.easySearch.range.value = v
},
//选项卡切换
tab(data) {
this.tabIndex = Number(data) + 1
this.easySearch.type.value = this.tabIndex
this.search()
// if (data == 3) {
// this.show = true
// } else {
// this.show = false
// }
},
search() {
this.$refs.grid.easySearch(this.easySearch)
},
//获取所以审核类型
getSchema() {
Api.getAll().then((r) => {
if (r.success) {
this.schemaList = r.result
} else {
this.$Message.error('加载类型失败')
}
})
},
//点击审核或查看
listInfo(schemaId, schemaName, code, id) {
console.log(code)
let type = this.returnType(schemaId)
this.srcUrl = ''
this.modalOrderExamine = true
this.codeTypeName = schemaName
this.titleOrderExamine = this.codeTypeName + ' 编号:' + code
document.getElementById('mainFrame').contentWindow.location.reload(true)
this.srcUrl =
'/handle/examine' + type + '?id=' + id + '&statu=' + this.tabIndex
},
//将schameId转为type1、2、3....
returnType(schemaId) {
let types = 1
switch (schemaId) {
case '123327da-42b3-41f6-b785-cf933f137a95': //订单送审
types = 1
break
case 'cf192e27-1e81-4000-98ee-392eeb539616': //订单报价
types = 2
break
case '2085025d-9c38-4834-846a-8f9d2f4c8553': //工艺规程
types = 3
break
case '0c7f3e21-0cf1-4fb0-8986-95c6fbda406e': //材料消耗单
types = 4
break
case '56a0a52c-4d7f-45b1-8e31-860efcee5c6d': //工艺数据
types = 5
break
case 'd0cdafe3-2341-4499-a4f5-278ef0f30740': //工艺更改单
types = 6
break
case 'c2e09c9b-02a9-4188-97a6-cdb68d50a64a': //不合格品审理
types = 7
break
case '2c921502-41a2-4fa5-b659-71d0e1e19ffc': //生产调节单
types = 8
break
case '207b59eb-4fca-4324-b5cd-46f48a5ff21d': //产品合格证
types = 9
break
case '00875796-7675-4c68-bd4f-47e70764dd9e': //修复文件审批
types = 10
break
case '9ce046c3-9585-4bd5-992d-1667f60f8e8f': //支撑文件审批
types = 11
break
case 'bd2cb81a-d955-4b68-ae67-bcf7f92e8cb8': //切片文件审批
types = 12
break
default:
types = 1
break
}
return types
},
cancelModal() {
this.search()
},
l(key) {
let vkey = 'handleList' + '.' + key
return this.$t(vkey) || key
}
}
}
</script>
<style lang="less">
.ivu-modal-fullscreen-no-footer .ivu-modal-body {
padding: 0px;
}
</style>
<template>
<div class="Design" style="width:80%;margin:50px auto;">
<h3>{{ processTitle }}</h3>
<Divider />
<Timeline>
<TimelineItem v-for="(item, index) in dataImmut" :key="index">
<Badge :count="index + 1" slot="dot" :type="type(index)"></Badge>
<p class="title">
<state code="workflow.record.status" :value="item.status" type="tag" />
{{ item.name }} &nbsp;(
<state code="workflow.form.audit.type" :value="item.operation" />)
<Icon v-if="item.isFixed" title="固定" type="ios-lock" />
<span class="auditedTime">{{item.auditedTime}}</span>
</p>
<div class="content">
<div class="records" v-if="index==cur">
<span>审批人:</span>
<User
v-for="(item3, index3) in item.records"
:key="index3"
:value="item3.operatorId"
class="mr5"
/>
</div>
<div v-else-if="index>cur">
<CheckboxGroup v-model="immutData">
<span>审批人:</span>
<Checkbox
v-for="(item1, index1) in item.defaultUsers.immutable"
:key="index1"
:label="item1"
:disabled="item.isFixed"
>
<User :value="item1" style="margin-right:5px;" />
</Checkbox>
</CheckboxGroup>
</div>
<div class="wait" v-else>
<span>审批人:</span>
<User
v-for="(item2, index2) in item.defaultUsers.immutable"
:key="index2"
:value="item2"
class="mr5"
/>
</div>
<div style="width:98%" v-if="com(item.records).length>0">
<Table :columns="columns" border size="small" width="90%" :data="com(item.records)"></Table>
</div>
</div>
</TimelineItem>
</Timeline>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'process',
components: {},
data() {
return {
currentUserId: 0,
processTitle: '审批流程',
currentNodeId: null,
dataImmut: [],
cur: 0,
columns: [
{
key: 'status',
title: '结果',
align: 'left',
width: 100,
render: (h, params) => {
return h('state', {
attrs: {
value: params.row.status,
code: 'workflow.record.status'
}
})
}
},
{
key: 'operatorId',
title: '操作人',
align: 'left',
width: 100,
easy: true,
high: true,
render: (h, params) => {
return h('User', { attrs: { value: params.row.operatorId } })
}
},
{
title: '时间',
key: 'operationTime',
width: 200,
align: 'center'
},
{
title: '备注',
key: 'remark',
align: 'center'
},
{
key: 'contextData',
title: '详细',
width: 100,
align: 'left',
render: (h, params) => {
if (params.row.contextData.length > 2)
return h(
'a',
{ on: { click: () => this.edit(params.row) } },
'详情'
)
return h('span', '')
}
}
],
dataMut: [],
immutData: [],
schemaId: ''
}
},
props: {
idVal: {
type: String,
default: ''
}
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.dataImmut = []
this.dataMut = []
Api.getdetail({ Id: this.idVal }).then((r) => {
if (r.success) {
this.dataImmut = r.result.nodes
this.processTitle = r.result.schemaName
this.currentNodeId = r.result.currentNodeId
r.result.nodes.map((u, i) => {
//查找当前节点索引
if (u.id == this.currentNodeId) {
this.cur = i
};
// if(u.defaultUsers.mutable&&u.defaultUsers.mutable.length>0){
u.defaultUsers.immutable=u.defaultUsers.immutable.concat(u.defaultUsers.mutable)
// }
})
if (this.dataImmut.length > this.cur + 1) {
console.log("this.dataImmut[this.cur + 1]:",this.dataImmut[this.cur + 1],this.cur,this.dataImmut.length )
this.immutData = this.dataImmut[this.cur + 1].defaultUsers.immutable.concat(this.dataImmut[this.cur + 1].defaultUsers.mutable)
}
} else {
this.$Message.error('加载失败')
}
})
},
methods: {
load(v) {},
type(i) {
if (i < this.cur) {
return 'primary'
} else if (i == this.cur) {
return 'info'
} else if (i == this.cur + 1) {
return 'warning'
} else {
return 'normal'
}
},
edit(record) {
// alert(record.id)
this.$emit('node-click', record)
console.log(record)
},
com(items) {
if(items)
return items.filter((u) => {
return [2, 3, 5,6].indexOf(u.status) > -1
})
else
return [];
},
l(key) {
key = 'orderInfo' + '.' + key
return this.$t(key)
}
},
computed: {},
watch: {}
}
</script>
<template>
<div style="width:100%">
<Card
class="waitTask"
@click.native="goPage(item)"
v-for="(item,index) in listTask"
:key="index"
>
<div class="leftIco">
<!-- color:rgba(36, 158, 145, 1) -->
<!-- <span class="iconfont">&#xe607;</span> -->
<div :class="item.name=='物料复验' ? 'img_bg02':(item.name=='产品合格证' ? 'img_bg03':(item.name=='生产执行' ? 'img_bg04' : 'img_bg01'))" >
<!-- <img class="img_icon" :src="imgUrl + item.image" alt /> -->
<img class="img_icon" src="@/assets/imgicon/u1640.png" alt="">
</div>
<!-- <command icon="@/assets/imgicon/u1638.png"> -->
<!-- <Icon type="md-analytics" size="36" color="#249e91" /> -->
</div>
<div style="width:145px;">
<p>{{item.name}}</p>
<p style="color:rgba(36, 158, 145, 1);font-weight:bold">{{item.totalUrl}}</p>
</div>
</Card>
</div>
</template>
<script>
export default {
data() {
return {
listTask: [],
imgUrl: iconImg
}
},
created() {
this.get()
},
methods: {
get() {
let list = []
let url = `${systemUrl}/backlog/get`
this.$api.get(url).then((r) => {
list = r.result
list.forEach((data) => {
// console.log(data.totalUrl)
let ulrt = `http://${address}:` + data.totalUrl
data.totalUrl = ''
this.$api.get(ulrt).then((r) => {
return (data.totalUrl = r.result)
})
})
console.log(list)
this.listTask = list
})
},
goPage(u) {
// alert(u.menuUrl)
this.$router.push(u.menuUrl)
}
}
}
</script>
<style lang="less" scoped>
.img_bg01 {
display: inline-block;
width: 48px;
height: 48px;
border-radius: 50%;
background: #249e91;
}
.img_bg02 {
display: inline-block;
width: 48px;
height: 48px;
border-radius: 50%;
background: #0099FF;
}
.img_bg03 {
display: inline-block;
width: 48px;
height: 48px;
border-radius: 50%;
background: #FF7A8B;
}
.img_bg04 {
display: inline-block;
width: 48px;
height: 48px;
border-radius: 50%;
background: #FFC300;
}
.img_icon {
width: 24px;
margin: 23% 0 0 0;
}
.waitTask {
cursor: pointer;
margin-bottom: 10px;
}
</style>
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