Commit 845eaf7f authored by renjintao's avatar renjintao

bug:hanle、mesplan、userselect

parent 0f2d6281
<template>
<div>
<div>
<div v-if="theme == 'list'" class="flex fd userSelect">
<div class="fg1 users">
<dl v-for="(g, i) in group" :key="i">
<dt :class="{ checked: g.opened }" class="flex fc-b">
<div class="ib fg">
<Checkbox v-model="g.checked" @on-change="checkAll(g, i)">
<span class="ml10">{{ g.departmentTitle }}</span>
</Checkbox>
<!-- <span class="ml20">(<span v-text="g.children | vvv"></span>/{{g.children.length}}人)</span></div> -->
<span class="ml20">({{ g.children.length }}人)</span>
</div>
<a class="op" @click="toggle(i)">
<Icon
:type="g.opened ? 'ios-arrow-up' : 'ios-arrow-down'"
size="24"
/>
</a>
</dt>
<dd
v-show="g.opened"
v-for="(li, j) in g.children"
:key="j"
@click="checkItem(i, j, li)"
:class="{ checked: li.checked }"
>
{{ li.userName }}
</dd>
</dl>
</div>
<div class="footer flex">
<div v-width="50" class="fa-m fs">
<span>已选项</span>
<div class="fg1 users">
<dl v-for="(g, i) in group" :key="i">
<dt :class="{ checked: g.opened }" class="flex fc-b">
<div class="ib fg">
<Checkbox v-model="g.checked" @on-change="checkAll(g, i)">
<span class="ml10">{{ g.departmentTitle }}</span>
</Checkbox>
<!-- <span class="ml20">(<span v-text="g.children | vvv"></span>/{{g.children.length}}人)</span></div> -->
<span class="ml20">({{ g.children.length }}人)</span>
</div>
<a class="op" @click="toggle(i)">
<Icon :type="g.opened ? 'ios-arrow-up' : 'ios-arrow-down'" size="24" />
</a>
</dt>
<dd v-show="g.opened" v-for="(li, j) in g.children" :key="j" @click="checkItem(i, j, li)" :class="{ checked: li.checked }">
{{ li.userName }}
</dd>
</dl>
</div>
<div class="fg">
<dl>
<dd v-for="(li, i) in checkedItems" :key="i">
<div class="flex">
<span class="fg">{{ li.userName }}</span>
<a @click="removeItem(li)">
<Icon type="md-close" size="16" />
</a>
</div>
</dd>
</dl>
<div class="footer flex">
<div v-width="50" class="fa-m fs">
<span>已选项</span>
</div>
<div class="fg">
<dl>
<dd v-for="(li, i) in checkedItems" :key="i">
<div class="flex">
<span class="fg">{{ li.userName }}</span>
<a @click="removeItem(li)">
<Icon type="md-close" size="16" />
</a>
</div>
</dd>
</dl>
</div>
</div>
</div>
</div>
<Select
v-else
:placeholder="placeholder"
v-model="name"
@on-change="change"
:multiple="multiple"
:departmentId="departmentId"
clearable
filterable
>
<Option
v-for="item in datas ? datas : dic"
:value="item.value"
:key="item.value"
:label="item.label"
>
<div>
{{ item.label }}
<span style="color: #c3c3c3" v-if="item.cardNo"
>({{ item.cardNo }})</span
>
<br />
<span style="color: #c3c3c3" v-if="item.departmentTitle">{{
<Select v-else :placeholder="placeholder" v-model="name" @on-change="change" :multiple="multiple" :departmentId="departmentId" clearable filterable>
<Option v-for="item in datas ? datas : dic" :value="item.value" :key="item.value" :label="item.label">
<div>
{{ item.label }}
<span style="color: #c3c3c3" v-if="item.cardNo">({{ item.cardNo }})</span>
<br />
<span style="color: #c3c3c3" v-if="item.departmentTitle">{{
item.departmentTitle
}}</span>
</div>
</Option>
</div>
</Option>
</Select>
</div>
</div>
</template>
<script>
export default {
model: {
prop: "value",
event: "on-change",
},
data() {
return {
name: this.value,
data: [],
departId: "",
group: [],
};
},
created() {
// let url = `${systemUrl}/user/getfordispatch_x`
// this.$api.get(url).then((r) => {
// this.data = r.result
// })
this.getselectuser();
},
props: {
value: [String, Number, Array],
placeholder: {
type: String,
default: "请选择人员",
},
multiple: {
type: Boolean,
default: false,
},
theme: {
type: String,
default: "select",
},
type: {
type: Number,
default: 0,
},
departmentId: {
type: Number,
default: 0,
model: {
prop: "value",
event: "on-change",
},
roleTitle: {
type: String,
default: "",
},
datas: {
//自定义用户数据
type: Array,
default: null,
},
},
methods: {
change(event) {
let name = "";
this.data.forEach((e) => {
if (e.id == event) {
name = e.label;
}
});
this.$emit("on-change", event, name);
},
// 加载人员
getselectuser(id) {
let url = `${systemUrl}/user/getselectuser`;
var paras={
// pageIndex: 1,
departmentId: id,
type: this.type,
roleTitle: this.roleTitle,
// pageSize: 0
data() {
return {
name: this.value,
data: [],
departId: "",
group: [],
};
if(this.type=99){//开发组
paras={
conditions:[
{
fieldName: "UserType",
fieldValue: "2",
conditionalType: "Equal",
},
]
};
}
this.$api
.post(url, paras)
.then((r) => {
this.data = r.result;
if (this.theme == "list") {
this.departmentGroup();
}
});
},
departmentGroup() {
var group = [];
var users = this.$u.clone(this.data);
if (this.name && this.name.length > 0) {
users.map((u) => {
u.checked = this.name.indexOf(u.id) > -1;
});
}
group = this.$u.group(users, (u) => {
return u.departmentId;
});
var deps = [];
group.map((u, i) => {
deps.push({
departmentTitle: u[0].departmentTitle,
departmentId: u[0].departmentId,
children: u,
opened: (i = 0),
checked: false,
});
});
this.group = deps;
},
toggle(i) {
this.group[i].opened = !this.group[i].opened;
// this.$set(this.group,i,this.group[i])
},
checkItem(i, j, item) {
item.checked = !item.checked;
this.group[i][j] = item;
this.$set(this.group, i, this.group[i]);
this.listSetValue();
},
removeItem(item) {
this.group.map((u, i) => {
if (u.departmentId == item.departmentId) {
u.children.map((p) => {
if (p.id == item.id) {
p.checked = false;
}
});
this.$set(this.group, i, u);
}
});
this.listSetValue();
},
//list 时,设置值。
listSetValue() {
var ids = [];
this.checkedItems.map((u) => {
ids.push(u.id);
});
this.$emit("on-change", ids);
created() {
// let url = `${systemUrl}/user/getfordispatch_x`
// this.$api.get(url).then((r) => {
// this.data = r.result
// })
this.getselectuser();
},
checkAll(item, i) {
item.children.map((u) => {
u.checked = item.checked;
});
this.$set(this.group, i, this.group[i]);
this.listSetValue();
props: {
value: [String, Number, Array],
placeholder: {
type: String,
default: "请选择人员",
},
multiple: {
type: Boolean,
default: false,
},
theme: {
type: String,
default: "select",
},
type: {
type: Number,
default: 0,
},
departmentId: {
type: Number,
default: 0,
},
roleTitle: {
type: String,
default: "",
},
datas: {
//自定义用户数据
type: Array,
default: null,
},
},
//获取所有的选中项
getSelectItems() {
var items = [];
if (this.theme == "list") {
this.checkedItems.map((u) => {
items.push(u);
});
} else {
if (!this.multiple) {
//单选时返回信息
if (this.datas && this.datas.length > 0) {
var item2 = this.datas.filter((u) => u.value == this.value);
if (item2 && item2[0]) {
items.push(item2[0]);
methods: {
change(event) {
let name = "";
this.data.forEach((e) => {
if (e.id == event) {
name = e.label;
}
});
this.$emit("on-change", event, name);
},
// 加载人员
getselectuser(id) {
let url = `${systemUrl}/user/getselectuser`;
var paras = {
// pageIndex: 1,
departmentId: id,
type: this.type,
roleTitle: this.roleTitle,
// pageSize: 0
};
if (this.type == 99) { //开发组
paras = {
conditions: [{
fieldName: "UserType",
fieldValue: "2",
conditionalType: "Equal",
}, ]
};
}
} else {
var item1 = this.dic.filter((u) => u.value == this.value);
if (item1 && item1[0]) {
items.push(item1[0]);
this.$api
.post(url, paras)
.then((r) => {
this.data = r.result;
if (this.theme == "list") {
this.departmentGroup();
}
});
},
departmentGroup() {
var group = [];
var users = this.$u.clone(this.data);
if (this.name && this.name.length > 0) {
users.map((u) => {
u.checked = this.name.indexOf(u.id) > -1;
});
}
}
} else {
//复选时返回
if (this.datas && this.datas.length > 0) {
this.value.forEach((v) => {
var item3 = this.dic.filter((u) => u.value == v);
if (item3 && item3[0]) {
items.push(item3[0]);
}
group = this.$u.group(users, (u) => {
return u.departmentId;
});
} else {
this.value.forEach((v) => {
var item = this.dic.filter((u) => u.value == v);
if (item && item[0]) {
items.push(item[0]);
}
var deps = [];
group.map((u, i) => {
deps.push({
departmentTitle: u[0].departmentTitle,
departmentId: u[0].departmentId,
children: u,
opened: (i = 0),
checked: false,
});
});
}
}
}
this.group = deps;
},
toggle(i) {
this.group[i].opened = !this.group[i].opened;
// this.$set(this.group,i,this.group[i])
},
checkItem(i, j, item) {
item.checked = !item.checked;
this.group[i][j] = item;
this.$set(this.group, i, this.group[i]);
this.listSetValue();
},
removeItem(item) {
this.group.map((u, i) => {
if (u.departmentId == item.departmentId) {
u.children.map((p) => {
if (p.id == item.id) {
p.checked = false;
}
});
this.$set(this.group, i, u);
}
});
this.listSetValue();
},
//list 时,设置值。
listSetValue() {
var ids = [];
this.checkedItems.map((u) => {
ids.push(u.id);
});
this.$emit("on-change", ids);
},
checkAll(item, i) {
item.children.map((u) => {
u.checked = item.checked;
});
this.$set(this.group, i, this.group[i]);
this.listSetValue();
},
//获取所有的选中项
getSelectItems() {
var items = [];
if (this.theme == "list") {
this.checkedItems.map((u) => {
items.push(u);
});
} else {
if (!this.multiple) {
//单选时返回信息
if (this.datas && this.datas.length > 0) {
var item2 = this.datas.filter((u) => u.value == this.value);
if (item2 && item2[0]) {
items.push(item2[0]);
}
} else {
var item1 = this.dic.filter((u) => u.value == this.value);
if (item1 && item1[0]) {
items.push(item1[0]);
}
}
} else {
//复选时返回
if (this.datas && this.datas.length > 0) {
this.value.forEach((v) => {
var item3 = this.dic.filter((u) => u.value == v);
if (item3 && item3[0]) {
items.push(item3[0]);
}
});
} else {
this.value.forEach((v) => {
var item = this.dic.filter((u) => u.value == v);
if (item && item[0]) {
items.push(item[0]);
}
});
}
}
}
return items;
},
//获取所有选中项的名称
getSelectNames() {
var names = [];
if (this.theme == "list") {
this.checkedItems.map((u) => {
items.push(u.userName);
});
} else {
this.getSelectItems().forEach((v) => {
names.push(v.label);
});
}
return names;
},
},
computed: {
dic() {
let result = [];
this.data.forEach((u) => {
// result.push({
// value: u.id,
// label: u.userName
// })
(u.value = u.id), (u.label = u.userName);
result.push(u);
});
return result;
},
checkedItems() {
var items = [];
this.group.map((u) => {
u.children.map((l) => {
if (l.checked) {
items.push(l);
}
});
});
return items;
},
},
filters: {
vvv: (lis) => {
return 3;
// return lis.filter(u=>{
// return u.checked==true
// }).lenght;
return items;
},
//获取所有选中项的名称
getSelectNames() {
var names = [];
if (this.theme == "list") {
this.checkedItems.map((u) => {
items.push(u.userName);
});
} else {
this.getSelectItems().forEach((v) => {
names.push(v.label);
});
}
return names;
},
},
},
watch: {
value: {
handler(v, o) {
this.name = v;
},
deep: true,
computed: {
dic() {
let result = [];
this.data.forEach((u) => {
// result.push({
// value: u.id,
// label: u.userName
// })
(u.value = u.id), (u.label = u.userName);
result.push(u);
});
return result;
},
checkedItems() {
var items = [];
this.group.map((u) => {
u.children.map((l) => {
if (l.checked) {
items.push(l);
}
});
});
return items;
},
},
departmentId: {
handler(v, o) {
this.getselectuser(v);
},
deep: true,
filters: {
vvv: (lis) => {
return 3;
// return lis.filter(u=>{
// return u.checked==true
// }).lenght;
},
},
datas(v) {
if (v) {
//alert(JSON.stringify(v))
}
watch: {
value: {
handler(v, o) {
this.name = v;
},
deep: true,
},
departmentId: {
handler(v, o) {
this.getselectuser(v);
},
deep: true,
},
datas(v) {
if (v) {
//alert(JSON.stringify(v))
}
},
},
},
};
</script>
<style lang="less">
@import "../../assets/css/custom.less";
.userSelect {
.users {
width: 100%;
border: 1px solid #2680eb;
max-height: 420px;
overflow: auto;
font-size: 14px;
}
dl {
width: 100%;
margin-bottom: 2px;
dt,
dd {
list-style: none;
padding: 0 15px;
}
dt {
width: 100%;
background: rgba(38, 128, 235, 0.1);
height: 48px;
font-weight: bold;
line-height: 48px;
color: rgba(81, 90, 110, 1);
a.op {
height: 26px;
width: 26px;
text-align: center;
display: inline-block;
padding-top: -15px;
line-height: 100%;
margin-top: 12px;
}
a.op:hover {
color: white;
background: rgba(38, 128, 235, 1.5);
border-radius: 4px;
}
.users {
width: 100%;
border: 1px solid #2680eb;
max-height: 420px;
overflow: auto;
font-size: 14px;
}
dt.checked {
background: rgba(38, 128, 235);
color: white;
a.op {
color: white;
}
a.op:hover {
background: white;
color: rgba(38, 128, 235);
}
dl {
width: 100%;
margin-bottom: 2px;
dt,
dd {
list-style: none;
padding: 0 15px;
}
dt {
width: 100%;
background: rgba(38, 128, 235, 0.1);
height: 48px;
font-weight: bold;
line-height: 48px;
color: rgba(81, 90, 110, 1);
a.op {
height: 26px;
width: 26px;
text-align: center;
display: inline-block;
padding-top: -15px;
line-height: 100%;
margin-top: 12px;
}
a.op:hover {
color: white;
background: rgba(38, 128, 235, 1.5);
border-radius: 4px;
}
}
dt.checked {
background: rgba(38, 128, 235);
color: white;
a.op {
color: white;
}
a.op:hover {
background: white;
color: rgba(38, 128, 235);
}
}
dd {
min-width: 120px;
line-height: 32px;
height: 36px;
border-radius: 18px;
display: inline-block;
background: rgba(38, 128, 235, 0.1);
border: 2px solid transparent;
color: @table-color;
margin: 10px;
a {
display: inline-flex;
width: 20px;
height: 20px;
border-radius: 4px;
border: 1px solid transparent;
justify-items: center;
align-items: center;
margin-top: 5px;
}
a:hover {
background: rgb(241, 14, 14);
color: white;
}
}
dd:hover {
// background: rgba(38, 128, 235, 1);
// border:1px solid rgba(38,128,235,0.1);
background: rgba(38, 128, 235, 0.1);
border: 2px solid rgba(38, 128, 235, 1);
// color: white;
cursor: pointer;
}
dd.checked {
border: 2px solid rgba(38, 128, 235, 1);
}
}
dd {
min-width: 120px;
line-height: 32px;
height: 36px;
border-radius: 18px;
display: inline-block;
background: rgba(38, 128, 235, 0.1);
border: 2px solid transparent;
color: @table-color;
margin: 10px;
a {
display: inline-flex;
width: 20px;
height: 20px;
border-radius: 4px;
border: 1px solid transparent;
justify-items: center;
align-items: center;
.footer {
margin-top: 5px;
}
a:hover {
background: rgb(241, 14, 14);
color: white;
}
}
dd:hover {
// background: rgba(38, 128, 235, 1);
// border:1px solid rgba(38,128,235,0.1);
background: rgba(38, 128, 235, 0.1);
border: 2px solid rgba(38, 128, 235, 1);
// color: white;
cursor: pointer;
}
dd.checked {
border: 2px solid rgba(38, 128, 235, 1);
}
}
.footer {
margin-top: 5px;
min-height: 68px;
dl {
background: rgba(245, 246, 250, 1);
border: 1px solid rgba(220, 223, 230, 1);
opacity: 1;
border-radius: 4px;
min-height: 48px;
flex-wrap: wrap;
min-height: 68px;
dl {
background: rgba(245, 246, 250, 1);
border: 1px solid rgba(220, 223, 230, 1);
opacity: 1;
border-radius: 4px;
min-height: 48px;
flex-wrap: wrap;
}
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<div class="myBug">
<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>
<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 :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 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>
</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("status"),
key: "status",
align: "center",
width: 120,
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: 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",
},
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("status"),
key: "status",
align: "center",
width: 120,
high: true,
code: "Handle.todoList.status",
},
{
title: this.l("creator"),
key: "creatorUserId",
align: "center",
type: "user"
},
{
title: this.l("creationTime"),
key: "creationTime",
align: "center",
},
{
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: "操作",
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: {
oprate: "detail",
title: this.tabIndex == 2 ? "审核" : "查看",
},
on: {
click: () => {
this.listInfo(
params.row.schemaId,
params.row.schemaName,
params.row.code,
params.row.id
);
title: "操作",
align: "center",
render: (h, params) => {
return h("div", {
class: "action"
}, [
h(
"op", {
attrs: {
oprate: "detail",
title: this.tabIndex == 2 ? "审核" : "查看",
},
on: {
click: () => {
this.listInfo(
params.row.schemaId,
params.row.schemaName,
params.row.code,
params.row.id
);
},
},
},
this.tabIndex == 2 ? "审核" : "查看"
),
]);
},
},
},
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 (() => {
],
codeTypeName: "", //审核类型
gridHeight: "",
//订单审核开始
modalOrderExamine: false,
srcUrl: "",
iframeHeight: "",
titleOrderExamine: "",
OrderExamine: "",
//订单审核结束
};
},
created() {
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;
if (this.tabIndex < 4) {
this.search();
}
},
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;
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.iframeHeight = window.screenHeight - 58;
this.gridHeight = window.screenHeight - 260;
})();
};
this.getSchema();
},
//将schameId转为type1、2、3....
returnType(schemaId) {
console.log(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;
case "b6303ddc-8b5e-40a3-a51b-294657d1d913": //物料审批
types = 13;
break;
default:
types = 14;
break;
}
return types;
computed: {},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
cancelModal() {
this.search();
},
l(key) {
let vkey = "handleList" + "." + key;
return this.$t(vkey) || key;
methods: {
setTime(v) {
this.easySearch.range.value = v;
},
//选项卡切换
tab(data) {
this.tabIndex = Number(data) + 1;
this.easySearch.type.value = this.tabIndex;
if (this.tabIndex < 4) {
this.search();
}
},
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) {
console.log(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;
case "b6303ddc-8b5e-40a3-a51b-294657d1d913": //物料审批
types = 13;
break;
default:
types = 14;
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;
padding: 0px;
}
</style>
......@@ -697,6 +697,7 @@ export default {
if (res.success) {
this.$Message.success("订单送审成功!");
this.$refs.grid.load();
this.sendViewModal = false;
} else {
this.$Message.error("订单送审失败!");
}
......
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