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

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

parents 5bc047d5 8da78f1e
...@@ -6,22 +6,26 @@ ...@@ -6,22 +6,26 @@
<div> <div>
<TimelineItem v-for="(item, index) in dataImmut" :key="index"> <TimelineItem v-for="(item, index) in dataImmut" :key="index">
<Badge :count="index + 1" slot="dot" :type="index==cur?'primary':'normal'"></Badge> <Badge :count="index + 1" slot="dot" :type="index==cur?'primary':'normal'"></Badge>
<p class="time">{{ item.name }} <p class="time">
&nbsp;(<state code="workflow.form.audit.type" :value="item.operation" />) {{ item.name }}
<Icon v-if="item.isFixed" type="ios-lock"/> &nbsp;(
<state code="workflow.form.audit.type" :value="item.operation" />)
<Icon v-if="item.isFixed" type="ios-lock" />
</p> </p>
<p class="content" v-if="index==0"> <p class="content" v-if="index==0">
发起人: <User :value="currentUserId" /> 发起人:
<User :value="currentUserId" />
</p> </p>
<p class="content" v-else> <p class="content" v-else>
<span>审批人:</span> <span>审批人:</span>
<CheckboxGroup v-model="item.userIds" @on-change="userIds"> <CheckboxGroup v-model="item.userIds" @on-change="userIds">
<Checkbox v-for="(item1, index1) in item.defaultUsers.immutable" <Checkbox
:key="index1" :label="item1" :disabled="item.isFixed"> v-for="(item1, index1) in item.defaultUsers.immutable"
<User :key="index1"
:value="item1" :label="item1"
style="margin-right:5px;" :disabled="item.isFixed"
/> >
<User :value="item1" style="margin-right:5px;" />
</Checkbox> </Checkbox>
</CheckboxGroup> </CheckboxGroup>
</p> </p>
...@@ -31,7 +35,7 @@ ...@@ -31,7 +35,7 @@
:value="item1" :value="item1"
style="margin-right:5px;" style="margin-right:5px;"
/> />
</p> --> </p>-->
</TimelineItem> </TimelineItem>
</div> </div>
</Timeline> </Timeline>
...@@ -39,81 +43,99 @@ ...@@ -39,81 +43,99 @@
</template> </template>
<script> <script>
export default { export default {
name: 'process', name: "process",
components: {}, components: {},
data() { data() {
return { return {
currentUserId: 0, currentUserId: 0,
processTitle: '审批流程', processTitle: "审批流程",
dataImmut: [], dataImmut: [],
dataMut: [], dataMut: [],
cur:0, cur: 0,
immutData: [], immutData: [],
ids:[], ids: [],
schemaId: '' schemaId: ""
} };
}, },
props: { props: {
schemaIdVal: { schemaIdVal: {
type: String, type: String,
default: '' default: ""
} }
}, },
created() { created() {
this.currentUserId=this.$store.state.userInfo.userId this.currentUserId = this.$store.state.userInfo.userId;
this.load(this.schemaIdVal) this.load(this.schemaIdVal);
}, },
methods: { methods: {
load(v) { load(v) {
this.dataImmut = [] this.dataImmut = [];
this.dataMut = [] this.dataMut = [];
let url = `${workflowUrl}/schema/intend` //判断流程是否启用
let params = {
this.$api.get(url, { schemaId: v }).then((r) => { id: v
};
this.$api.get(`${workflowUrl}/schema/getbyid`, params).then(res => {
if (res.success) {
let wfStatus = res.result.status;
if (wfStatus == 0) {
//启用
let url = `${workflowUrl}/schema/intend`;
this.$api.get(url, { schemaId: v }).then(r => {
if (r.success) { if (r.success) {
// console.warn("VVVV",r) // console.warn("VVVV",r)
r.result.nodes.map((u,i)=>{ r.result.nodes.map((u, i) => {
if(i>0){ if (i > 0) {
let ids=u.defaultUsers.immutable.concat(u.defaultUsers.mutable) let ids = u.defaultUsers.immutable.concat(
u.defaultUsers.immutable=ids; u.defaultUsers.mutable
u.userIds=this.$u.clone(ids); );
}else{ u.defaultUsers.immutable = ids;
u.userIds=[this.currentUserId] u.userIds = this.$u.clone(ids);
} else {
u.userIds = [this.currentUserId];
} }
}) });
this.dataImmut = r.result.nodes this.dataImmut = r.result.nodes;
this.processTitle = r.result.name this.processTitle = r.result.name;
// if (this.dataImmut.length >= 1) { // if (this.dataImmut.length >= 1) {
// this.immutData = this.dataImmut[1].defaultUsers.immutable // this.immutData = this.dataImmut[1].defaultUsers.immutable
// } // }
this.userIds(); this.userIds();
} }
}) });
}
// else {
// this.$Message.error("流程未启用");
// }
} else {
this.$Message.error("操作失败");
}
});
}, },
userIds(){ userIds() {
var ids=[]; var ids = [];
this.dataImmut.map((u,i)=>{ this.dataImmut.map((u, i) => {
ids.push({ ids.push({
id:u.id, id: u.id,
userIds:u.userIds userIds: u.userIds
}) });
}) });
this.immutData=ids; this.immutData = ids;
// console.warn(ids); // console.warn(ids);
}, },
l(key) { l(key) {
key = 'orderInfo' + '.' + key key = "orderInfo" + "." + key;
return this.$t(key) return this.$t(key);
} }
}, },
computed: {}, computed: {},
watch: { watch: {
schemaIdVal(v) { schemaIdVal(v) {
if (v) { if (v) {
this.load(v) this.load(v);
} }
} }
} }
} };
</script> </script>
<style scoped></style> <style scoped></style>
<template> <template>
<div style="padding: 0;" class="excute"> <div style="padding: 0;" class="excute">
<DataGrid <DataGrid
style="margin-top:2px; margin-bottom: -20px;" style="margin-top:2px; margin-bottom: -5px;"
:columns="columns" :columns="columns"
ref="grid" ref="grid"
:easy="false" :easy="false"
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
:set="false" :set="false"
:border="false" :border="false"
:data="data1" :data="data1"
:page="false"
:height="gridHeight" :height="gridHeight"
:page="false"
:size="size" :size="size"
></DataGrid> ></DataGrid>
<Modal v-model="editModal" title="编辑" footer-hide width="800"> <Modal v-model="editModal" title="编辑" footer-hide width="800">
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
insertlModal: false, insertlModal: false,
rowIndex: null, rowIndex: null,
curId: 0, curId: 0,
gridHeight: 50, gridHeight: 150,
size: "small", size: "small",
columns: [ columns: [
{ title: " ", width: 130 }, { title: " ", width: 130 },
......
...@@ -28,7 +28,11 @@ ...@@ -28,7 +28,11 @@
<Icon type="md-git-compare" /> <Icon type="md-git-compare" />
</a> </a>
<DropdownMenu slot="list" style="text-align: center;"> <DropdownMenu slot="list" style="text-align: center;">
<DropdownItem v-for="li in items" :key="li.value" v-dragging="{ item: li, list: items}"> <DropdownItem
v-for="li in items"
:key="li.value"
v-dragging="{ item: li, list: items}"
>
<a href="#"> <a href="#">
<Icon type="md-apps" /> <Icon type="md-apps" />
</a> </a>
...@@ -145,7 +149,12 @@ import Api from "./api"; ...@@ -145,7 +149,12 @@ import Api from "./api";
export default { export default {
data() { data() {
return { return {
items:[{name:"是否多台",value:"multiple"},{name:"转序规则",value:"planState"},{name:"加班策略",value:"over"},{name:"是否离散",value:"dis"}], items: [
{ name: "是否多台", value: "multiple" },
{ name: "转序规则", value: "planState" },
{ name: "加班策略", value: "over" },
{ name: "是否离散", value: "dis" }
],
entity: { entity: {
partTaskPk: 0, partTaskPk: 0,
opTaskPk: 0, opTaskPk: 0,
...@@ -158,10 +167,10 @@ export default { ...@@ -158,10 +167,10 @@ export default {
overTime: "不加班", //"六日加班", 不加班 加班 overTime: "不加班", //"六日加班", 不加班 加班
efficiencyValue: 11, // 效率系数, 必须大于 0 efficiencyValue: 11, // 效率系数, 必须大于 0
shopId: -1, shopId: -1,
dis:false, dis: false,
isDiscrete: "否",//是否离散 是否 isDiscrete: "否", //是否离散 是否
discrete: 1, //离散数值 必须大于 1 discrete: 1, //离散数值 必须大于 1
discrete_percent:0, discrete_percent: 0,
multiple: false, multiple: false,
multipleEquip: "否", //"是否多台安排设备", 否 是 multipleEquip: "否", //"是否多台安排设备", 否 是
multipleCount: 1, //多台数量 multipleCount: 1, //多台数量
...@@ -235,12 +244,12 @@ export default { ...@@ -235,12 +244,12 @@ export default {
this.apsGet(); //获取参数级别和转序等的关系 this.apsGet(); //获取参数级别和转序等的关系
}, },
mounted() { mounted() {
this.$dragging.$on('dragged', ({ value }) => { this.$dragging.$on("dragged", ({ value }) => {
localStorage.setItem("apsitems",JSON.stringify(value.list)); localStorage.setItem("apsitems", JSON.stringify(value.list));
}) });
var items=localStorage.getItem("apsitems"); var items = localStorage.getItem("apsitems");
if(items){ if (items) {
this.items=JSON.parse(items); this.items = JSON.parse(items);
} }
}, },
methods: { methods: {
...@@ -264,12 +273,12 @@ export default { ...@@ -264,12 +273,12 @@ export default {
}); });
}, },
setParameter(v) { setParameter(v) {
this.entity.multiple=false; this.entity.multiple = false;
this.entity.planState=false; this.entity.planState = false;
this.entity.over=false; this.entity.over = false;
this.entity.dis=false; this.entity.dis = false;
for(var i=0;i<v;i++){ for (var i = 0; i < v; i++) {
this.entity[this.items[i].value]=true; this.entity[this.items[i].value] = true;
} }
}, },
handleSubmit() { handleSubmit() {
...@@ -284,7 +293,7 @@ export default { ...@@ -284,7 +293,7 @@ export default {
this.entity.flog = 1; this.entity.flog = 1;
return; return;
} }
if(this.entity.multipleEquipPks){ if (this.entity.multipleEquipPks) {
this.entity.multipleEquipIds = this.entity.multipleEquipPks.join(); this.entity.multipleEquipIds = this.entity.multipleEquipPks.join();
} }
// //
...@@ -314,13 +323,14 @@ export default { ...@@ -314,13 +323,14 @@ export default {
let vkey = "mes_op_task_plan_simulate" + "." + key; let vkey = "mes_op_task_plan_simulate" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
}, },
setPercent(v){ setPercent(v) {
this.entity.discrete=Math.round(((this.count-1)*v-this.count)/100); this.entity.discrete = Math.round(
}, ((this.count - 1) * v - this.count) / 100
setDiscrete(v){
this.entity.discrete_percent=(
(100 * this.count - 100 * this.entity.discrete) / (this.count - 1)
); );
},
setDiscrete(v) {
this.entity.discrete_percent =
(100 * this.count - 100 * this.entity.discrete) / (this.count - 1);
} }
}, },
computed: { computed: {
...@@ -346,36 +356,38 @@ export default { ...@@ -346,36 +356,38 @@ export default {
}, },
opTaskPk(v, n) { opTaskPk(v, n) {
this.entity.opTaskPk = v; this.entity.opTaskPk = v;
if(v>0){ if (v > 0) {
console.log("detail",this.row); console.log("detail", this.row);
let entity={ let entity = {
partTaskPk: this.row.part_task_pk, partTaskPk: this.row.part_task_pk,
opTaskPk: this.row.op_task_pk, opTaskPk: this.row.op_task_pk,
taskSeq: this.row.task_seq, taskSeq: this.row.task_seq,
flog: 0, //参数应用范围 flog: 0, //参数应用范围
calId: -1, calId: parseInt(this.row.cal_id),
planState: this.row.plan_method=="平行", planState: this.row.plan_method == "平行",
planMethod: this.row.plan_method, // 平行 重叠 planMethod: this.row.plan_method, // 平行 重叠
over: this.row.over_time=="加班", over: this.row.over_time == "加班",
overTime: this.row.over_time, //"六日加班", 不加班 加班 overTime: this.row.over_time, //"六日加班", 不加班 加班
efficiencyValue:this.row.efficiency_value|1, // 效率系数, 必须大于 0 efficiencyValue: this.row.efficiency_value | 1, // 效率系数, 必须大于 0
shopId: -1, shopId: -1,
isDiscrete: this.row.isdiscrete=="是", dis: this.row.isdiscrete == "是",
discrete: this.row.discrete_value|1, //离散数值 必须大于 1 isDiscrete: this.row.isdiscrete ? "是" : "否", //是否离散 是否
multiple: this.row.multi_machine=="是", discrete: this.row.discrete_value | 1, //离散数值 必须大于 1
multipleEquip: this.row.multi_machine|"否", //"是否多台安排设备", 否 是 multiple: this.row.multi_machine == "是",
multipleEquip: this.row.multi_machine | "否", //"是否多台安排设备", 否 是
multipleCount: 1, //多台数量 multipleCount: 1, //多台数量
multipleEquipPks: [], multipleEquipPks: [],
multipleEquipIds: "", //"设备id", 用英文逗号分隔 multipleEquipIds: "" //"设备id", 用英文逗号分隔
} };
this.entity=entity this.entity = entity;
console.warn("detail", this.entity, this.row);
} }
this.entity.taskSeq = this.taskSeq; this.entity.taskSeq = this.taskSeq;
}, },
count(v, n) { count(v, n) {
this.entity.discrete = 1; this.entity.discrete = 1;
}, }
} }
}; };
</script> </script>
......
<template> <template>
<div> <div>
<div id="myChart" style="width:380px;height:300px;margin:0 auto;top: 0px;"></div> <div id="myChart" style="width:380px;height:400px;margin:0 auto;top: 30px;"></div>
</div> </div>
</template> </template>
<script> <script>
......
...@@ -118,9 +118,7 @@ export default { ...@@ -118,9 +118,7 @@ export default {
} }
}, },
downUrl: fileUrlDown, downUrl: fileUrlDown,
columns: { columns: [],
count:7,
},
comondata:[ comondata:[
{ {
productName: "受电弓", productName: "受电弓",
......
.new_body{
&{
background: #fff;
}
}
.set_card{ .set_card{
padding: 12px 30px 0; padding: 12px 30px 0;
.set_card_box{ .set_card_box{
...@@ -18,6 +23,7 @@ ...@@ -18,6 +23,7 @@
width: 150px; width: 150px;
height: 120px; height: 120px;
text-align: center; text-align: center;
margin: 0 auto;
} }
.statu_box{ .statu_box{
line-height: 30px; line-height: 30px;
...@@ -32,11 +38,11 @@ ...@@ -32,11 +38,11 @@
margin: 0 10px 0 0; margin: 0 10px 0 0;
} }
.set_masage{ .set_masage{
min-height: 125px; height: 125px;
line-height: 25px; line-height: 25px;
.time_bg{ .time_bg{
background: #267feb49; background: #267feb49;
line-height: 34px; margin: 0 auto;
width: 160px; width: 160px;
text-align: center; text-align: center;
border-radius: 3px; border-radius: 3px;
...@@ -44,8 +50,13 @@ ...@@ -44,8 +50,13 @@
} }
.set_masage02{ .set_masage02{
line-height: 35px; line-height: 35px;
height: 144px;
text-align: center;
} }
} }
.echarts02{
height: 462px;
}
} }
} }
#echarts{ #echarts{
...@@ -58,7 +69,7 @@ ...@@ -58,7 +69,7 @@
.tips_item{ .tips_item{
background: #eff1f7; background: #eff1f7;
margin: 20px; margin: 20px;
line-height: 38px; line-height: 58px;
padding: 0 20px; padding: 0 20px;
.item_top{ .item_top{
border-bottom: 1px solid #b1b1b1; border-bottom: 1px solid #b1b1b1;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
@import "./mnc.less"; @import "./mnc.less";
</style> </style>
<template> <template>
<div> <div class="new_body">
<a class="back_href" @click="goView"> <a class="back_href" @click="goView">
<Icon type="ios-undo-outline" size="24" />返回设备监控 <Icon type="ios-undo-outline" size="24" />返回设备监控
</a> </a>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<p class="set_top">设备状态</p> <p class="set_top">设备状态</p>
<div class="set_card_body"> <div class="set_card_body">
<Row> <Row>
<Col span="9"> <Col span="24">
<div class="set_img statu_box"> <div class="set_img statu_box">
<img v-if="formData.statu=='关机'" src="../image/guan.png" alt=""> <img v-if="formData.statu=='关机'" src="../image/guan.png" alt="">
<img v-else-if="formData.statu=='空闲'" src="../image/kong.png" alt=""> <img v-else-if="formData.statu=='空闲'" src="../image/kong.png" alt="">
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<p>{{formData.statu}}</p> <p>{{formData.statu}}</p>
</div> </div>
</Col> </Col>
<Col span="15"> <Col span="24">
<div class="set_masage set_masage02"> <div class="set_masage set_masage02">
<p>当前状态开始时间:</p> <p>当前状态开始时间:</p>
<p class="time_bg">11:45:05</p> <p class="time_bg">11:45:05</p>
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
</div> </div>
<div class="set_card_box"> <div class="set_card_box">
<p class="set_top">加工状态统计</p> <p class="set_top">加工状态统计</p>
<div class="center"> <div class="center echarts02">
<Echart2 ></Echart2> <Echart2 ></Echart2>
</div> </div>
</div> </div>
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
<p>当前刀具名称:<span class="item_right"> GD236689 </span></p> <p>当前刀具名称:<span class="item_right"> GD236689 </span></p>
<p>当前刀库号: <span class="item_right"> 1213 </span></p> <p>当前刀库号: <span class="item_right"> 1213 </span></p>
<p>刀具已使用工时: <span class="item_right"> 10 </span></p> <p>刀具已使用工时: <span class="item_right"> 10 </span></p>
<p>刀补值: <span class="item_right"> 20 </span>-</p> <p>刀补值: <span class="item_right"> -20 </span></p>
<p>刀补地址: <span class="item_right"> D1 </span></p> <p>刀补地址: <span class="item_right"> D1 </span></p>
<p>扭矩: <span class="item_right"> 200 </span></p> <p>扭矩: <span class="item_right"> 200 </span></p>
</div> </div>
......
...@@ -171,10 +171,25 @@ export default { ...@@ -171,10 +171,25 @@ export default {
} }
] ]
}, },
disabled: false disabled: false,
wfstatu: 1
}; };
}, },
mounted() { mounted() {
let params = {
id: "123327da-42b3-41f6-b785-cf933f137a95"
};
this.$api.get(`${workflowUrl}/schema/getbyid`, params).then(res => {
if (res.success) {
let wfStatus = res.result.status;
if (wfStatus == 0) {
this.wfstatu = 1;
} else {
this.wfstatu = 3;
}
}
});
this.loadTree(); this.loadTree();
}, },
methods: { methods: {
...@@ -182,7 +197,7 @@ export default { ...@@ -182,7 +197,7 @@ export default {
this.$refs.formValidate.validate(v => { this.$refs.formValidate.validate(v => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
this.orderSearchForm.status = 1; this.orderSearchForm.status = this.wfstatu;
Api.mesplancreate(this.orderSearchForm) Api.mesplancreate(this.orderSearchForm)
.then(r => { .then(r => {
this.disabled = false; this.disabled = false;
......
...@@ -147,7 +147,8 @@ export default { ...@@ -147,7 +147,8 @@ export default {
}, },
placeholdeinfo: "", placeholdeinfo: "",
list: [], list: [],
data1: [] data1: [],
wfstatu: 1
}; };
}, },
props: { props: {
...@@ -159,6 +160,19 @@ export default { ...@@ -159,6 +160,19 @@ export default {
} }
}, },
mounted() { mounted() {
let params = {
id: "123327da-42b3-41f6-b785-cf933f137a95"
};
this.$api.get(`${workflowUrl}/schema/getbyid`, params).then(res => {
if (res.success) {
let wfStatus = res.result.status;
if (wfStatus == 0) {
this.wfstatu = 1;
} else {
this.wfstatu = 3;
}
}
});
this.loadTree(); this.loadTree();
}, },
methods: { methods: {
...@@ -172,7 +186,7 @@ export default { ...@@ -172,7 +186,7 @@ export default {
this.$refs.formValidate.validate(v => { this.$refs.formValidate.validate(v => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
this.orderSearchForm.status = 1; this.orderSearchForm.status = this.wfstatu;
Api.mesorderupdate(this.orderSearchForm) Api.mesorderupdate(this.orderSearchForm)
.then(r => { .then(r => {
this.disabled = false; this.disabled = false;
......
...@@ -51,6 +51,12 @@ ...@@ -51,6 +51,12 @@
<Button type="primary" @click="addModal=true">创建</Button> <Button type="primary" @click="addModal=true">创建</Button>
</template> </template>
<template slot="batch"> <template slot="batch">
<Button
type="primary"
class="mr10 ml10"
@click="openSendViewModal"
v-if="this.wfstatu==1"
>订单送审</Button>
<Button type="primary" class="mr10 ml10" @click="openSendModal">订单派发</Button> <Button type="primary" class="mr10 ml10" @click="openSendModal">订单派发</Button>
<Button type="primary" class="mr10 ml10" @click="removeList">批量删除</Button> <Button type="primary" class="mr10 ml10" @click="removeList">批量删除</Button>
</template> </template>
...@@ -71,6 +77,13 @@ ...@@ -71,6 +77,13 @@
<Button type="primary" @click="orderSplitOk">确定分解</Button> <Button type="primary" @click="orderSplitOk">确定分解</Button>
</div> </div>
</Modal> </Modal>
<Modal v-model="sendViewModal" title="订单送审" width="1200">
<SendView :row="rowDataArry" ref="orderSendView" />
<div slot="footer">
<Button @click="sendViewModal = false">取消</Button>
<Button type="primary" @click="sendViewOk">确定送审</Button>
</div>
</Modal>
<Modal v-model="sendModal" title="订单派发" width="1200"> <Modal v-model="sendModal" title="订单派发" width="1200">
<Send :row="rowDataArry" ref="orderSend" /> <Send :row="rowDataArry" ref="orderSend" />
<div slot="footer"> <div slot="footer">
...@@ -108,6 +121,7 @@ import Detail from "./detail"; ...@@ -108,6 +121,7 @@ import Detail from "./detail";
import Search from "./search"; import Search from "./search";
import Split from "./split"; import Split from "./split";
import Send from "./send"; import Send from "./send";
import SendView from "./sendView";
import ProductTree from "@/components/page/productTree.vue"; import ProductTree from "@/components/page/productTree.vue";
export default { export default {
name: "list", name: "list",
...@@ -118,6 +132,7 @@ export default { ...@@ -118,6 +132,7 @@ export default {
Search, Search,
Split, Split,
Send, Send,
SendView,
ProductTree ProductTree
}, },
data() { data() {
...@@ -139,6 +154,7 @@ export default { ...@@ -139,6 +154,7 @@ export default {
splitModal: false, splitModal: false,
ModalInfo: false, ModalInfo: false,
sendModal: false, sendModal: false,
sendViewModal: false,
curId: 0, curId: 0,
id: "id", id: "id",
columns: [ columns: [
...@@ -328,7 +344,6 @@ export default { ...@@ -328,7 +344,6 @@ export default {
high: true, high: true,
width: 180 width: 180
}, },
{ {
title: "操作", title: "操作",
key: "action", key: "action",
...@@ -350,13 +365,21 @@ export default { ...@@ -350,13 +365,21 @@ export default {
attrs: { oprate: "edit" }, attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row) }, on: { click: () => this.edit(params.row) },
style: style:
(params.row.status == 1 && this.wfstatu == 1
? (params.row.status == 1 &&
params.row.id == params.row.rootId && params.row.id == params.row.rootId &&
params.row.divideMark != 0) || params.row.divideMark != 0) ||
params.row.id != params.row.rootId || params.row.id != params.row.rootId ||
params.row.status != 1 params.row.status != 1
? "display:none" ? "display:none"
: "" : ""
: (params.row.status == 3 &&
params.row.id == params.row.rootId &&
params.row.divideMark != 0) ||
params.row.id != params.row.rootId ||
params.row.status != 3
? "display:none"
: ""
}, },
"编辑" "编辑"
), ),
...@@ -366,12 +389,21 @@ export default { ...@@ -366,12 +389,21 @@ export default {
attrs: { oprate: "remove" }, attrs: { oprate: "remove" },
on: { click: () => this.remove(params.row) }, on: { click: () => this.remove(params.row) },
style: style:
(params.row.status == 1 && this.wfstatu == 1
? (params.row.status == 1 &&
params.row.id == params.row.rootId && params.row.id == params.row.rootId &&
params.row.divideMark != 0) || params.row.divideMark != 0) ||
params.row.id != params.row.rootId ||
params.row.status != 1 params.row.status != 1
? "display:none" ? "display:none"
: "" : ""
: (params.row.status == 3 &&
params.row.id == params.row.rootId &&
params.row.divideMark != 0) ||
params.row.id != params.row.rootId ||
params.row.status != 3
? "display:none"
: ""
}, },
"删除" "删除"
), ),
...@@ -381,12 +413,19 @@ export default { ...@@ -381,12 +413,19 @@ export default {
attrs: { oprate: "detail" }, attrs: { oprate: "detail" },
on: { click: () => this.split(params.row) }, on: { click: () => this.split(params.row) },
style: style:
(params.row.divideMark != 0 && this.wfstatu == 1
? (params.row.divideMark != 0 &&
params.row.id == params.row.rootId) || params.row.id == params.row.rootId) ||
params.row.status != 1 || params.row.status != 1 ||
params.row.quantity <= 1 params.row.quantity <= 1
? "display:none" ? "display:none"
: "" : ""
: (params.row.divideMark != 0 &&
params.row.id == params.row.rootId) ||
params.row.status != 3 ||
params.row.quantity <= 1
? "display:none"
: ""
}, },
"分解" "分解"
) )
...@@ -477,205 +516,7 @@ export default { ...@@ -477,205 +516,7 @@ export default {
list: [], list: [],
//data测试数据 //data测试数据
dataT: [], dataT: [],
dataTemp: [ dataTemp: [],
{
mesCode: "DDBH_20200414_32",
taskType: 2,
productId: 71,
quantity: 10,
remark: "5",
taskRequire: "4",
status: 1,
divideMark: 1,
productName: "铅笔",
drawnNumber: "qianbii11",
rootId: 0,
batchNumber: "5",
projectNumber: "5",
urgencyLevel: 2,
productingPreparationPeople: 0,
productingPreparationFinishDate: "0001-01-01 00:00:00",
quotationPeople: 0,
quotationFinishDate: "0001-01-01 00:00:00",
upId: 0,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_32",
creationTime: "2020-04-16 17:21:03",
id: 46
},
{
mesCode: "DDBH_20200414_3202",
taskType: 2,
productId: 71,
quantity: 6,
remark: "5",
taskRequire: "4",
status: 4,
divideMark: 0,
productCode: "No1~No6",
productName: "铅笔",
drawnNumber: "qianbii11",
rootId: 46,
batchNumber: "5",
projectNumber: "5",
urgencyLevel: 2,
productingPreparationPeople: 56,
productingPreparationFinishDate: "2020-04-17 23:59:59",
quotationPeople: 108,
quotationFinishDate: "2020-04-17 23:59:59",
upId: 46,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_32",
lastModificationTime: "2020-04-15 10:40:22",
lastModifierUserId: 1,
creationTime: "2020-04-14 17:32:13",
creatorUserId: 1,
id: 52
},
{
mesCode: "DDBH_20200414_320101",
taskType: 2,
productId: 71,
quantity: 3,
remark: "5",
taskRequire: "4",
status: 1,
divideMark: 0,
productName: "铅笔",
drawnNumber: "qianbii11",
rootId: 46,
batchNumber: "5",
projectNumber: "5",
urgencyLevel: 2,
productingPreparationPeople: 0,
productingPreparationFinishDate: "0001-01-01 00:00:00",
quotationPeople: 0,
quotationFinishDate: "0001-01-01 00:00:00",
upId: 51,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_32",
lastModificationTime: "2020-04-14 17:50:18",
lastModifierUserId: 1,
creationTime: "2020-04-14 17:32:13",
creatorUserId: 1,
id: 53
},
{
mesCode: "DDBH_20200414_320102",
taskType: 2,
productId: 71,
quantity: 1,
remark: "5",
taskRequire: "4",
status: 1,
divideMark: 0,
productName: "铅笔",
drawnNumber: "qianbii11",
rootId: 46,
batchNumber: "5",
projectNumber: "5",
urgencyLevel: 2,
productingPreparationPeople: 0,
productingPreparationFinishDate: "0001-01-01 00:00:00",
quotationPeople: 0,
quotationFinishDate: "0001-01-01 00:00:00",
upId: 51,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_32",
lastModificationTime: "2020-04-14 17:50:18",
lastModifierUserId: 1,
creationTime: "2020-04-14 17:32:13",
creatorUserId: 1,
id: 54
},
{
mesCode: "DDBH_20200414_31",
taskType: 2,
productId: 70,
quantity: 8,
remark: "5",
taskRequire: "4",
status: 4,
divideMark: 0,
productCode: "No1~No8",
productName: "口罩模具",
drawnNumber: "LXG_KZ_001",
rootId: 0,
batchNumber: "5",
projectNumber: "5",
urgencyLevel: 2,
productingPreparationPeople: 56,
productingPreparationFinishDate: "2020-04-16 23:59:59",
quotationPeople: 108,
quotationFinishDate: "2020-04-16 23:59:59",
upId: 0,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_31",
isDeleted: false,
creationTime: "2020-04-16 17:21:03",
id: 45
},
{
mesCode: "DDBH_20200414_30",
taskType: 2,
productId: 69,
quantity: 18,
remark: "5",
taskRequire: "4",
status: 4,
divideMark: 0,
productCode: "No1~No18",
productName: "护目镜",
drawnNumber: "LXG_HMJ_001",
rootId: 0,
batchNumber: "5",
projectNumber: "5",
urgencyLevel: 2,
productingPreparationPeople: 56,
productingPreparationFinishDate: "2020-04-16 23:59:59",
quotationPeople: 1,
quotationFinishDate: "2020-04-24 23:59:59",
upId: 0,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_30",
isDeleted: false,
creationTime: "2020-04-16 17:21:03",
id: 44
},
{
mesCode: "DDBH_20200414_28",
taskType: 1,
productId: 22,
quantity: 15,
remark: "rr",
taskRequire: "r",
status: 1,
divideMark: 0,
productName: "te",
drawnNumber: "te",
rootId: 0,
batchNumber: "r",
projectNumber: "rr",
urgencyLevel: 2,
productingPreparationPeople: 0,
productingPreparationFinishDate: "0001-01-01 00:00:00",
quotationPeople: 0,
quotationFinishDate: "0001-01-01 00:00:00",
upId: 0,
demandStartDate: "2020-04-14 00:00:01",
demandFinishDate: "2020-04-15 00:00:01",
rootCode: "DDBH_20200414_28",
isDeleted: false,
creationTime: "2020-04-16 17:21:03",
id: 42
}
],
data1: [], data1: [],
selectdata: [], selectdata: [],
//以下为手写死数据集: //以下为手写死数据集:
...@@ -700,7 +541,14 @@ export default { ...@@ -700,7 +541,14 @@ export default {
actMescodes: [], actMescodes: [],
delNum: 0, //判断是否可以进行修改 delNum: 0, //判断是否可以进行修改
arrayIds: [], //选择列表后的ids arrayIds: [], //选择列表后的ids
delMsg: "" //删除提示信息 delMsg: "", //删除提示信息
dataListRetrunNew: {
schemaId: "123327da-42b3-41f6-b785-cf933f137a95", //订单送审的schemaId
idList: [], //订单id List
codeList: [], //订单编号List
operatorIdList: [] //操作员id
}, //确定后返回数据
wfstatu: 1 //流程是否启用1 禁用 0启用
}; };
}, },
created() { created() {
...@@ -708,6 +556,20 @@ export default { ...@@ -708,6 +556,20 @@ export default {
}, },
mounted() { mounted() {
this.initTree(); this.initTree();
let params = {
id: "123327da-42b3-41f6-b785-cf933f137a95"
};
this.$api.get(`${workflowUrl}/schema/getbyid`, params).then(res => {
if (res.success) {
let wfStatus = res.result.status;
if (wfStatus == 0) {
this.wfstatu = 1;
} else {
this.wfstatu = 3;
}
}
});
//this.dataformat();//data传数据转为tree类型 //this.dataformat();//data传数据转为tree类型
this.tableHeight = window.innerHeight - 220; this.tableHeight = window.innerHeight - 220;
//this.$refs.CustomTable.getTableHeight(this.tableHeight); //this.$refs.CustomTable.getTableHeight(this.tableHeight);
...@@ -847,47 +709,53 @@ export default { ...@@ -847,47 +709,53 @@ export default {
}); });
this.splitModal = false; this.splitModal = false;
this.ModalInfo = false; this.ModalInfo = false;
//确定批量操作 },
// if (this.ModalInfoStaut == 'orderSendReview') { //打开送审modal
// this.$http.order.batchstart(this.dataListRetrun).then((res) => { openSendViewModal() {
// if (res.success) { this.actIds = [];
// this.$Message.success('订单送审成功!') this.delNum = 0;
// this.easySearch('') if (this.rowDataArry.length > 0) {
// } else { this.rowDataArry.forEach(data => {
// this.$Message.error('订单送审失败!') this.actIds.push(data.id);
// } if (data.status != 1) {
// }) //判断非新建状态的订单
// this.ModalOrderSendReview = false this.delNum += 1;
// } else if (this.ModalInfoStaut == 'delOrder') { }
// this.$http.order.delOrder(this.dataListRetrunParam).then((res) => { });
// if (res.result) { setTimeout(() => {
// this.$Message.success('删除成功!') if (this.delNum > 0) {
// this.easySearch('') this.$Message.error("所选的订单中有不可送审的订单!");
// } else { this.actIds = [];
// this.$Message.error('删除失败!') this.sendViewModal = false;
// } } else {
// this.$refs.createOrder.resetFields() this.sendViewModal = true;
// this.createShow = false }
// }) }, 400);
// } else if (this.ModalInfoStaut == 'orderSend') { } else {
// this.$http.order.orderSend(this.dataListRetrun).then((res) => { this.$Message.error("请选择订单");
// if (res.result) { }
// this.$Message.success('订单派发成功!') },
// this.easySearch('') //确定送审
// this.ModalOrderSend = false sendViewOk() {
// } else { this.dataListRetrunNew.idList = [];
// this.$Message.error('订单派发失败!') this.dataListRetrunNew.codeList = [];
// } this.dataListRetrunNew.operatorIdList = [];
// }) this.rowDataArry.forEach(item => {
// } else { this.dataListRetrunNew.idList.push(item.id);
// Api.mesorderdivide(this.dataListRetrun).then(res => { this.dataListRetrunNew.codeList.push(item.mesCode);
// if (res.result) { });
// this.$Message.success("订单分解成功!"); let ues = this.$refs.userProcess;
// } else { this.dataListRetrunNew.operatorIdList = this.$refs.orderSendView.getUsers();
// this.$Message.error("订单分解失败!"); //返回审批数据
// }
// }); this.$http.order.batchstart(this.dataListRetrunNew).then(res => {
//} if (res.success) {
this.$Message.success("订单送审成功!");
this.$refs.grid.load();
} else {
this.$Message.error("订单送审失败!");
}
});
}, },
//打开派发 //打开派发
openSendModal() { openSendModal() {
...@@ -896,7 +764,7 @@ export default { ...@@ -896,7 +764,7 @@ export default {
if (this.rowDataArry.length > 0) { if (this.rowDataArry.length > 0) {
this.rowDataArry.forEach(data => { this.rowDataArry.forEach(data => {
this.actIds.push(data.id); this.actIds.push(data.id);
if (data.status != 1) { if (data.status != 3) {
//判断非新建状态的订单 //判断非新建状态的订单
this.delNum += 1; this.delNum += 1;
} }
......
<template>
<div style="width:100%;margin:0 auto">
<Table border :columns="columns1" :data="dataList" class="tableCommon" :height="tbHeight"></Table>
<div style="width100%;margin:40px auto">
<Row>
<Process ref="userProcess" schemaIdVal="123327da-42b3-41f6-b785-cf933f137a95" />
</Row>
</div>
</div>
</template>
<script>
import Process from "@/components/orderOperator/process";
export default {
name: "sendView",
components: {
Process
},
data() {
return {
divHeight: "400px",
columns1: [
{
title: this.l("mesCode"),
key: "mesCode",
width: 180,
tooltip: true
},
{
title: this.l("productName"),
key: "productName",
tooltip: true
},
{
key: "drawnNumber",
title: this.l("drawnNumber"),
align: "center",
width: 140
},
{
title: this.l("projectNumber"),
key: "projectNumber",
width: 140
},
{
title: this.l("batchNumber"),
key: "batchNumber",
width: 120,
tooltip: true
},
{
title: this.l("quantity"),
key: "quantity",
align: "right",
width: 70
}
],
dataList: [],
row1: {},
dataListRetrun: [], //确定后返回数据
rowList: [],
row1: {},
tbHeight: 0,
};
},
props: {
row: {
type: Array,
default: () => {
return [];
}
}
},
methods: {
getUsers() {
let ues = this.$refs.userProcess;
return ues.immutData;
},
l(key) {
let vkey = "mes_plan" + "." + key;
return this.$t(vkey) || key;
}
},
created() {},
mounted() {},
watch: {
row(v) {
if (v != []) {
this.dataList = this.$u.clone(this.row);
this.row1 = this.dataList[0];
this.tbHeight = 0;
if (this.dataList.length > 3) {
this.tbHeight = 200;
}
}
}
}
};
</script>
\ No newline at end of file
...@@ -155,6 +155,7 @@ ...@@ -155,6 +155,7 @@
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import ApiWorkflow from "../workflow/process/api";
import iQuill from "@/components/quill"; import iQuill from "@/components/quill";
export default { export default {
name: "Add", name: "Add",
...@@ -172,7 +173,7 @@ export default { ...@@ -172,7 +173,7 @@ export default {
code: "", code: "",
productId: null, productId: null,
productName: "", productName: "",
productBomId:null, productBomId: null,
version: "", version: "",
author: null, author: null,
departmentId: null, departmentId: null,
...@@ -182,7 +183,7 @@ export default { ...@@ -182,7 +183,7 @@ export default {
upDetailId: null, upDetailId: null,
routingType: null, routingType: null,
status: 0, status: 0,
approvalStatus: 0, approvalStatus: 4,
remark: "", remark: "",
approvalStatusRemark: "", approvalStatusRemark: "",
auditUserId1: "", auditUserId1: "",
...@@ -243,6 +244,17 @@ export default { ...@@ -243,6 +244,17 @@ export default {
} else { } else {
this.entity.fileId = ""; this.entity.fileId = "";
} }
ApiWorkflow.getbyid({
id: "2085025d-9c38-4834-846a-8f9d2f4c8553"
})
.then(res => {
if (res.success) {
let wfStatus = res.result.status;
if (wfStatus == 0) {
this.entity.approvalStatus = 4;
} else {
this.entity.approvalStatus = 1;
}
Api.create(this.entity) Api.create(this.entity)
.then(r => { .then(r => {
this.disabled = false; this.disabled = false;
...@@ -259,6 +271,13 @@ export default { ...@@ -259,6 +271,13 @@ export default {
console.warn(err); console.warn(err);
}); });
} }
})
.catch(err => {
this.disabled = false;
this.$Message.error("操作失败");
console.warn(err);
});
}
} }
}); });
}, },
......
...@@ -132,6 +132,7 @@ ...@@ -132,6 +132,7 @@
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import ApiWorkflow from "../../../workflow/process/api";
import iQuill from "@/components/quill"; import iQuill from "@/components/quill";
import changeSendReview from "./changeSendReview.vue"; import changeSendReview from "./changeSendReview.vue";
export default { export default {
...@@ -197,6 +198,27 @@ export default { ...@@ -197,6 +198,27 @@ export default {
.cathc(err => { .cathc(err => {
this.$Message.error("数据连接错误"); this.$Message.error("数据连接错误");
}); });
ApiWorkflow.getbyid({
id: "d0cdafe3-2341-4499-a4f5-278ef0f30740"
})
.then(res1 => {
alret(JSON.stringify(res1))
if (res1.success) {
let wfStatus = res1.result.status;
if (wfStatus == 0) {
this.submitShow = true;
// this.entity.approvalStatus = 4;
} else {
// this.entity.approvalStatus = 1;
this.submitShow = false;
}
}
})
.catch(err => {
this.$Message.error("操作失败");
console.warn(err);
});
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
...@@ -291,9 +313,8 @@ export default { ...@@ -291,9 +313,8 @@ export default {
this.entity.departmentId = v; this.entity.departmentId = v;
this.entity.departmentName = items.name; this.entity.departmentName = items.name;
}, },
ok() ok() {
{ this.$emit("on-ok");
this.$emit("on-ok")
}, },
l(key) { l(key) {
key = "routing_header_changeorder" + "." + key; key = "routing_header_changeorder" + "." + key;
......
...@@ -33,4 +33,7 @@ export default { ...@@ -33,4 +33,7 @@ export default {
updateNode(params) { //流程设计编辑保存 updateNode(params) { //流程设计编辑保存
return Api.post(`${workflowUrl}/node/update`, params); return Api.post(`${workflowUrl}/node/update`, params);
}, },
getbyid(params) {//根据shemaId获取详细详细
return Api.get(`${workflowUrl}/schema/getbyid`, params); //流程
},
} }
\ No newline at end of file
...@@ -2,18 +2,21 @@ import axios from 'axios'; ...@@ -2,18 +2,21 @@ import axios from 'axios';
import util from '@/libs/util'; import util from '@/libs/util';
import Setting from '@/setting'; import Setting from '@/setting';
import QS from 'querystring'; import QS from 'querystring';
import { Message, Notice } from 'view-design'; import {
Message,
Notice
} from 'view-design';
// 创建一个错误 // 创建一个错误
function errorCreate (msg) { function errorCreate(msg) {
const err = new Error(msg); const err = new Error(msg);
errorLog(err); errorLog(err);
throw err; throw err;
} }
// 记录和显示错误 // 记录和显示错误
function errorLog (err) { function errorLog(err) {
if(err&&err.response&&err.response.status==500){ if (err && err.response && err.response.status == 500) {
console.log(err.response) console.log(err.response)
Message.error({ Message.error({
content: err.response.data.error.message, content: err.response.data.error.message,
...@@ -36,25 +39,25 @@ function errorLog (err) { ...@@ -36,25 +39,25 @@ function errorLog (err) {
console.log(err); console.log(err);
} }
// 显示提示,可配置使用 iView 的 $Message 还是 $Notice 组件来显示 // 显示提示,可配置使用 iView 的 $Message 还是 $Notice 组件来显示
// if (Setting.errorModalType === 'Message') { // if (Setting.errorModalType === 'Message') {
// Message.error({ // Message.error({
// content: err.message, // content: err.message,
// duration: Setting.modalDuration // duration: Setting.modalDuration
// }); // });
// } else if (Setting.errorModalType === 'Notice') { // } else if (Setting.errorModalType === 'Notice') {
// Notice.error({ // Notice.error({
// title: '提示', // title: '提示',
// desc: err.message, // desc: err.message,
// duration: Setting.modalDuration // duration: Setting.modalDuration
// }); // });
// } // }
} }
// 创建一个 axios 实例 // 创建一个 axios 实例
const service = axios.create({ const service = axios.create({
baseURL: Setting.apiBaseURL, baseURL: Setting.apiBaseURL,
timeout: 60000, // 请求超时时间 timeout: 60000, // 请求超时时间
transformRequest:[(data)=>{ transformRequest: [(data) => {
function dateFormat(date, fmt) { function dateFormat(date, fmt) {
if (null == date || undefined == date) return ''; if (null == date || undefined == date) return '';
var o = { var o = {
...@@ -84,9 +87,12 @@ service.defaults.headers.put['Content-Type'] = 'application/json'; ...@@ -84,9 +87,12 @@ service.defaults.headers.put['Content-Type'] = 'application/json';
service.interceptors.request.use( service.interceptors.request.use(
config => { config => {
// 在请求发送之前做一些处理 // 在请求发送之前做一些处理
const token = util.cookies.get('token'); // const token = util.cookies.get('token');
const token = sessionStorage.getItem('token');
if (token) {
// 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改 // 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改
config.headers['Authorization'] = 'Bearer '+token; config.headers['Authorization'] = 'Bearer ' + token;
}
return config; return config;
}, },
error => { error => {
...@@ -102,7 +108,9 @@ service.interceptors.response.use( ...@@ -102,7 +108,9 @@ service.interceptors.response.use(
// dataAxios 是 axios 返回数据中的 data // dataAxios 是 axios 返回数据中的 data
const dataAxios = response.data; const dataAxios = response.data;
// 这个状态码是和后端约定的 // 这个状态码是和后端约定的
const { code } = dataAxios; const {
code
} = dataAxios;
// 根据 code 进行判断 // 根据 code 进行判断
if (code === undefined) { if (code === undefined) {
// 如果没有 code 代表这不是项目后端开发的接口 // 如果没有 code 代表这不是项目后端开发的接口
...@@ -125,40 +133,70 @@ service.interceptors.response.use( ...@@ -125,40 +133,70 @@ service.interceptors.response.use(
} }
}, },
error => { error => {
const token = sessionStorage.getItem('token');
if (!token) {
window.location.href = '/account/login';
return;
}
if (error && error.response) { if (error && error.response) {
if(error.response.status=="401"){
if (error.response.status == "401") {
window.location.href = '/account/login'; window.location.href = '/account/login';
return; return;
} }
switch (error.response.status) { switch (error.response.status) {
case 400: error.message = '请求错误'; break; case 400:
case 401: error.message = '未授权,请登录'; break; error.message = '请求错误';
case 403: error.message = '拒绝访问'; break; break;
case 404: error.message = `请求地址出错: ${error.response.config.url}`; break; case 401:
case 408: error.message = '请求超时'; break; error.message = '未授权,请登录';
case 500: error.message = '服务器内部错误'; break; break;
case 501: error.message = '服务未实现'; break; case 403:
case 502: error.message = '网关错误'; break; error.message = '拒绝访问';
case 503: error.message = '服务不可用'; break; break;
case 504: error.message = '网关超时'; break; case 404:
case 505: error.message = 'HTTP版本不受支持'; break; error.message = `请求地址出错: ${error.response.config.url}`;
default: break; break;
case 408:
error.message = '请求超时';
break;
case 500:
error.message = '服务器内部错误';
break;
case 501:
error.message = '服务未实现';
break;
case 502:
error.message = '网关错误';
break;
case 503:
error.message = '服务不可用';
break;
case 504:
error.message = '网关超时';
break;
case 505:
error.message = 'HTTP版本不受支持';
break;
default:
break;
} }
} }
errorLog(error); errorLog(error);
// console.warn("Erro:",error)
return Promise.reject(error); return Promise.reject(error);
} }
); );
let api=service.get; let api = service.get;
let get=(url,params)=>{ let get = (url, params) => {
if(params){ if (params) {
return api(url,{"params":params}) return api(url, {
}else{ "params": params
})
} else {
return api(url) return api(url)
} }
} }
service.get=get; service.get = get;
export default service; export default service;
...@@ -37,7 +37,6 @@ export const actions = { ...@@ -37,7 +37,6 @@ export const actions = {
// token 代表用户当前登录状态 建议在网络请求中携带 token // token 代表用户当前登录状态 建议在网络请求中携带 token
// 如有必要 token 需要定时更新,默认保存一天,可在 setting.js 中修改 // 如有必要 token 需要定时更新,默认保存一天,可在 setting.js 中修改
// 如果你的 token 不是通过 cookie 携带,而是普通字段,也可视情况存储在 localStorage // 如果你的 token 不是通过 cookie 携带,而是普通字段,也可视情况存储在 localStorage
console.warn(res);
if (res.result) { if (res.result) {
util.cookies.set('uuid', res.result.userId); util.cookies.set('uuid', res.result.userId);
......
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