Commit f12229c9 authored by 仇晓婷's avatar 仇晓婷

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents d6048a1a 40912b67
<template>
<div class="myBug">
<div class="myBug">
<Tabs :animated="false" @on-click="tab">
<TabPane label="我的"></TabPane>
<TabPane label="所有"></TabPane>
<TabPane label="我的"></TabPane>
<TabPane label="所有"></TabPane>
</Tabs>
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
@on-selection-change="selectInfo"
:height="gridHeight"
>
<template slot="easySearch">
<Form inline >
<FormItem>
<dictionary
code="Test.bug.status"
v-model="easySearch.status.value"
style="width:400px;"
multiple
></dictionary>
</FormItem>
<FormItem>
<Input
search
enter-button
placeholder="请输入bug标题或地址"
@on-search="search"
v-model="easySearch.keys.value"
/>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="batch">
<Form :model="formMyCheck" :label-width="5" :rules="ruleValidate" inline ref="formValidate">
<FormItem>
<dictionary
code="Test.but.statusOper"
v-model="selectBatch"
type="radio"
@on-change="statuChange"
ref="dicradio"
></dictionary>
</FormItem>
<FormItem v-if="selectBatch == 5" label prop="selectAlloter">
<UserSelect ref="userSelected" v-model="alloter" @on-change="changeUserSelect" />
</FormItem>
<FormItem>
<Button type="primary" @click="upChange">确定</Button>
</FormItem>
</Form>
</template>
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" @on-selection-change="selectInfo" :height="gridHeight">
<template slot="easySearch">
<Form inline>
<FormItem>
<dictionary code="Test.bug.status" v-model="easySearch.status.value" style="width:400px;" multiple></dictionary>
</FormItem>
<FormItem>
<Input search enter-button placeholder="请输入bug标题或地址" @on-search="search" v-model="easySearch.keys.value" />
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="batch">
<Form :model="formMyCheck" :label-width="5" :rules="ruleValidate" inline ref="formValidate">
<FormItem>
<dictionary code="Test.but.statusOper" v-model="selectBatch" type="radio" @on-change="statuChange" ref="dicradio"></dictionary>
</FormItem>
<FormItem v-if="selectBatch == 5" label prop="selectAlloter">
<UserSelect ref="userSelected" v-model="alloter" @on-change="changeUserSelect" />
</FormItem>
<FormItem>
<Button type="primary" @click="upChange">确定</Button>
</FormItem>
</Form>
</template>
</DataGrid>
<Modal v-model="modalEdit" fullscreen title="bug编辑" @on-cancel="canselModal(1)">
<edit ref="edit" />
<div slot="footer">
<Button @click="canselModal(1)">取消</Button>
<Button type="primary" @click="addSave">确定</Button>
</div>
<edit ref="edit" />
<div slot="footer">
<Button @click="canselModal(1)">取消</Button>
<Button type="primary" @click="addSave">确定</Button>
</div>
</Modal>
<Modal v-model="modalDetail" fullscreen title="bug操作" @on-cancel="canselModal(2)">
<detail ref="detail" />
<div slot="footer">
<Button @click="canselModal(2)">取消</Button>
<Button type="primary" @click="detailSave">确定</Button>
</div>
<detail ref="detail" />
<div slot="footer">
<Button @click="canselModal(2)">取消</Button>
<Button type="primary" @click="detailSave">确定</Button>
</div>
</Modal>
<Modal v-model="modalInfo" title="批量信息">
确定进行批量操作?
<div slot="footer">
<Button @click="modalInfo = false">取消</Button>
<Button type="primary" @click="upSave">确定</Button>
</div>
确定进行批量操作?
<div slot="footer">
<Button @click="modalInfo = false">取消</Button>
<Button type="primary" @click="upSave">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from "@/libs/bug";
import edit from "./component/add";
import detail from "./component/detail";
import Search from "./component/search";
export default {
name: "bug",
components: {
edit,
detail,
Search
},
data() {
let userInfo = this.$store.state.admin.user.info;
return {
action: Api.index,
easySearch: {
keys: { op: "title,pagePath", value: "" },
status: { op: "In", value: [1,5,0] },
creatorUserId: {
op: "Equal",
value: userInfo.userId
}
},
selectList: [],
results: [],
footerBar: false,
modalInfo: false,
gridHeight: "",
totals: 10,
pageSizeOpts: [20, 50, 100],
pageSize: 20,
tabIndex: 1,
columns: [
{
type: "selection",
width: 60,
align: "center"
},
{
key: "id",
width: 80,
title: this.l("id")
name: "bug",
components: {
edit,
detail,
Search
},
data() {
let userInfo = this.$store.state.admin.user.info;
return {
action: Api.index,
easySearch: {
keys: {
op: "title,pagePath",
value: ""
},
status: {
op: "In",
value: [1, 5, 0]
},
creatorUserId: {
op: "Equal",
value: userInfo.userId
}
},
selectList: [],
results: [],
footerBar: false,
modalInfo: false,
gridHeight: "",
totals: 10,
pageSizeOpts: [20, 50, 100],
pageSize: 20,
tabIndex: 1,
columns: [{
type: "selection",
width: 60,
align: "center"
},
{
key: "id",
width: 80,
title: this.l("id")
},
{
title: this.l("level"),
key: "level",
width: 100
},
{
title: this.l("title"),
key: "title",
width: 240,
tooltip: true,
render: (h, params) =>
h(
"a", {
style: {},
on: {
click: () => {
this.detailInfo(params.row);
}
}
},
params.row.title
)
},
{
title: this.l("pagePath"),
key: "pagePath",
tooltip: true,
render: (h, params) =>
h(
"a", {
style: {},
on: {
click: () => {
window.open(params.row.pagePath, "_blank");
}
}
},
params.row.pagePath
)
},
{
title: this.l("status"),
key: "status",
width: 100,
code: 'Test.bug.status',
},
{
title: this.l("creationTime"),
key: "creationTime",
align: "center",
width: 180
},
{
title: this.l("createor"),
key: "createor",
width: 120
},
{
title: this.l("alloter"),
key: "alloter",
width: 120
},
{
title: this.l("lastModificationTime"),
key: "lastModificationTime",
align: "center",
width: 180
},
{
title: this.l("auditUser"),
align: "center",
key: "auditUser",
width: 120
},
{
key: "action",
title: "操作",
align: "center",
width: 180,
render: (h, params) =>
h("div", [
h(
"Button", {
props: {
type: "text",
size: "small"
},
style: {
color: "green"
},
on: {
click: () => {
this.detailInfo(params.row);
}
}
},
"解决"
),
h(
"Button", {
props: {
type: "text",
size: "small"
},
style: {
color: "green"
},
on: {
click: () => {
this.editInfo(params.row);
}
}
},
"编辑"
)
])
}
],
statusList: [{
name: "确认",
value: "1"
},
{
name: "解决",
value: "2"
},
{
name: "冻结",
value: "4"
},
{
name: "关闭",
value: "3"
}
],
modalEdit: false,
modalDetail: false,
searchForm: {
Status: 0,
PageSize: 20,
Current: 1
},
listBatch: {
ids: [],
statusNew: 0,
auditUser: "",
workHours: 0,
remark: "",
alloter: "",
alloterId: null
},
selectBatch: 100,
auditUser: null,
alloter: {},
formMyCheck: {
selectAlloter: null
},
ruleValidate: {
selectAlloter: [{
required: true,
message: "请选择驳指派人",
type: "number",
trigger: "change"
}]
}
};
},
computed: {},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
//选项卡切换
tab(data) {
if (data == "0") {
this.easySearch.creatorUserId.value = this.$store.state.userInfo.userId;
} else {
this.easySearch.creatorUserId.value = null;
}
this.search();
},
{
title: this.l("level"),
key: "level",
width: 100
search() {
this.$refs.grid.easySearch(this.easySearch);
},
{
title: this.l("title"),
key: "title",
width: 240,
tooltip: true,
render: (h, params) =>
h(
"a",
{
style: {},
on: {
click: () => {
this.detailInfo(params.row);
}
}
},
params.row.title
)
//打开修改窗口
editInfo(value) {
this.modalEdit = true;
this.$refs.edit.editeInfo(value);
},
{
title: this.l("pagePath"),
key: "pagePath",
tooltip: true,
render: (h, params) =>
h(
"a",
{
style: {},
on: {
click: () => {
window.open(params.row.pagePath, "_blank");
}
}
},
params.row.pagePath
)
//修改事件
addSave() {
let param = this.$refs.edit.addBugInfo();
param.auditUser = this.$store.state.userInfo.userName;
if (param.id != null) {
//增加确定
this.$http.bug.createorupdate(param).then(res => {
if (res.result.status) {
this.$Message.success("修改成功!");
this.search();
} else {
this.$Message.error("修改失败!");
}
this.modalEdit = false;
});
} else {
this.$Message.error("修改失败!");
}
},
{
title: this.l("status"),
key: "status",
width: 100,
render: (h, params) => {
return h("state", {
props: {
code: "Test.bug.status",
type: "text",
value: params.row.status + ""
}
});
}
//打开确定/操作窗口
detailInfo(value) {
this.modalDetail = true;
this.$refs.detail.detailInfo(value);
},
{
title: this.l("creationTime"),
key: "creationTime",
align: "center",
width: 180
//确定/关闭操作
detailSave() {
let param = this.$refs.detail.addBugInfo();
param.auditUser = this.$store.state.userInfo.userName;
param.ids = [param.id];
if (param.id != null) {
//增加确定
this.$http.bug.doaction(param).then(res => {
if (res.result) {
this.$Message.success("操作成功!");
this.search();
} else {
this.$Message.error("操作失败!");
}
this.modalDetail = false;
});
} else {
this.$Message.error("操作失败!");
}
},
{
title: this.l("createor"),
key: "createor",
width: 120
//取消窗口,查看状态
canselModal(type) {
let param;
if (type == 1) {
param = this.$refs.edit.addBugInfo();
} else {
param = this.$refs.detail.addBugInfo();
}
param.auditUser = this.$store.state.userInfo.userName;
param.ids = [param.id];
param.statusNew = 6;
if (param.id != null) {
//增加改变状态为6/查看
this.$http.bug.doaction(param).then(res => {
if (res.result) {
//this.search(this.searchForm)
} else {
this.$Message.error("操作失败!");
}
});
} else {
this.$Message.error("操作失败!");
}
this.modalDetail = false;
this.modalEdit = false;
},
{
title: this.l("alloter"),
key: "alloter",
width: 120
selectInfo(value) {
this.selectList = [];
this.selectList = value;
let statueArry = [];
value.forEach(data => {
var that = this;
statueArry.push(data.id);
});
this.results = [];
this.results = statueArry;
this.getListId(statueArry);
},
{
title: this.l("lastModificationTime"),
key: "lastModificationTime",
align: "center",
width: 180
//得到需要批量操作的ids
getListId(value) {
this.listBatch.ids = value;
if (this.listBatch.ids.length > 0) {
this.footerBar = true;
//this.showBt = false
this.selectBatch = 100;
} else {
this.footerBar = false;
//this.showBt = false
this.selectBatch = 100;
}
this.listBatch.auditUser = this.$store.state.userInfo.userName;
},
{
title: this.l("auditUser"),
align: "center",
key: "auditUser",
width: 120
//批量操作
statuChange(value) {
this.listBatch.statusNew = value;
},
{
key:"action",
title: "操作",
align: "center",
width: 180,
render: (h, params) =>
h("div", [
h(
"Button",
{
props: {
type: "text",
size: "small"
},
style: {
color: "green"
},
on: {
click: () => {
this.detailInfo(params.row);
upChange() {
if (this.selectBatch != 100) {
if (this.listBatch.ids.length != 0) {
if (this.selectBatch == 5) {
this.$refs["formValidate"].validate(valid => {
if (valid) {
let alloterInfo = this.$refs["userSelected"].getSelectItems();
this.listBatch.alloter = alloterInfo[0].userName;
this.listBatch.alloterId = alloterInfo[0].id;
this.modalInfo = true;
}
});
} else {
this.modalInfo = true;
}
}
},
"解决"
),
h(
"Button",
{
props: {
type: "text",
size: "small"
},
style: {
color: "green"
},
on: {
click: () => {
this.editInfo(params.row);
}
}
},
"编辑"
)
])
}
],
statusList: [
{ name: "确认", value: "1" },
{ name: "解决", value: "2" },
{ name: "冻结", value: "4" },
{ name: "关闭", value: "3" }
],
modalEdit: false,
modalDetail: false,
searchForm: {
Status: 0,
PageSize: 20,
Current: 1
},
listBatch: {
ids: [],
statusNew: 0,
auditUser: "",
workHours: 0,
remark: "",
alloter: "",
alloterId: null
},
selectBatch: 100,
auditUser: null,
alloter: {},
formMyCheck: {
selectAlloter: null
},
ruleValidate: {
selectAlloter: [
{
required: true,
message: "请选择驳指派人",
type: "number",
trigger: "change"
}
]
}
};
},
computed: {},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
//选项卡切换
tab(data) {
if (data == "0") {
this.easySearch.creatorUserId.value = this.$store.state.userInfo.userId;
} else {
this.easySearch.creatorUserId.value = null;
}
this.search();
},
search() {
this.$refs.grid.easySearch(this.easySearch);
},
//打开修改窗口
editInfo(value) {
this.modalEdit = true;
this.$refs.edit.editeInfo(value);
},
//修改事件
addSave() {
let param = this.$refs.edit.addBugInfo();
param.auditUser = this.$store.state.userInfo.userName;
if (param.id != null) {
//增加确定
this.$http.bug.createorupdate(param).then(res => {
if (res.result.status) {
this.$Message.success("修改成功!");
this.search();
} else {
this.$Message.error("修改失败!");
}
this.modalEdit = false;
});
} else {
this.$Message.error("修改失败!");
}
},
//打开确定/操作窗口
detailInfo(value) {
this.modalDetail = true;
this.$refs.detail.detailInfo(value);
},
//确定/关闭操作
detailSave() {
let param = this.$refs.detail.addBugInfo();
param.auditUser = this.$store.state.userInfo.userName;
param.ids = [param.id];
if (param.id != null) {
//增加确定
this.$http.bug.doaction(param).then(res => {
if (res.result) {
this.$Message.success("操作成功!");
this.search();
} else {
this.$Message.error("操作失败!");
}
this.modalDetail = false;
});
} else {
this.$Message.error("操作失败!");
}
},
//取消窗口,查看状态
canselModal(type) {
let param;
if (type == 1) {
param = this.$refs.edit.addBugInfo();
} else {
param = this.$refs.detail.addBugInfo();
}
param.auditUser = this.$store.state.userInfo.userName;
param.ids = [param.id];
param.statusNew = 6;
if (param.id != null) {
//增加改变状态为6/查看
this.$http.bug.doaction(param).then(res => {
if (res.result) {
//this.search(this.searchForm)
} else {
this.$Message.error("操作失败!");
}
});
} else {
this.$Message.error("操作失败!");
}
this.modalDetail = false;
this.modalEdit = false;
},
selectInfo(value) {
this.selectList = [];
this.selectList = value;
let statueArry = [];
value.forEach(data => {
var that = this;
statueArry.push(data.id);
});
this.results = [];
this.results = statueArry;
this.getListId(statueArry);
},
//得到需要批量操作的ids
getListId(value) {
this.listBatch.ids = value;
if (this.listBatch.ids.length > 0) {
this.footerBar = true;
//this.showBt = false
this.selectBatch = 100;
} else {
this.footerBar = false;
//this.showBt = false
this.selectBatch = 100;
}
this.listBatch.auditUser = this.$store.state.userInfo.userName;
},
//批量操作
statuChange(value) {
this.listBatch.statusNew = value;
},
upChange() {
if (this.selectBatch != 100) {
if (this.listBatch.ids.length != 0) {
if (this.selectBatch == 5) {
this.$refs["formValidate"].validate(valid => {
if (valid) {
let alloterInfo = this.$refs["userSelected"].getSelectItems();
this.listBatch.alloter = alloterInfo[0].userName;
this.listBatch.alloterId = alloterInfo[0].id;
this.modalInfo = true;
}
} else {
this.$Message.error("请选择操作列表!");
this.selectBatch = 100;
}
} else {
this.$Message.error("请选择操作!");
}
},
changeUserSelect(val) {
if (val != undefined && val.length != "" && val.length != 0) {
this.formMyCheck.selectAlloter = 1;
} else {
this.formMyCheck.selectAlloter = null;
this.listBatch.alloter = "";
this.listBatch.alloterId = null;
}
},
upSave() {
//增加确定
this.$http.bug.doaction(this.listBatch).then(res => {
if (res.result) {
this.$Message.success("操作成功!");
this.search();
this.footerBar = false;
this.showBt = false;
this.modalInfo = false;
this.selectBatch = 100;
} else {
this.$Message.error("操作失败!");
}
});
} else {
this.modalInfo = true;
}
} else {
this.$Message.error("请选择操作列表!");
this.selectBatch = 100;
}
} else {
this.$Message.error("请选择操作!");
}
},
changeUserSelect(val) {
if (val != undefined && val.length != "" && val.length != 0) {
this.formMyCheck.selectAlloter = 1;
} else {
this.formMyCheck.selectAlloter = null;
this.listBatch.alloter = "";
this.listBatch.alloterId = null;
}
},
upSave() {
//增加确定
this.$http.bug.doaction(this.listBatch).then(res => {
if (res.result) {
this.$Message.success("操作成功!");
this.search();
this.footerBar = false;
this.showBt = false;
this.modalInfo = false;
this.selectBatch = 100;
} else {
this.$Message.error("操作失败!");
}
});
},
arry2Name(arryList, values) {
//预警类别转换
var codes = arryList;
var name = "";
for (let i in codes) {
if (values == codes[i].value) {
name = codes[i].name;
},
arry2Name(arryList, values) {
//预警类别转换
var codes = arryList;
var name = "";
for (let i in codes) {
if (values == codes[i].value) {
name = codes[i].name;
}
}
return name;
},
canselFooter() {
this.footerBar = false;
this.selectBatch = 100;
},
l(key) {
let vkey = "bug" + "." + key;
return this.$t(vkey) || key;
}
}
return name;
},
canselFooter() {
this.footerBar = false;
this.selectBatch = 100;
},
l(key) {
let vkey = "bug" + "." + key;
return this.$t(vkey) || key;
}
},
created() {
window.screenHeight = window.innerHeight;
this.gridHeight = window.screenHeight - 250;
},
mounted() {
// this.search(this.searchForm)
window.onresize = () => {
return (() => {
created() {
window.screenHeight = window.innerHeight;
this.gridHeight = window.screenHeight - 250;
})();
};
}
},
mounted() {
// this.search(this.searchForm)
window.onresize = () => {
return (() => {
window.screenHeight = window.innerHeight;
this.gridHeight = window.screenHeight - 250;
})();
};
}
};
</script>
......@@ -18,7 +18,7 @@
<Button type="primary" @click="add">新增</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" :fullscreen="full" footer-hide>
<Modal v-model="modal" :title="title" width="1200" :fullscreen="full" :footer-hide="initBtn">
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
......@@ -48,6 +48,7 @@ export default {
},
modal: false,
full: false,
initBtn: true,
title: "新增",
detail: null,
curId: 0,
......@@ -213,6 +214,7 @@ export default {
add() {
this.curId = 0;
this.full = false;
this.initBtn = true;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
......@@ -227,6 +229,7 @@ export default {
this.curId = id;
this.title = "详情";
this.full = false;
this.initBtn = false;
this.detail = () => import("./detail");
this.modal = true;
},
......@@ -234,6 +237,7 @@ export default {
this.curId = id;
this.title = "编辑";
this.full = false;
this.initBtn = true;
this.detail = () => import("./edit");
this.modal = true;
},
......@@ -241,6 +245,7 @@ export default {
this.curId = row.id;
this.title = "处理文件:" + row.name;
this.full = true;
this.initBtn = true;
this.detail = () => import("./process");
this.modal = true;
},
......
<template>
<div class="monitoring h100">
<div class="monitoring h100">
<DataGrid :columns="columns" ref="grid" :action="action">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline style="margin-top:5px;">
<FormItem prop="productingpreparationpeople" style="width:200px">
<departmentSelect v-model="easySearch.productingpreparationpeople.value" :type="3"></departmentSelect>
</FormItem>
<FormItem prop="keys">
<Input placeholder="请输入订单编号" v-model="easySearch.keys.value" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline style="margin-top:5px;">
<FormItem prop="productingpreparationpeople" style="width:200px">
<departmentSelect v-model="easySearch.productingpreparationpeople.value" :type="3"></departmentSelect>
</FormItem>
<FormItem prop="keys">
<Input placeholder="请输入订单编号" v-model="easySearch.keys.value" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
</DataGrid>
<Modal v-model="suspendModal" title="暂停原因" footer-hide class="suspend">
<Suspend @on-close="cancel" @on-ok="suspendOk" ref="addBug" :rowSuspend="rowSuspend" />
<Suspend @on-close="cancel" @on-ok="suspendOk" ref="addBug" :rowSuspend="rowSuspend" />
</Modal>
<Modal v-model="recordModal" title="暂停记录" fullscreen footer-hide class="recordM">
<Record :eid="recordId" />
<Record :eid="recordId" />
</Modal>
<Modal v-model="SpeedModal" title="工单信息" fullscreen footer-hide class="recordM">
<Speed
:result="result"
:load="loading"
@on-close="clsoeSpeedModal"
:executeId="dispatchExecuteId"
:orderId="orderId"
/>
<Speed :result="result" :load="loading" @on-close="clsoeSpeedModal" :executeId="dispatchExecuteId" :orderId="orderId" />
</Modal>
<Modal v-model="recycleModal" title="确定回收订单" width="600" class="suspend">
<Form ref="form" :model="recovery" :rules="rulesRecycle" :label-width="120">
<Row>
<Col :span="24">
<FormItem :label="l('mesCode')">{{mesCode}}</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('demandFinishDate')" prop="demandFinishDate">
<DatePicker
type="date"
placeholder="请选择日期"
style="width:240px"
v-model="recovery.demandFinishDate"
></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
<div slot="footer">
<Button @click="cancelRecycle">取消</Button>
<Button type="primary" @click="changeFinishiDate">确定</Button>
</div>
<Form ref="form" :model="recovery" :rules="rulesRecycle" :label-width="120">
<Row>
<Col :span="24">
<FormItem :label="l('mesCode')">{{mesCode}}</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('demandFinishDate')" prop="demandFinishDate">
<DatePicker type="date" placeholder="请选择日期" style="width:240px" v-model="recovery.demandFinishDate"></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
<div slot="footer">
<Button @click="cancelRecycle">取消</Button>
<Button type="primary" @click="changeFinishiDate">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from "./api";
import Suspend from "./suspend";
......@@ -66,580 +56,595 @@ import Search from "./search";
import Speed from "./speed";
export default {
name: "index",
components: {
Record,
Search,
Suspend,
Speed,
},
data() {
return {
result: [],
dispatchExecuteId: null, //任务id
orderId: null, //订单id
SpeedModal: false,
rowSuspend: {},
recordId: 0,
laster: 0,
action: Api.index,
easySearch: {
keys: { op: "mesCode", value: null },
productingpreparationpeople: { op: "Equal", value: null },
},
suspendModal: false,
recordModal: false,
deletelModal: false,
recycleModal: false,
curId: 0,
columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" },
{
title: "序号",
type: "index",
width: 70,
align: "center",
},
{
key: "status",
title: this.l("status"),
code: "plan.order.status",
align: "center",
easy: true,
high: true,
width: 100,
},
{
key: "mesCode",
title: this.l("mesCode"),
align: "left",
render: (h, params) => {
return h("div", [
params.row.mesCode,
[
h(
"Poptip",
{
props: {
content: "开工预警:" + params.row.startWarning + "条",
trigger: "hover",
},
style: {
cursor: "pointer",
},
},
[
h(
params.row.startWarning > 0 ? "Badge" : "",
{
props: {
type: "warning",
// count: 2,
count: params.row.startWarning,
},
style: {
marginTop: "12px",
marginLeft: "5px",
},
},
[
h("Icon", {
props: {
type: "md-alert",
},
style: {
fontSize: "16px",
color: "#f1cb08",
},
}),
]
),
]
),
h(
"Poptip",
{
props: {
content: "完工预警:" + params.row.finishWarning + "条",
trigger: "hover",
name: "index",
components: {
Record,
Search,
Suspend,
Speed,
},
data() {
return {
result: [],
dispatchExecuteId: null, //任务id
orderId: null, //订单id
SpeedModal: false,
rowSuspend: {},
recordId: 0,
laster: 0,
action: Api.index,
easySearch: {
keys: {
op: "mesCode",
value: null
},
productingpreparationpeople: {
op: "Equal",
value: null
},
},
suspendModal: false,
recordModal: false,
deletelModal: false,
recycleModal: false,
curId: 0,
columns: [{
key: "id",
title: this.l("id"),
hide: true,
align: "left"
},
{
title: "序号",
type: "index",
width: 70,
align: "center",
},
{
key: "status",
title: this.l("status"),
code: "plan.order.status",
align: "center",
easy: true,
high: true,
width: 100,
},
{
key: "mesCode",
title: this.l("mesCode"),
align: "left",
render: (h, params) => {
return h("div", [
params.row.mesCode,
[
h(
"Poptip", {
props: {
content: "开工预警:" + params.row.startWarning + "条",
trigger: "hover",
},
style: {
cursor: "pointer",
},
},
[
h(
params.row.startWarning > 0 ? "Badge" : "", {
props: {
type: "warning",
// count: 2,
count: params.row.startWarning,
},
style: {
marginTop: "12px",
marginLeft: "5px",
},
},
[
h("Icon", {
props: {
type: "md-alert",
},
style: {
fontSize: "16px",
color: "#f1cb08",
},
}),
]
),
]
),
h(
"Poptip", {
props: {
content: "完工预警:" + params.row.finishWarning + "条",
trigger: "hover",
},
},
[
h(
params.row.finishWarning > 0 ? "Badge" : "", {
props: {
type: "info",
// count: 2,
count: params.row.finishWarning,
},
style: {
marginTop: "12px",
marginLeft: "5px",
},
},
[
h("Icon", {
props: {
type: "md-alert",
},
style: {
fontSize: "16px",
color: "#31F8E6",
marginLeft: "5px",
},
}),
]
),
]
),
],
]);
},
},
[
h(
params.row.finishWarning > 0 ? "Badge" : "",
{
props: {
type: "info",
// count: 2,
count: params.row.finishWarning,
},
style: {
marginTop: "12px",
marginLeft: "5px",
},
},
[
h("Icon", {
props: {
type: "md-alert",
},
style: {
fontSize: "16px",
color: "#31F8E6",
marginLeft: "5px",
},
}),
]
),
]
),
],
]);
},
},
{
key: "productName",
title: this.l("productName"),
align: "left",
easy: true,
high: true,
},
{
key: "demandStartDate",
title: this.l("demandStartDate"),
align: "center",
high: true,
width: 130,
render: (h, params) => {
return h(
"span",
this.sliceStr(params.row.demandStartDate + " ", 0, 10),
params.row.demandStartDate
);
},
},
{
key: "demandFinishDate",
title: this.l("demandFinishDate"),
align: "center",
high: true,
width: 130,
render: (h, params) => {
return h(
"span",
this.sliceStr(params.row.demandFinishDate + " ", 0, 10),
params.row.demandFinishDate
);
},
},
{
key: "actualStartDate",
title: this.l("actualStartDate"),
align: "center",
high: true,
width: 150,
render: (h, params) => {
return h(
"span",
// this.sliceStr(params.row.actualStartDate + ' ', 0, 10),
params.row.actualStartDate == "0001-01-01 00:00:00"
? ""
: params.row.actualStartDate
);
},
},
{
key: "actualFinishDate",
title: this.l("actualFinishDate"),
align: "center",
high: true,
width: 150,
render: (h, params) => {
return h(
"span",
// this.sliceStr(params.row.actualFinishDate + ' ', 0, 10),
params.row.actualFinishDate == "0001-01-01 00:00:00"
? ""
: params.row.actualFinishDate
);
},
},
{
key: "routingType",
title: this.l("routingType"),
align: "left",
code: "mes_xingchi_plan.order_material.routingType",
easy: true,
high: true,
width: 100,
},
{
title: this.l("jindu"),
key: "action",
width: 200,
align: "center",
render: (h, params) => {
return h("div", [
h(
"ButtonGroup",
},
{
props: {
shape: "circle",
},
key: "productName",
title: this.l("productName"),
align: "left",
easy: true,
high: true,
},
[
h(
"Button",
{
style: {
background: "#e4e6ed ",
borderColor: "#e4e6ed ",
},
on: {
click: () => {
this.speed(params.row);
},
},
{
key: "demandStartDate",
title: this.l("demandStartDate"),
align: "center",
high: true,
width: 130,
render: (h, params) => {
return h(
"span",
this.sliceStr(params.row.demandStartDate + " ", 0, 10),
params.row.demandStartDate
);
},
params.row.unstartCount //未开工数
),
h(
"Button",
{
style: {
background: "#ffc000",
borderColor: "#ffc000",
},
on: {
click: () => {
this.speed(params.row);
},
},
},
{
key: "demandFinishDate",
title: this.l("demandFinishDate"),
align: "center",
high: true,
width: 130,
render: (h, params) => {
return h(
"span",
this.sliceStr(params.row.demandFinishDate + " ", 0, 10),
params.row.demandFinishDate
);
},
params.row.startCount //开工数
),
h(
"Button",
{
style: {
background: "#ff7a8b",
borderColor: "#ff7a8b",
},
on: {
click: () => {
this.speed(params.row);
},
},
},
{
key: "actualStartDate",
title: this.l("actualStartDate"),
align: "center",
high: true,
width: 150,
render: (h, params) => {
return h(
"span",
// this.sliceStr(params.row.actualStartDate + ' ', 0, 10),
params.row.actualStartDate == "0001-01-01 00:00:00" ?
"" :
params.row.actualStartDate
);
},
params.row.stopCount //暂停数
),
h(
"Button",
{
style: {
background: "#27c149",
borderColor: "#27c149",
// color: '#fff'
},
on: {
click: () => {
this.speed(params.row);
},
},
},
{
key: "actualFinishDate",
title: this.l("actualFinishDate"),
align: "center",
high: true,
width: 150,
render: (h, params) => {
return h(
"span",
// this.sliceStr(params.row.actualFinishDate + ' ', 0, 10),
params.row.actualFinishDate == "0001-01-01 00:00:00" ?
"" :
params.row.actualFinishDate
);
},
params.row.finishCount //完成数
),
]
),
]);
},
},
{
key: "remark",
title: this.l("remark"),
align: "center",
hide: true,
},
{
title: "暂停记录",
key: "zanting",
width: 100,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
},
{
attrs: { oprate: "record", class: "edit" },
on: { click: () => this.record(params.row.id) },
key: "routingType",
title: this.l("routingType"),
align: "center",
code: "mes_xingchi_plan.order_material.routingType",
easy: true,
high: true,
width: 100,
},
"暂停记录"
),
]);
},
},
{
title: "操作",
key: "caozuo",
width: 100,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
(params.row.status == 5 && params.row.upSplitId == 0) ||
(params.row.status == 5 &&
params.row.upSplitId > 0 &&
params.row.splitCardStatus == 1)
? "Button"
: "", //订单状态暂停,启动
{
props: {
type: "error",
size: "small",
icon: "md-play",
ghost: true,
},
style: {
fontSize: "18px",
width: "50px",
height: "25px",
paddingTop: "0",
},
on: {
click: () => {
this.start(params.row);
title: this.l("jindu"),
key: "action",
width: 200,
align: "center",
render: (h, params) => {
return h("div", [
h(
"ButtonGroup", {
props: {
shape: "circle",
},
},
[
h(
"Button", {
style: {
background: "#e4e6ed ",
borderColor: "#e4e6ed ",
},
on: {
click: () => {
this.speed(params.row);
},
},
},
params.row.unstartCount //未开工数
),
h(
"Button", {
style: {
background: "#ffc000",
borderColor: "#ffc000",
},
on: {
click: () => {
this.speed(params.row);
},
},
},
params.row.startCount //开工数
),
h(
"Button",
{
style: {
background: "#ff7a8b",
borderColor: "#ff7a8b",
},
on: {
click: () => {
this.speed(params.row);
},
},
},
params.row.stopCount //暂停数
),
h(
"Button", {
style: {
background: "#27c149",
borderColor: "#27c149",
// color: '#fff'
},
on: {
click: () => {
this.speed(params.row);
},
},
},
params.row.finishCount //完成数
),
]
),
]);
},
},
},
""
),
h(
params.row.status == 6 ? "Button" : "", //订单状态执行中,暂停
{
props: {
type: "success",
size: "small",
icon: "ios-pause",
ghost: true,
tooltip: "暂停",
},
style: {
fontSize: "18px",
width: "50px",
height: "25px",
paddingTop: "0",
},
on: {
click: () => {
this.suspend(params.row);
key: "remark",
title: this.l("remark"),
align: "center",
hide: true,
},
{
title: "暂停记录",
key: "zanting",
width: 100,
align: "center",
render: (h, params) => {
return h("div", {
class: "action"
}, [
h(
"op", {
attrs: {
oprate: "record",
class: "edit"
},
on: {
click: () => this.record(params.row.id)
},
},
"暂停记录"
),
]);
},
},
},
""
),
h(
params.row.status == 5 && params.row.splitCardStatus == 0
? "op"
: "", //订单状态执行中,暂停
{
attrs: {
icon: "md-sync",
type: "icon",
title: "回收订单",
oprate: "edit",
msg: "确认要恢复工序吗?",
},
on: {
click: () => {
this.recycle(params.row);
title: "操作",
key: "caozuo",
width: 100,
align: "center",
render: (h, params) => {
return h("div", {
class: "action"
}, [
h(
(params.row.status == 5 && params.row.upSplitId == 0) ||
(params.row.status == 5 &&
params.row.upSplitId > 0 &&
params.row.splitCardStatus == 1) ?
"Button" :
"", //订单状态暂停,启动
{
props: {
type: "error",
size: "small",
icon: "md-play",
ghost: true,
},
style: {
fontSize: "18px",
width: "50px",
height: "25px",
paddingTop: "0",
},
on: {
click: () => {
this.start(params.row);
},
},
},
""
),
h(
params.row.status == 6 ? "Button" : "", //订单状态执行中,暂停
{
props: {
type: "success",
size: "small",
icon: "ios-pause",
ghost: true,
tooltip: "暂停",
},
style: {
fontSize: "18px",
width: "50px",
height: "25px",
paddingTop: "0",
},
on: {
click: () => {
this.suspend(params.row);
},
},
},
""
),
h(
params.row.status == 5 && params.row.splitCardStatus == 0 ?
"op" :
"", //订单状态执行中,暂停
{
attrs: {
icon: "md-sync",
type: "icon",
title: "回收订单",
oprate: "edit",
msg: "确认要恢复工序吗?",
},
on: {
click: () => {
this.recycle(params.row);
},
},
}
),
]);
},
},
}
),
]);
},
},
],
loading: false,
recovery: {
orderId: null,
demandFinishDate: "", //计划完成时间
},
mesCode: "",
rulesRecycle: {
demandFinishDate: [
{
required: true,
message: "请选择计划完成时间",
trigger: "change",
type: "date",
},
],
},
};
},
mounted() {},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
search() {
this.$refs.grid.reload(this.easySearch);
},
record(id) {
this.recordModal = true;
this.recordId = id;
},
speed(row) {
if (
row.finishCount == 0 &&
row.stopCount == 0 &&
row.startCount == 0 &&
row.unstartCount == 0
) {
this.$Message.error("进度数据错误");
} else {
this.result = [];
this.loading = true;
this.SpeedModal = true;
this.dispatchExecuteId = row.dispatchExecuteId;
this.orderId = row.id;
Api.info({
routingHeaderId: row.routingHeaderId,
dispatchExecuteId: row.dispatchExecuteId,
})
.then((r) => {
if (r.success) {
this.result = r.result;
this.loading = false;
}
})
.catch((err) => {
this.$Message.error("连接错误");
});
}
},
],
loading: false,
recovery: {
orderId: null,
demandFinishDate: "", //计划完成时间
},
mesCode: "",
rulesRecycle: {
demandFinishDate: [{
required: true,
message: "请选择计划完成时间",
trigger: "change",
type: "date",
}, ],
},
};
},
suspendOk() {
this.suspendModal = false;
this.$refs.grid.load();
// this.curId = 0
mounted() {},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
start(row) {
this.laster = this.$store.state.userInfo.login_id;
this.$Modal.confirm({
title: "提示",
content: "<p>确定要启动,是否继续?</p>",
onOk: () => {
Api.start({
id: row.id,
status: 6,
laster: this.laster,
}).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("启动成功");
methods: {
search() {
this.$refs.grid.reload(this.easySearch);
},
record(id) {
this.recordModal = true;
this.recordId = id;
},
speed(row) {
if (
row.finishCount == 0 &&
row.stopCount == 0 &&
row.startCount == 0 &&
row.unstartCount == 0
) {
this.$Message.error("进度数据错误");
} else {
this.result = [];
this.loading = true;
this.SpeedModal = true;
this.dispatchExecuteId = row.dispatchExecuteId;
this.orderId = row.id;
Api.info({
routingHeaderId: row.routingHeaderId,
dispatchExecuteId: row.dispatchExecuteId,
})
.then((r) => {
if (r.success) {
this.result = r.result;
this.loading = false;
}
})
.catch((err) => {
this.$Message.error("连接错误");
});
}
});
// this.suspendModal = true
// this.curId = id
},
onCancel: () => {
this.$Message.info("已取消");
suspendOk() {
this.suspendModal = false;
this.$refs.grid.load();
// this.curId = 0
},
start(row) {
this.laster = this.$store.state.userInfo.login_id;
this.$Modal.confirm({
title: "提示",
content: "<p>确定要启动,是否继续?</p>",
onOk: () => {
Api.start({
id: row.id,
status: 6,
laster: this.laster,
}).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("启动成功");
}
});
// this.suspendModal = true
// this.curId = id
},
onCancel: () => {
this.$Message.info("已取消");
},
});
},
clsoeSpeedModal() {
this.SpeedModal = false;
},
suspend(row) {
console.log(row);
this.suspendModal = true;
this.rowSuspend = row;
this.$refs.addBug.getEid();
},
});
},
clsoeSpeedModal() {
this.SpeedModal = false;
},
suspend(row) {
console.log(row);
this.suspendModal = true;
this.rowSuspend = row;
this.$refs.addBug.getEid();
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
this.$Message.success("删除成功");
}
});
},
recycle(row) {
//回收订单
this.recycleModal = true;
this.mesCode = row.mesCode;
this.recovery = {
orderId: row.id,
demandFinishDate: row.demandFinishDate,
};
},
changeFinishiDate() {
let temTime = this.recovery.demandFinishDate;
this.recovery.demandFinishDate = "";
this.recovery.demandFinishDate = this.getFormatDateEnd(temTime);
Api.orderrecovery(this.recovery)
.then((res) => {
if (res.success) {
this.$Message.success("回收成功");
this.$refs.grid.reload(this.easySearch);
removeOk() {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
this.$Message.success("删除成功");
}
});
},
recycle(row) {
//回收订单
this.recycleModal = true;
this.mesCode = row.mesCode;
this.recovery = {
orderId: row.id,
demandFinishDate: row.demandFinishDate,
};
},
changeFinishiDate() {
let temTime = this.recovery.demandFinishDate;
this.recovery.demandFinishDate = "";
this.recovery.demandFinishDate = this.getFormatDateEnd(temTime);
Api.orderrecovery(this.recovery)
.then((res) => {
if (res.success) {
this.$Message.success("回收成功");
this.$refs.grid.reload(this.easySearch);
this.recycleModal = false;
}
})
.catch((err) => {
this.$Message.error("数据连接错误");
});
},
cancelRecycle() {
this.mesCode = "";
this.recovery = {
orderId: null,
demandFinishDate: "", //计划完成时间
};
this.recycleModal = false;
}
})
.catch((err) => {
this.$Message.error("数据连接错误");
});
},
cancelRecycle() {
this.mesCode = "";
this.recovery = {
orderId: null,
demandFinishDate: "", //计划完成时间
};
this.recycleModal = false;
},
getFinishedDate(value) {
this.recovery.demandFinishDate = value;
},
getFormatDateEnd(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 23:59:59";
return resDate;
},
//截取字符串
sliceStr(str, lenS, lenE) {
return str.slice(lenS, lenE);
},
cancel() {
this.curId = 0;
this.suspendModal = false;
},
p(s) {
return Number(s) < 10 ? "0" + s : s;
},
l(key) {
let vkey = "mes_order_watch" + "." + key;
return this.$t(vkey) || key;
},
getFinishedDate(value) {
this.recovery.demandFinishDate = value;
},
getFormatDateEnd(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 23:59:59";
return resDate;
},
//截取字符串
sliceStr(str, lenS, lenE) {
return str.slice(lenS, lenE);
},
cancel() {
this.curId = 0;
this.suspendModal = false;
},
p(s) {
return Number(s) < 10 ? "0" + s : s;
},
l(key) {
let vkey = "mes_order_watch" + "." + key;
return this.$t(vkey) || key;
},
},
},
};
</script>
<style lang="less">
.ivu-btn-group > .ivu-btn {
height: 21px !important;
.ivu-btn-group>.ivu-btn {
height: 21px !important;
}
.ivu-btn-group {
height: 21px !important;
height: 21px !important;
}
</style>
\ No newline at end of file
</style>
......@@ -102,10 +102,10 @@ export default {
op: "mesCode,productName,drawnNumber",
value: null,
},
// status: {
// op: "In",
// value: [12, 14, 5, 7, -1]
// }
DispatchStatus: {
op: "In",
value: [12, 14, 5, 7, -1]
}
},
downUrl: fileUrlDown,
columns: [{
......
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