Commit ed1b43bc authored by renjintao's avatar renjintao

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

parents 901606f3 dacc7af0
<template> <template>
<ul class="actions"> <div class="actions">
<li class="item" v-for="(li, i) in items" @click="detail(li)"> <div
:class="li.confirm ? 'confirm' : 'item'"
v-for="(li, i) in items"
@click="detail(li)"
>
<span v-if="mode == 'text'" class="text" v-text="li.label"></span> <span v-if="mode == 'text'" class="text" v-text="li.label"></span>
<Tooltip v-if="mode == 'icon'" :content="li.label" <Tooltip v-if="mode == 'icon'" :content="li.label"
><Icon :type="li.icon" ><Icon :type="li.icon"
...@@ -9,8 +13,8 @@ ...@@ -9,8 +13,8 @@
<Icon type="li.icon" /> <Icon type="li.icon" />
<span class="text" v-text="li.label"></span> <span class="text" v-text="li.label"></span>
</div> </div>
</li> </div>
</ul> </div>
</template> </template>
<script> <script>
...@@ -29,9 +33,14 @@ export default { ...@@ -29,9 +33,14 @@ export default {
return [ return [
{ label: "复制", icon: "md-copy", vclick: "" }, { label: "复制", icon: "md-copy", vclick: "" },
{ label: "新增", icon: "md-add", vclick: "" }, { label: "新增", icon: "md-add", vclick: "" },
{ label: "删除", icon: "md-trash", vclick: "" }, { label: "删除", icon: "md-trash", vclick: "", confirm: true },
{ label: "移动", icon: "md-move", vclick: "" }, { label: "移动", icon: "md-move", vclick: "" },
{ label: "派发", icon: "ios-alarm", vclick: "" }, {
label: "派发",
icon: "ios-alarm",
vclick: "",
confirm: "确认要进行派发吗?",
},
]; ];
}, },
}, },
...@@ -77,17 +86,32 @@ export default { ...@@ -77,17 +86,32 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@size:20px;//按钮大小
@distince:5px;//按钮间距
@color:black;//主色
@color-hover:#106ffe;//主悬浮色
@color-confirm:red;// 二次确认色
.actions { .actions {
ul { display: inline-block;
li { .item,
float: left; .confirm {
list-style: none; display: inline-block;
width: 20px; list-style: none;
height: 20px; width: @size;
text-align: center; height: @size;
margin-left: 5px; text-align: center;
color: red; margin-left:@distince;
} cursor: pointer;
border: 1px dotted @color;
line-height: @size;
}
.item:hover {
border: 1px solid @color-hover;
color: @color-hover;
}
.confirm:hover {
border: 1px solid @color-confirm;
color: @color-confirm;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</Form> </Form>
<Row> <Row>
<Col span="24" style="text-align:right;height:60px;line-height:60px"> <Col span="24" style="text-align:right;height:60px;line-height:60px">
<Button type="primary" @click="handleSubmit">确定</Button> <Button type="primary" @click="handleSubmit" v-noClick>确定</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</Col> </Col>
</Row> </Row>
......
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
</Col> </Col>
</Row> </Row>
<FormItem class="click-btn"> <FormItem class="click-btn">
<Button type="primary" @click="handleSubmit">确定</Button> <Button type="primary" @click="handleSubmit" v-noClick>确定</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</Form> </Form>
<Row> <Row>
<Col span="24" style="text-align:right;height:60px;line-height:60px"> <Col span="24" style="text-align:right;height:60px;line-height:60px">
<Button type="primary" @click="handleSubmit">确定</Button> <Button type="primary" @click="handleSubmit" v-noClick>确定</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</Col> </Col>
</Row> </Row>
......
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
</Col> </Col>
</Row> </Row>
<FormItem class="click-btn"> <FormItem class="click-btn">
<Button type="primary" @click="handleSubmit">确定</Button> <Button type="primary" @click="handleSubmit" v-noClick>确定</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
......
<template> <template>
<div class="scheduling"> <div>
<div class="aps-l"> <div class="back-href">
<Row class="row-p"> <a @click="viewClose">
<Col :span="10" class="chan-chi">整机排产-排产池</Col> <Icon type="ios-undo-outline" size="24" />返回计划管理
<Col :span="14" class="l-ringht"> </a>
<!-- <RadioGroup v-model="status" type="button" @on-change="changeStatus" size="small"> </div>
<div class="scheduling">
<div class="aps-l">
<Row class="row-p">
<Col :span="10" class="chan-chi">整机排产-排产池</Col>
<Col :span="14" class="l-ringht">
<!-- <RadioGroup v-model="status" type="button" @on-change="changeStatus" size="small">
<Radio label="0">未排产</Radio>--> <Radio label="0">未排产</Radio>-->
<!-- <Radio label="2">已排查</Radio> --> <!-- <Radio label="2">已排查</Radio> -->
<!-- <Radio label="-1">全部</Radio> --> <!-- <Radio label="-1">全部</Radio> -->
<!-- </RadioGroup> --> <!-- </RadioGroup> -->
</Col> </Col>
</Row> </Row>
<div class="left-down"> <div class="left-down">
<div <div
class="left-body" class="left-body"
v-for="(li, index) in list" v-for="(li, index) in list"
:key="index" :key="index"
:class="li.checked == true ? 'addclass' : ''" :class="li.checked == true ? 'addclass' : ''"
> >
<Row class="title-i"> <Row class="title-i">
<Col :span="20" class="order-code"> <Col :span="20" class="order-code">
<Checkbox <Checkbox
v-model="li.checked" v-model="li.checked"
@on-change="checkData(li)" @on-change="checkData(li)"
:disabled="li.status == 0 ? false : true" :disabled="li.status == 0 ? false : true"
>订单号:{{ li.mesCode }}</Checkbox >订单号:{{ li.mesCode }}</Checkbox
> >
</Col> </Col>
<Col :span="4" class="order-ringht"> <Col :span="4" class="order-ringht">
<Icon type="md-close" @click="close(li.id)" /> <Icon type="md-close" @click="close(li.id)" />
</Col> </Col>
</Row> </Row>
<div class="fa">产品名称:{{ li.productName }}</div> <div class="fa">产品名称:{{ li.productName }}</div>
<div class="time-s">产品数量:{{ li.quantity }}</div> <div class="time-s">产品数量:{{ li.quantity }}</div>
<!-- <div class="time-s"> <!-- <div class="time-s">
<span>工序:{{li.drawnNumber}}</span> <span>工序:{{li.drawnNumber}}</span>
</div> --> </div> -->
<div class="time-s"> <div class="time-s">
{{ li.demandFinishDate }} ~ {{ li.demandStartDate }} {{ li.demandFinishDate }} ~ {{ li.demandStartDate }}
</div>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="aps-r" v-show="showSet">
<div class="aps-r" v-show="showSet"> <div class="r-title">排产设置盘</div>
<div class="r-title">排产设置盘</div> <Form :model="formItem" :label-width="100">
<Form :model="formItem" :label-width="100"> <FormItem label="工时">
<FormItem label="工时"> <DatePicker
<DatePicker type="datetimerange"
type="datetimerange" format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss" placeholder="请选择工时"
placeholder="请选择工时" @on-change="changeFormat"
@on-change="changeFormat" v-model="formItem.time"
v-model="formItem.time" style="width: 300px"
style="width: 300px" ></DatePicker>
></DatePicker> </FormItem>
</FormItem> <FormItem label="类型">
<FormItem label="类型"> <RadioGroup v-model="formItem.radio">
<RadioGroup v-model="formItem.radio"> <Radio label="0">人员</Radio>
<Radio label="0">人员</Radio> <Radio label="1">班组</Radio>
<Radio label="1">班组</Radio> </RadioGroup>
</RadioGroup> </FormItem>
</FormItem> <FormItem v-if="formItem.radio == 0">
<FormItem v-if="formItem.radio == 0"> <UserSelect v-model="user" :multiple="true" />
<UserSelect v-model="user" :multiple="true" /> </FormItem>
</FormItem> <FormItem label="班组" v-if="formItem.radio == 1">
<FormItem label="班组" v-if="formItem.radio == 1"> <!-- <DepartmentSelect :type="3" v-model="formItem.shopId"/> -->
<!-- <DepartmentSelect :type="3" v-model="formItem.shopId"/> --> <Select
<Select v-model="formItem.shopId"
v-model="formItem.shopId" placeholder="请选择"
placeholder="请选择" style="width: 300px"
style="width: 300px" >
> <Option
<Option v-for="(item, index) in listClass"
v-for="(item, index) in listClass" :key="index"
:key="index" :value="item.value"
:value="item.value" :label="item.label"
:label="item.label" style="display: none"
style="display: none" ></Option>
></Option> <Tree
<Tree key="mytree"
key="mytree" :data="workShop"
:data="workShop" ref="mytree"
ref="mytree" :render="renderContent"
:render="renderContent" ></Tree>
></Tree> </Select>
</Select> </FormItem>
</FormItem> <FormItem label="备注">
<FormItem label="备注"> <Input
<Input v-model="formItem.remark"
v-model="formItem.remark" type="textarea"
type="textarea" :autosize="{ minRows: 2, maxRows: 5 }"
:autosize="{ minRows: 2, maxRows: 5 }" placeholder="请输入备注信息"
placeholder="请输入备注信息" ></Input>
></Input> </FormItem>
</FormItem> <FormItem>
<FormItem> <Button style="margin-left: 8px" @click="closeOk">取消</Button>
<Button style="margin-left: 8px" @click="closeOk">取消</Button> <Button type="primary" @click="lowerHair" v-noClick>下发</Button>
<Button type="primary" @click="lowerHair">下发</Button> </FormItem>
</FormItem> </Form>
</Form> </div>
</div> </div>
</div> </div>
</template> </template>
...@@ -126,7 +133,7 @@ export default { ...@@ -126,7 +133,7 @@ export default {
showSet: false, showSet: false,
// userName: "" // userName: ""
}, },
user:'', user: "",
showSet: false, showSet: false,
// listGroup: [ // listGroup: [
// { // {
...@@ -169,6 +176,9 @@ export default { ...@@ -169,6 +176,9 @@ export default {
this.orderlist(0); this.orderlist(0);
}, },
methods: { methods: {
viewClose() {
this.$router.push("/aps/plan");
},
// 过滤条件 // 过滤条件
changeStatus(name) { changeStatus(name) {
this.status = name; this.status = name;
...@@ -338,6 +348,9 @@ export default { ...@@ -338,6 +348,9 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "../../../assets/css/custom.less"; @import "../../../assets/css/custom.less";
.back-href {
height: 35px;
}
.addclass { .addclass {
border-color: rgba(38, 128, 235, 0.2) !important; border-color: rgba(38, 128, 235, 0.2) !important;
.title-i { .title-i {
......
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</Row> </Row>
<FormItem> <FormItem>
<Button style="margin-right: 8px" @click="cancle">取消</Button> <Button style="margin-right: 8px" @click="cancle">取消</Button>
<Button type="primary" @click="sendSheBei">派工</Button> <Button type="primary" @click="sendSheBei" v-noClick>派工</Button>
</FormItem> </FormItem>
</Form> </Form>
</Drawer> </Drawer>
......
...@@ -42,7 +42,6 @@ export default { ...@@ -42,7 +42,6 @@ export default {
name: "addAccessory", name: "addAccessory",
data() { data() {
return { return {
disabled: false,
deletelModal: false, deletelModal: false,
curId: 0, curId: 0,
editIndex: -1, editIndex: -1,
......
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
name: "detailAccessory", name: "detailAccessory",
data() { data() {
return { return {
disabled: false,
deletelModal: false, deletelModal: false,
statuList: this.$store.getters.dictionaryByKey("accessory.status") || [], statuList: this.$store.getters.dictionaryByKey("accessory.status") || [],
statuList1: this.$store.getters.dictionaryByKey("outstore.status") || [], statuList1: this.$store.getters.dictionaryByKey("outstore.status") || [],
......
...@@ -2,99 +2,104 @@ ...@@ -2,99 +2,104 @@
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<Col span="12"> <Col span="12">
<FormItem :label="l('DistributeMainRouting')" prop="DistributeMainRouting"> <FormItem
<UserSelect ref="userSelected" v-model="entity.DistributeMainRouting" /> :label="l('DistributeMainRouting')"
prop="DistributeMainRouting"
>
<UserSelect
ref="userSelected"
v-model="entity.DistributeMainRouting"
/>
</FormItem> </FormItem>
</Col> </Col>
<Col span="12"> <Col span="12">
<FormItem label="完成时间" style="width:100%" prop="MainRoutingFinishDate"> <FormItem
label="完成时间"
style="width: 100%"
prop="MainRoutingFinishDate"
>
<DatePicker <DatePicker
v-model="entity.MainRoutingFinishDate" v-model="entity.MainRoutingFinishDate"
type="datetime" type="datetime"
placeholder="请选择日期" placeholder="请选择日期"
style="width:240px" style="width: 240px"
@on-change="getTimeMainRFD" @on-change="getTimeMainRFD"
></DatePicker> ></DatePicker>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row > <Row> &nbsp; </Row>
&nbsp; <Row> &nbsp; </Row>
</Row>
<Row >
&nbsp;
</Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Dispatch', name: "Dispatch",
props: { props: {
ids: Array ids: Array,
}, },
data() { data() {
return { return {
disabled: false,
entity: { entity: {
DistributeMainRouting: null, DistributeMainRouting: null,
MainRoutingFinishDate: '' MainRoutingFinishDate: "",
}, },
rules: { rules: {
DistributeMainRouting: [ DistributeMainRouting: [
{ {
required: true, required: true,
message: '请选择人员', message: "请选择人员",
trigger: 'change', trigger: "change",
type: 'number' type: "number",
} },
], ],
MainRoutingFinishDate: [ MainRoutingFinishDate: [
{ {
required: true, required: true,
message: '请选择时间', message: "请选择时间",
trigger: 'change' trigger: "change",
} },
] ],
} },
} };
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.entity.ids = this.ids this.entity.ids = this.ids;
Api.routingdistribute(this.entity) Api.routingdistribute(this.entity)
.then((r) => { .then((r) => {
if (r.success) { if (r.success) {
this.$Message.success('工艺派发成功') this.$Message.success("工艺派发成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } else {
this.$Message.error('工艺派发失败') this.$Message.error("工艺派发失败");
} }
this.$emit('on-ok') this.$emit("on-ok");
}) })
.catch((err) => { .catch((err) => {
this.$Message.error('工艺派发失败') this.$Message.error("工艺派发失败");
}) });
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = 'mes_order' + '.' + key key = "mes_order" + "." + key;
return this.$t(key) return this.$t(key);
}, },
getTimeMainRFD(value) { getTimeMainRFD(value) {
this.entity.MainRoutingFinishDate = value this.entity.MainRoutingFinishDate = value;
} },
}, },
watch: {} watch: {},
} };
</script> </script>
<template> <template>
<div class="scheduling"> <div>
<div class="aps-l"> <div class="back-href">
<Row class="row-p"> <a @click="viewClose">
<Col :span="9" class="chan-chi">流水排产-排产池</Col> <Icon type="ios-undo-outline" size="24" />返回计划管理
<Col :span="15" class="l-ringht"> </a>
<!-- <RadioGroup v-model="status" type="button" @on-change="changeStatus" size="small"> </div>
<div class="scheduling">
<div class="aps-l">
<Row class="row-p">
<Col :span="9" class="chan-chi">流水排产-排产池</Col>
<Col :span="15" class="l-ringht">
<!-- <RadioGroup v-model="status" type="button" @on-change="changeStatus" size="small">
<Radio label="0">未排产</Radio>--> <Radio label="0">未排产</Radio>-->
<!-- <Radio label="2">已排查</Radio> --> <!-- <Radio label="2">已排查</Radio> -->
<!-- <Radio label="-1">全部</Radio> --> <!-- <Radio label="-1">全部</Radio> -->
<!-- </RadioGroup> --> <!-- </RadioGroup> -->
</Col> </Col>
</Row> </Row>
<div class="left-down"> <div class="left-down">
<div <div
class="left-body" class="left-body"
v-for="(li, index) in list" v-for="(li, index) in list"
:key="index" :key="index"
@click="listData(li, index)" @click="listData(li, index)"
:class="isactive == index ? 'addclass' : ''" :class="isactive == index ? 'addclass' : ''"
> >
<Row class="title-i"> <Row class="title-i">
<Col :span="20" class="order-code">订单号:{{ li.mesCode }}</Col> <Col :span="20" class="order-code">订单号:{{ li.mesCode }}</Col>
<Col :span="4" class="order-ringht"> <Col :span="4" class="order-ringht">
<Icon type="md-close" @click="close(li.id)" /> <Icon type="md-close" @click="close(li.id)" />
</Col> </Col>
</Row> </Row>
<div class="fa">产品名称:{{ li.productName }}</div> <div class="fa">产品名称:{{ li.productName }}</div>
<div class="time-s"> <div class="time-s">
<!-- <Icon type="ios-copy" /> --> <!-- <Icon type="ios-copy" /> -->
<span>工序:{{ li.drawnNumber }}</span> <span>工序:{{ li.drawnNumber }}</span>
</div> </div>
<div class="time-s"> <div class="time-s">
{{ li.demandFinishDate }}{{ li.demandStartDate }} {{ li.demandFinishDate }}{{ li.demandStartDate }}
</div>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="aps-r">
<div class="aps-r"> <!-- <div class="g-list">工序列表</div> -->
<!-- <div class="g-list">工序列表</div> --> <Row class="g-list">
<Row class="g-list"> <Col :span="2">
<Col :span="2"> <span class="cha-chi">工序列表</span>
<span class="cha-chi">工序列表</span> </Col>
</Col> <Col :span="16">
<Col :span="16"> <span></span>
<span></span> </Col>
</Col> <Col :span="6">
<Col :span="6"> <RadioGroup
<RadioGroup v-model="mode"
v-model="mode" type="button"
type="button" size="small"
size="small" @on-change="changeMode"
@on-change="changeMode" >
> <Radio :label="1">一级排产</Radio>
<Radio :label="1">一级排产</Radio> <Radio :label="2">二级排产</Radio>
<Radio :label="2">二级排产</Radio> </RadioGroup>
</RadioGroup> <Button
<Button type="primary"
type="primary" @click="lowerHair"
@click="lowerHair" :disabled="!allow"
:disabled="!allow" v-if="showXia"
v-if="showXia" >下发</Button
>下发</Button >
> </Col>
</Col> </Row>
</Row> <Row class="right-body">
<Row class="right-body"> <Col class="list" span="24">
<Col class="list" span="24"> <Timeline>
<Timeline> <TimelineItem v-for="(item, index) in result" :key="index">
<TimelineItem v-for="(item, index) in result" :key="index"> <Badge :count="item.seq" slot="dot" :type="type(index)"></Badge>
<Badge :count="item.seq" slot="dot" :type="type(index)"></Badge> <div class="set-name">
<div class="set-name"> <span
<span @click="sets(item, index)"
@click="sets(item, index)" class="mr20"
class="mr20" :class="active == index ? 'gongTitle' : ''"
:class="active == index ? 'gongTitle' : ''" >工序名称:{{ item.name }}</span
>工序名称:{{ item.name }}</span >
> <op
<op title="拆分工序"
title="拆分工序" @click="split(item, index)"
@click="split(item, index)" type="icon"
type="icon" icon="ios-cut"
icon="ios-cut" v-if="item.quantity > 1 && !item.chai"
v-if="item.quantity > 1 && !item.chai" ></op>
></op> <op
<op title="移除"
title="移除" @click="remove(item, index)"
@click="remove(item, index)" type="icon"
type="icon" icon="ios-trash"
icon="ios-trash" oprate="delete"
oprate="delete" v-if="item.chai"
v-if="item.chai" ></op>
></op> </div>
</div>
<div class="content">数量:{{ item.quantity }}</div> <div class="content">数量:{{ item.quantity }}</div>
<div v-show="item.userIds" class="content"> <div v-show="item.userIds" class="content">
人员: 人员:
<span v-for="(u, j) in item.userIds" :key="j"> <span v-for="(u, j) in item.userIds" :key="j">
<User :value="u"></User>&nbsp;&nbsp;&nbsp; <User :value="u"></User>&nbsp;&nbsp;&nbsp;
</span> </span>
</div> </div>
<div v-show="item.shopName" class="content"> <div v-show="item.shopName" class="content">
班组: 班组:
{{ item.shopName }} {{ item.shopName }}
</div> </div>
<div v-show="item.beginTime" class="content"> <div v-show="item.beginTime" class="content">
时间: 时间:
{{ item.beginTime }} —— {{ item.endTime }} {{ item.beginTime }} —— {{ item.endTime }}
</div> </div>
<div v-show="item.remark" class="content"> <div v-show="item.remark" class="content">
备注: 备注:
{{ item.remark }} {{ item.remark }}
</div> </div>
<!-- <div>工序号:{{item.task_seq}}</div> --> <!-- <div>工序号:{{item.task_seq}}</div> -->
</TimelineItem> </TimelineItem>
</Timeline> </Timeline>
<div> <div>
<Drawer <Drawer
title="排产设置盘" title="排产设置盘"
:closable="false" :closable="false"
v-model="set" v-model="set"
width="55%" width="55%"
> >
<Set <Set
:mode="mode" :mode="mode"
:detailId="detailId" :detailId="detailId"
:indexId="indexId" :indexId="indexId"
@closeOk="closeOk" @closeOk="closeOk"
ref="setObj" ref="setObj"
@on-DetermineOk="DetermineOk" @on-DetermineOk="DetermineOk"
></Set> ></Set>
</Drawer> </Drawer>
</div> </div>
<!-- <List :result="result"></List> --> <!-- <List :result="result"></List> -->
</Col> </Col>
</Row> </Row>
</div>
<!-- 拆分 fenModel -->
<Modal
v-model="chaiModal"
title="拆分工序"
:width="400"
:mask-closable="false"
ok-text="拆分"
@on-ok="okChai()"
>
拆分数量:
<InputNumber v-model="chaiNum" :min="1" :max="maxnum"></InputNumber>
<Slider
v-if="maxnum > 1"
v-model="chaiNum"
:min="1"
:max="maxnum"
></Slider>
</Modal>
</div> </div>
<!-- 拆分 fenModel -->
<Modal
v-model="chaiModal"
title="拆分工序"
:width="400"
:mask-closable="false"
ok-text="拆分"
@on-ok="okChai()"
>
拆分数量:
<InputNumber v-model="chaiNum" :min="1" :max="maxnum"></InputNumber>
<Slider
v-if="maxnum > 1"
v-model="chaiNum"
:min="1"
:max="maxnum"
></Slider>
</Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -197,6 +205,9 @@ export default { ...@@ -197,6 +205,9 @@ export default {
this.orderlist(0); this.orderlist(0);
}, },
methods: { methods: {
viewClose() {
this.$router.push("/aps/plan");
},
// 排产池过滤条件 // 排产池过滤条件
changeStatus(a) { changeStatus(a) {
this.status = a; this.status = a;
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</Row> </Row>
<Row> <Row>
<FormItem label=" "> <FormItem label=" ">
<Button type="primary" @click="pwdOk">保存</Button> <Button type="primary" @click="pwdOk" v-noClick>保存</Button>
</FormItem> </FormItem>
</Row> </Row>
</Form> </Form>
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<Col span="12"> <Col span="12">
<FormItem label="分解数量" style="width:100%" prop="splitQuantity"> <FormItem label="分解数量" style="width:100%" prop="splitQuantity">
<InputNumber :min="0" v-model="orderForm.splitQuantity" style="width:180px"></InputNumber> <InputNumber :min="0" v-model="orderForm.splitQuantity" style="width:180px"></InputNumber>
<Button type="primary" @click="addSplitOrder">确定</Button> <Button type="primary" @click="addSplitOrder" v-noClick>确定</Button>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<Col span="15">&nbsp;</Col> <Col span="15">&nbsp;</Col>
<Col span="9"> <Col span="9">
<Button @click="handleClose" class="mr20">取消</Button> <Button @click="handleClose" class="mr20">取消</Button>
<Button type="primary" @click="suerUp()">保存</Button> <Button type="primary" @click="suerUp()" v-noClick>保存</Button>
</Col> </Col>
</Row> </Row>
</Form> </Form>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<Col span="16">&nbsp;</Col> <Col span="16">&nbsp;</Col>
<Col span="8"> <Col span="8">
<Button @click="cancel" class="ml20">取消</Button> <Button @click="cancel" class="ml20">取消</Button>
<Button type="primary" @click="setNumOk">设置</Button> <Button type="primary" @click="setNumOk" v-noClick>设置</Button>
</Col> </Col>
</Row> </Row>
</Form> </Form>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</template> </template>
<template slot-scope="{ row, index }" slot="action"> <template slot-scope="{ row, index }" slot="action">
<div v-if="editIndex === index"> <div v-if="editIndex === index">
<Button @click="handleSave(index)">保存</Button> <Button @click="handleSave(index)" v-noClick>保存</Button>
<Button @click="editIndex = -1">取消</Button> <Button @click="editIndex = -1">取消</Button>
</div> </div>
<div v-else> <div v-else>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</template> </template>
<template slot-scope="{ row, index }" slot="action"> <template slot-scope="{ row, index }" slot="action">
<div v-if="editIndex02 === index"> <div v-if="editIndex02 === index">
<Button @click="handleSave02(index)">保存</Button> <Button @click="handleSave02(index)" v-noClick>保存</Button>
<Button @click="editIndex02 = -1">取消</Button> <Button @click="editIndex02 = -1">取消</Button>
</div> </div>
<div v-else> <div v-else>
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
</template> </template>
<template slot-scope="{ row, index }" slot="action"> <template slot-scope="{ row, index }" slot="action">
<div v-if="editIndex03 === index"> <div v-if="editIndex03 === index">
<Button @click="handleSave03(index)">保存</Button> <Button @click="handleSave03(index)" v-noClick>保存</Button>
<Button @click="handlecancel(row, index)">取消</Button> <Button @click="handlecancel(row, index)">取消</Button>
</div> </div>
<div v-else> <div v-else>
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</template> </template>
<template slot-scope="{ row, index }" slot="action"> <template slot-scope="{ row, index }" slot="action">
<div v-if="editIndex02 === index"> <div v-if="editIndex02 === index">
<Button @click="handleSave02(index)">保存</Button> <Button @click="handleSave02(index)" v-noClick>保存</Button>
<Button @click="editIndex02 = -1">取消</Button> <Button @click="editIndex02 = -1">取消</Button>
</div> </div>
<div v-else> <div v-else>
......
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
</div> </div>
<div slot="footer"> <div slot="footer">
<Button type="text" size="large" @click="saveCancelModel">取消</Button> <Button type="text" size="large" @click="saveCancelModel">取消</Button>
<Button type="primary" size="large" @click="modalOk">保存</Button> <Button type="primary" size="large" @click="modalOk" v-noClick>保存</Button>
<Checkbox v-show="submitShow" v-model="checked" class="ml10" label="送审">送审</Checkbox> <Checkbox v-show="submitShow" v-model="checked" class="ml10" label="送审">送审</Checkbox>
</div> </div>
<changeSendReview ref="changeSendReview" ></changeSendReview> <changeSendReview ref="changeSendReview" ></changeSendReview>
......
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
<template v-if="createtype==1"> <template v-if="createtype==1">
<Button type="text" size="large" @click="saveCancelModel">取消</Button> <Button type="text" size="large" @click="saveCancelModel">取消</Button>
<Checkbox v-model="issendAudit" label="送审">送审</Checkbox> <Checkbox v-model="issendAudit" label="送审">送审</Checkbox>
<Button type="primary" size="large" @click="modalOk">保存</Button> <Button type="primary" size="large" @click="modalOk" v-noClick>保存</Button>
<Button type="primary" size="large" @click="nextStepandSave">下一步</Button> <Button type="primary" size="large" @click="nextStepandSave">下一步</Button>
</template> </template>
<template v-else-if="createtype==2"> <template v-else-if="createtype==2">
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<!-- <Col :span="12" <!-- <Col :span="12"
><FormItem :label="l('creationTime')" prop="creationTime"> ><FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker <DatePicker
type="date" type="date"
...@@ -101,9 +101,7 @@ ...@@ -101,9 +101,7 @@
></Col> ></Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled" <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -114,7 +112,6 @@ export default { ...@@ -114,7 +112,6 @@ export default {
name: "Add", name: "Add",
data() { data() {
return { return {
disabled: false,
entity: { entity: {
// creationTime: null, // creationTime: null,
// creatorUserId: null, // creatorUserId: null,
...@@ -152,10 +149,8 @@ export default { ...@@ -152,10 +149,8 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true;
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then((r) => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
...@@ -164,7 +159,6 @@ export default { ...@@ -164,7 +159,6 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker> <Col :span="12"
</FormItem></Col> ><FormItem :label="l('creationTime')" prop="creationTime">
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber> <DatePicker
</FormItem></Col> type="date"
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker> v-model="entity.creationTime"
</FormItem></Col> ></DatePicker> </FormItem
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber> ></Col>
</FormItem></Col> <Col :span="12"
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <InputNumber v-model="entity.isDeleted"></InputNumber> ><FormItem :label="l('creatorUserId')" prop="creatorUserId">
</FormItem></Col> <InputNumber v-model="entity.creatorUserId"></InputNumber> </FormItem
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker> ></Col>
</FormItem></Col> <Col :span="12"
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber> ><FormItem
</FormItem></Col> :label="l('lastModificationTime')"
<Col :span="12"><FormItem :label="l('projectId')" prop="projectId"> <InputNumber v-model="entity.projectId"></InputNumber> prop="lastModificationTime"
</FormItem></Col> >
<Col :span="12"><FormItem :label="l('upId')" prop="upId"> <InputNumber v-model="entity.upId"></InputNumber> <DatePicker
</FormItem></Col> type="date"
<Col :span="12"><FormItem :label="l('title')" prop="title"> <Input v-model="entity.title"> </Input> v-model="entity.lastModificationTime"
</FormItem></Col> ></DatePicker> </FormItem
<Col :span="12"><FormItem :label="l('status')" prop="status"> <Dictionary code="mes.project_plan.Status" v-model="entity.status"></Dictionary> ></Col>
</FormItem></Col> <Col :span="12"
<Col :span="24"><FormItem :label="l('note')" prop="note"> <Input v-model="entity.note" type="textarea" :rows="5"></Input> ><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
</FormItem></Col> <InputNumber
<Col :span="12"><FormItem :label="l('startDate')" prop="startDate"> <DatePicker type="date" v-model="entity.startDate"></DatePicker> v-model="entity.lastModifierUserId"
</FormItem></Col> ></InputNumber> </FormItem
<Col :span="12"><FormItem :label="l('endDate')" prop="endDate"> <DatePicker type="date" v-model="entity.endDate"></DatePicker> ></Col>
</FormItem></Col> <Col :span="12"
<Col :span="12"><FormItem :label="l('type')" prop="type"> <Dictionary code="mes.project_plan.Type" v-model="entity.type"></Dictionary> ><FormItem :label="l('isDeleted')" prop="isDeleted">
</FormItem></Col> <InputNumber v-model="entity.isDeleted"></InputNumber> </FormItem
<Col :span="12"><FormItem :label="l('attachment')" prop="attachment"> <Input v-model="entity.attachment"> </Input> ></Col>
</FormItem></Col> <Col :span="12"
<Col :span="12"><FormItem :label="l('executor')" prop="executor"> <Input v-model="entity.executor"> </Input> ><FormItem :label="l('deletionTime')" prop="deletionTime">
</FormItem></Col> <DatePicker
</Row> type="date"
<FormItem> v-model="entity.deletionTime"
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> ></DatePicker> </FormItem
<Button @click="handleClose" class="ml20">取消</Button> ></Col>
</FormItem> <Col :span="12"
</Form> ><FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('projectId')" prop="projectId">
<InputNumber v-model="entity.projectId"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('upId')" prop="upId">
<InputNumber v-model="entity.upId"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('status')" prop="status">
<Dictionary
code="mes.project_plan.Status"
v-model="entity.status"
></Dictionary> </FormItem
></Col>
<Col :span="24"
><FormItem :label="l('note')" prop="note">
<Input
v-model="entity.note"
type="textarea"
:rows="5"
></Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('startDate')" prop="startDate">
<DatePicker
type="date"
v-model="entity.startDate"
></DatePicker> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('endDate')" prop="endDate">
<DatePicker
type="date"
v-model="entity.endDate"
></DatePicker> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('type')" prop="type">
<Dictionary
code="mes.project_plan.Type"
v-model="entity.type"
></Dictionary> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('attachment')" prop="attachment">
<Input v-model="entity.attachment"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('executor')" prop="executor">
<Input v-model="entity.executor"> </Input> </FormItem
></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Edit', name: "Edit",
data() { data() {
return { return {
disabled: false, entity: {},
entity: { rules: {
}, name: [{ required: true, message: "必填", trigger: "blur" }],
rules: { },
name: [{ required: true, message: '必填', trigger: 'blur' }] };
} },
} props: {
}, eid: Number,
props: { },
eid: Number mounted() {
}, if (this.eid > 0) {
mounted() { this.load(this.eid);
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.update(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "project_plan" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
}
}
} }
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
Api.update(this.entity)
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project_plan" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
},
};
</script> </script>
\ No newline at end of file
...@@ -79,18 +79,19 @@ export default { ...@@ -79,18 +79,19 @@ export default {
key: "action", key: "action",
width: 150, width: 150,
align: "center", align: "center",
// render:(h,params)=>{ render:(h,params)=>{
// return h("Actions" return h("Actions"
// ,{ ,{
// attrs:{ attrs:{
// row:params, row:params,
// },
// on:{ },
// 'on-click':()=>this.rowclick on:{
// } 'on-click':this.rowclick
// } }
// ) }
// } )
}
// render: (h, params) => { // render: (h, params) => {
// return h("div", { class: "action" }, [ // return h("div", { class: "action" }, [
// h( // h(
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<Col span="8"> <Col span="8" class="projct-img">
<FormItem :label="l('picture')" prop="picture"> <FormItem :label="l('picture')" prop="picture">
<inputFile <inputFile
class="tphoto" class="tphoto"
...@@ -137,7 +137,7 @@ export default { ...@@ -137,7 +137,7 @@ export default {
name: "Add", name: "Add",
data() { data() {
return { return {
disabled: false,
imgName: "", imgName: "",
avatorPath: "", avatorPath: "",
entity: { entity: {
...@@ -196,7 +196,7 @@ export default { ...@@ -196,7 +196,7 @@ export default {
} }
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then((r) => {
this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
...@@ -205,7 +205,7 @@ export default { ...@@ -205,7 +205,7 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
...@@ -245,4 +245,19 @@ export default { ...@@ -245,4 +245,19 @@ export default {
}, },
}, },
}; };
</script> </script>
\ No newline at end of file <style lang="less">
.projct-img {
.img-touxiang {
width: 300px;
height: 300px;
margin: 0px 10px 15px 20px;
overflow: hidden;
border-radius: 5px;
.img1 {
width: 100%;
height: 100%;
}
}
}
</style>
\ No newline at end of file
...@@ -33,8 +33,12 @@ ...@@ -33,8 +33,12 @@
<Filed :span="12" :name="l('type')"> <Filed :span="12" :name="l('type')">
<state code="project.main.type" :value="entity.type" /> <state code="project.main.type" :value="entity.type" />
</Filed> </Filed>
<Filed :span="12" :name="l('picture')">{{ entity.picture }}</Filed> <Filed :span="12" :name="l('picture')"
<Filed :span="12" :name="l('attachment')">{{ entity.attachment }}</Filed> ><a @click="imgClick(entity.picture)">查看图片</a></Filed
>
<Filed :span="12" :name="l('attachment')">
<files ref="refFile" :parms="parms" fileFormat :showList="false" />
</Filed>
<Filed :span="24" :name="l('note')">{{ entity.note }}</Filed> <Filed :span="24" :name="l('note')">{{ entity.note }}</Filed>
</Row> </Row>
</div> </div>
...@@ -50,6 +54,12 @@ export default { ...@@ -50,6 +54,12 @@ export default {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }], code: [{ required: true, message: "必填", trigger: "blur" }],
}, },
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
}; };
}, },
props: ["eid"], props: ["eid"],
...@@ -57,11 +67,17 @@ export default { ...@@ -57,11 +67,17 @@ export default {
this.load(this.eid); this.load(this.eid);
}, },
methods: { methods: {
imgClick(img) {
window.open(fileUrlDown + img, "_blank");
},
load(v) { load(v) {
Api.get({ id: v }).then((r) => { Api.get({ id: v }).then((r) => {
this.entity = r.result; this.entity = r.result;
this.entity.type = r.result.type+''; this.entity.type = r.result.type + "";
this.entity.state = r.result.state+''; this.entity.state = r.result.state + "";
this.parms.eid = r.result.attachment;
this.$emit("on-load"); this.$emit("on-load");
}); });
}, },
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<Col span="8"> <Col span="8" class="projct-img">
<FormItem :label="l('picture')" prop="picture"> <FormItem :label="l('picture')" prop="picture">
<inputFile <inputFile
class="tphoto" class="tphoto"
...@@ -173,4 +173,7 @@ export default { ...@@ -173,4 +173,7 @@ export default {
}, },
}, },
}; };
</script> </script>
\ No newline at end of file <style lang="less">
</style>
\ No newline at end of file
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
:conditions="easySearch" :conditions="easySearch"
:type="typeInfo" :type="typeInfo"
:span="6" :span="6"
:format="formatFun"
><template slot="easySearch" ><template slot="easySearch"
><Form ref="formInline" :model="easySearch" inline ><Form ref="formInline" :model="easySearch" inline
><FormItem prop="keys" ><FormItem prop="keys"
...@@ -34,11 +35,16 @@ ...@@ -34,11 +35,16 @@
></Button> ></Button>
</template> </template>
<template slot="card" slot-scope="{ row }"> <template slot="card" slot-scope="{ row }">
<div class="body-card"> <Card
class="body-card"
:style="row._checked ? 'border:1px solid #2680eb;' : ''"
>
<Row class="title-i"> <Row class="title-i">
<Col :span="10" class="title-l"> <Col :span="10" class="title-l">
<Checkbox v-model="row._checked"></Checkbox>
<Ellipsis :text="row.title" :length="18" tooltip /> <Ellipsis :text="row.title" :length="18" tooltip />
</Col> </Col>
<Col :span="10" class="btn-click"> <Col :span="10" class="btn-click">
<!-- <Ellipsis :text="row.code" :length="18" tooltip/> --> <!-- <Ellipsis :text="row.code" :length="18" tooltip/> -->
</Col> </Col>
...@@ -104,10 +110,10 @@ ...@@ -104,10 +110,10 @@
</div> </div>
</Col> </Col>
</Row> </Row>
</div> </Card>
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide :mask-closable="false">
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
</div> </div>
...@@ -131,6 +137,7 @@ export default { ...@@ -131,6 +137,7 @@ export default {
easySearch: { easySearch: {
keys: { op: "title", value: null }, keys: { op: "title", value: null },
}, },
// single: false,
modal: false, modal: false,
title: "新增", title: "新增",
detail: null, detail: null,
...@@ -338,10 +345,17 @@ export default { ...@@ -338,10 +345,17 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
//格式化原始数据
formatFun(data) {
data.map((e) => {
return (e._checked = false);
});
return data;
},
tdStyle(val) { tdStyle(val) {
//动态根据状态值加载状态值对应的颜色 //动态根据状态值加载状态值对应的颜色 #19c919
let temDic = this.$store.getters.dictionaryByKey("taskList.status"); let temDic = this.$store.getters.dictionaryByKey("project.main.state");
let temColor = "#666"; let temColor = "#19c919";
temDic.forEach((data) => { temDic.forEach((data) => {
if (Number(data.code) == val) { if (Number(data.code) == val) {
temColor = data.color; temColor = data.color;
...@@ -425,21 +439,25 @@ export default { ...@@ -425,21 +439,25 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
.project { .project {
.ivu-card-body {
padding: 0 !important;
}
.body-card { .body-card {
border: 1px solid rgba(38, 128, 235, 1); // border: 1px solid rgba(38, 128, 235, 1);
margin: 5px 0; margin: 5px 0;
border-radius: 4px; border-radius: 4px;
height: 280px; // height: 280px;
.title-i { .title-i {
border-bottom: 1px solid #2680eb; // border-bottom: 1px solid #2680eb;
// padding: 0 10px; // padding: 0 10px;
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
background: rgba(38, 128, 235, 0.2); background: rgba(38, 128, 235, 0.2);
color: #2680eb; color: #2680eb;
padding-left: 10px;
.title-l { .title-l {
padding-left: 10px; display: -webkit-inline-box;
} }
.btn-click { .btn-click {
text-align: right; text-align: right;
...@@ -477,22 +495,18 @@ export default { ...@@ -477,22 +495,18 @@ export default {
} }
.row-down { .row-down {
padding: 14px; padding: 14px;
// height: 110px;
.img-i { .img-i {
height: 170px; height: 170px;
width: 170px; width: 170px;
// img {
// width: 90px;
// height: 90px;
// }
} }
.c { .c {
padding-left: 14px; padding-left: 14px;
height: 170px; height: 170px;
div { div {
height: 30px; height: 33px;
line-height: 33px;
} }
} }
.shuo-ming { .shuo-ming {
...@@ -501,8 +515,8 @@ export default { ...@@ -501,8 +515,8 @@ export default {
} }
} }
.bottom-b { .bottom-b {
line-height: 40px; // line-height: 40px;
padding-left: 14px; padding: 0 0 6px 14px;
.a-icon { .a-icon {
text-align: right; text-align: right;
} }
......
...@@ -23,7 +23,10 @@ ...@@ -23,7 +23,10 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="6"> <Col :span="6">
<FormItem :label="l('productSerialNumber')" prop="productSerialNumber"> <FormItem
:label="l('productSerialNumber')"
prop="productSerialNumber"
>
<ProductNumberSelect <ProductNumberSelect
v-model="entity.productSerialNumber" v-model="entity.productSerialNumber"
:eid="eid" :eid="eid"
...@@ -43,50 +46,92 @@ ...@@ -43,50 +46,92 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="6"> <Col :span="6">
<FormItem :label="l('materialSerialNumber')" prop="materialSerialNumber"> <FormItem
:label="l('materialSerialNumber')"
prop="materialSerialNumber"
>
<Input v-model="entity.materialSerialNumber"></Input> <Input v-model="entity.materialSerialNumber"></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="6"> <Col :span="6">
<FormItem :label="l('materialCertificationNumber')" prop="materialCertificationNumber"> <FormItem
:label="l('materialCertificationNumber')"
prop="materialCertificationNumber"
>
<Input v-model="entity.materialCertificationNumber"></Input> <Input v-model="entity.materialCertificationNumber"></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="6"> <Col :span="6">
<FormItem :label="l('productQuantity')" prop="productQuantity"> <FormItem :label="l('productQuantity')" prop="productQuantity">
<Input v-model="entity.productQuantity" :disabled="isDisabled"></Input> <Input
v-model="entity.productQuantity"
:disabled="isDisabled"
></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24" style="margin:20px 0;"> <Col :span="24" style="margin: 20px 0">
<div style="margin-left:10px;font-weight:bold">检验内容</div> <div style="margin-left: 10px; font-weight: bold">检验内容</div>
<div class="jy-boder"></div> <div class="jy-boder"></div>
</Col> </Col>
<Col :span="24" style="padding:20px 0 0px 10px;margin-bottom:10px;" class="table-solt"> <Col
<Table border :columns="columns" :data="checkList" class="tableCommon"> :span="24"
style="padding: 20px 0 0px 10px; margin-bottom: 10px"
class="table-solt"
>
<Table
border
:columns="columns"
:data="checkList"
class="tableCommon"
>
<template slot-scope="{ row, index }" slot="name"> <template slot-scope="{ row, index }" slot="name">
<Input v-model="row.name" placeholder="请输入" @on-blur="setRow(row,index)" /> <Input
v-model="row.name"
placeholder="请输入"
@on-blur="setRow(row, index)"
/>
</template> </template>
<template slot-scope="{ row, index }" slot="require"> <template slot-scope="{ row, index }" slot="require">
<Input v-model="row.require" placeholder="请输入" @on-blur="setRow(row,index)" /> <Input
v-model="row.require"
placeholder="请输入"
@on-blur="setRow(row, index)"
/>
</template> </template>
<template slot-scope="{ row, index }" slot="result"> <template slot-scope="{ row, index }" slot="result">
<Input v-model="row.result" placeholder="请输入" @on-blur="setRow(row,index)" /> <Input
v-model="row.result"
placeholder="请输入"
@on-blur="setRow(row, index)"
/>
</template> </template>
<template slot-scope="{ row, index }" slot="pash"> <template slot-scope="{ row, index }" slot="pash">
<inputFile v-model="row.file" :files="true" :parms="getParams(row.fileId)" /> <inputFile
v-model="row.file"
:files="true"
:parms="getParams(row.fileId)"
/>
</template> </template>
<template slot-scope="{ row, index }" slot="conclusion" class="dd"> <template slot-scope="{ row, index }" slot="conclusion" class="dd">
<Dictionary code="qms.certificate.conclusion" v-model="row.conclusion" type="select"></Dictionary> <Dictionary
code="qms.certificate.conclusion"
v-model="row.conclusion"
type="select"
></Dictionary>
</template> </template>
<template slot-scope="{ row, index }" slot="remark"> <template slot-scope="{ row, index }" slot="remark">
<Input v-model="row.remark" placeholder="请输入" @on-blur="setRow(row,index)" /> <Input
v-model="row.remark"
placeholder="请输入"
@on-blur="setRow(row, index)"
/>
</template> </template>
<template slot-scope="{ row, index }" slot="action"> <template slot-scope="{ row, index }" slot="action">
<a @click="remove(index)" style="color:#FF7A8B">删除</a> <a @click="remove(index)" style="color: #ff7a8b">删除</a>
</template> </template>
</Table> </Table>
</Col> </Col>
<Col :span="24" style="margin-bottom:20px;"> <Col :span="24" style="margin-bottom: 20px">
<Button type="primary" long @click="addNew" class="mt10">添加</Button> <Button type="primary" long @click="addNew" class="mt10">添加</Button>
</Col> </Col>
<Col :span="6"> <Col :span="6">
...@@ -117,7 +162,13 @@ ...@@ -117,7 +162,13 @@
<Checkbox v-model="submit" class="ml20">是否送审</Checkbox> <Checkbox v-model="submit" class="ml20">是否送审</Checkbox>
</FormItem> </FormItem>
</Form> </Form>
<Modal v-model="examineModal" title="合格证送审" footer-hide fullscreen :mask-closable="false"> <Modal
v-model="examineModal"
title="合格证送审"
footer-hide
fullscreen
:mask-closable="false"
>
<Examine :isId="isId" ref="examine"></Examine> <Examine :isId="isId" ref="examine"></Examine>
</Modal> </Modal>
</div> </div>
...@@ -213,14 +264,15 @@ export default { ...@@ -213,14 +264,15 @@ export default {
created() { created() {
this.addNew(); this.addNew();
this.isDisabled = true; this.isDisabled = true;
this.load(this.eid);
}, },
methods: { methods: {
load(v) { load(v) {
Api.getCertificate({ id: v }).then((r) => { Api.getCertificate({ id: v }).then((r) => {
this.entity = r.result;
let productSerialNumber = []; let productSerialNumber = [];
productSerialNumber = r.result.productSerialNumber.split(","); productSerialNumber = r.result.productSerialNumber.split(",");
r.result.productSerialNumber = productSerialNumber; this.entity.productSerialNumber = productSerialNumber.map(Number);
this.entity = r.result;
this.checkList = r.result.items; this.checkList = r.result.items;
console.log(this.entity); console.log(this.entity);
}); });
...@@ -234,7 +286,8 @@ export default { ...@@ -234,7 +286,8 @@ export default {
}, },
handleSubmit() { handleSubmit() {
this.entity.items = this.checkList; this.entity.items = this.checkList;
this.entity.items.forEach((c) => { this.entity.items.forEach((c, index) => {
c.index = index;
return delete c.id; return delete c.id;
}); });
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
......
...@@ -211,7 +211,7 @@ export default { ...@@ -211,7 +211,7 @@ export default {
disabled: false, disabled: false,
entity: { entity: {
id: 0, id: 0,
status: "", status: 0,
items: [], items: [],
}, },
rules: { rules: {
...@@ -225,6 +225,7 @@ export default { ...@@ -225,6 +225,7 @@ export default {
columns: [ columns: [
{ {
title: "序号", title: "序号",
// key: "index",
type: "index", type: "index",
width: 80, width: 80,
align: "center", align: "center",
...@@ -308,7 +309,8 @@ export default { ...@@ -308,7 +309,8 @@ export default {
let item = []; let item = [];
item = this.checkList; item = this.checkList;
if (item) { if (item) {
item.forEach((c) => { item.forEach((c, index) => {
c.index = index;
return delete c.id; return delete c.id;
}); });
} }
......
<template> <template>
<Layout class="full"> <Layout class="full">
<Sider hide-trigger v-if="showMenu" class="menu_side" width="300"> <Sider hide-trigger v-if="showMenu" class="menu_side" width="300">
<StoreTree @on-hide="onHide" @on-select="productSearch" /> <StoreTree @on-hide="onHide" @on-select="productSearch" />
</Sider> </Sider>
<!-- <Icon type="icon iconfont icondaochu" size="24" /> --> <!-- <Icon type="icon iconfont icondaochu" size="24" /> -->
<div v-if="!showMenu" class="show_menu"> <div v-if="!showMenu" class="show_menu">
<a class="menu_play fr" @click="showMenuFn" title="展开"> <a class="menu_play fr" @click="showMenuFn" title="展开">
<Icon type="ios-arrow-forward" size="24" /> <Icon type="ios-arrow-forward" size="24" />
</a> </a>
</div> </div>
<Content class="content" :class="!showMenu?'con_bord':''"> <Content class="content" :class="!showMenu ? 'con_bord' : ''">
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" :batch="true" :format="checkData" @all-change="allchange" @on-selection-change="onSelect" exportTitle="制造资源"> <DataGrid
<template slot="easySearch"> :columns="columns"
<Form ref="formInline" :model="easySearch" inline> ref="grid"
<FormItem prop="keys"> :action="action"
<Input clearable placeholder="请输入资源名称/资源编码/编码" v-model.trim="easySearch.keys.value" v-width="260" /> :conditions="easySearch"
</FormItem> :batch="true"
<FormItem> :format="checkData"
<Button type="primary" @click="search">查询</Button> @all-change="allchange"
</FormItem> @on-selection-change="onSelect"
<FormItem> exportTitle="制造资源"
<a href="#" @click="lendingRecord" class="ml20">借出记录</a> >
</FormItem> <template slot="easySearch">
</Form> <Form ref="formInline" :model="easySearch" inline>
</template> <FormItem prop="keys">
<template slot="buttons"> <Input
<Button type="primary" @click="add">入库</Button> clearable
<!-- <Button type="primary" @click="returnModel=true">归还</Button> --> placeholder="请输入资源名称/资源编码/编码"
<Badge :count="this.$store.state.count" overflow-count="99" style="margin-right:5px;" :offset='postion'> v-model.trim="easySearch.keys.value"
<Button icon="md-cart" @click="showCart">借出车</Button> v-width="260"
</Badge> />
<Button @click="openModalIm">导入</Button> </FormItem>
</template> <FormItem>
<template slot="batch"> <Button type="primary" @click="search">查询</Button>
<Button type="primary" class="mr10 ml10" @click="addCart">加入借出车</Button> </FormItem>
</template> <FormItem>
</DataGrid> <a href="#" @click="lendingRecord" class="ml20">借出记录</a>
<Modal v-model="modal" :title="title" width="1200" footer-hide :fullscreen="fscreeen"> </FormItem>
<component :is="detail" :eid="curId" :rootName="rootName" :storeTitle="storeTitle" :materialType="materialType" :codeRuleType="codeRuleType" :storeId="storeId" :mcode="mCode" :cartList="this.$u.clone(this.$store.state.cart)" @on-close="cancel" @on-ok="ok" @substr="substr" /> </Form>
</Modal> </template>
<ImportExcel ref="importExcel" @on-get-data="getData" modalTitle="制造资源" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" /> <template slot="buttons">
<Button type="primary" @click="add">入库</Button>
<!-- <Button type="primary" @click="returnModel=true">归还</Button> -->
<Badge
:count="this.$store.state.count"
overflow-count="99"
style="margin-right: 5px"
:offset="postion"
>
<Button icon="md-cart" @click="showCart">借出车</Button>
</Badge>
<Button @click="openModalIm">导入</Button>
</template>
<template slot="batch">
<Button type="primary" class="mr10 ml10" @click="addCart"
>加入借出车</Button
>
</template>
</DataGrid>
<Modal
v-model="modal"
:title="title"
width="1200"
footer-hide
:fullscreen="fscreeen"
>
<component
:is="detail"
:eid="curId"
:rootName="rootName"
:storeTitle="storeTitle"
:materialType="materialType"
:codeRuleType="codeRuleType"
:storeId="storeId"
:mcode="mCode"
:cartList="this.$u.clone(this.$store.state.cart)"
@on-close="cancel"
@on-ok="ok"
@substr="substr"
/>
</Modal>
<ImportExcel
ref="importExcel"
@on-get-data="getData"
modalTitle="制造资源"
:columns="columns"
:open="ModalIm"
@on-cancel="ModalImCancel"
@on-ok="ok"
/>
</Content> </Content>
</Layout> </Layout>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import Search from "./search"; import Search from "./search";
export default { export default {
name: "list", name: "list",
components: { components: {
Search, Search,
}, },
// head: { // head: {
// title: "库存表", // title: "库存表",
// author: "henq", // author: "henq",
// description: "stock 7/13/2020 11:48:09 AM", // description: "stock 7/13/2020 11:48:09 AM",
// }, // },
data() { data() {
return { return {
action: Api.index, action: Api.index,
showMenu: true, showMenu: true,
easySearch: { easySearch: {
keys: { keys: {
op: "nameOfResource,code,resourceCode", op: "nameOfResource,code,resourceCode",
value: null, value: null,
},
},
postion: [10, 10],
fscreeen: false,
modal: false,
title: "新增",
detail: null,
curId: 0,
storeId: null,
rootName: "",
storeTitle: "",
materialType: "",
mCode: "",
columns: [{
key: "selection",
type: "selection",
width: 50,
align: "center",
},
{
key: "id",
title: this.l("id"),
hide: true,
align: "left",
sortable: true,
},
{
key: "ico",
title: " ",
align: "center",
easy: true,
high: true,
width: 60,
render: (h, params) => {
return h(
"div", {
class: "action",
},
[
h(params.row.numberAvailable > 0 ? "op" : "", {
attrs: {
icon: "ios-cart-outline",
type: "icon",
},
on: {
click: () => this.addCart(params.row),
},
}),
]
);
},
},
{
key: "resourceCode",
title: this.l("resourceId"),
align: "left",
easy: true,
},
{
key: "nameOfResource",
title: this.l("nameOfResource"),
align: "left",
easy: true,
tooltip: true,
},
{
key: "code",
title: "编码",
align: "left",
},
// {
// key: "creationTime",
// title: this.l("creationTime"),
// sortable: true,
// hide: true,
// align: "left",
// },
{
key: "creatorUserId",
title: this.l("creatorUserId"),
hide: false,
type: "user",
align: "left",
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
hide: true,
align: "left",
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
hide: true,
align: "left",
},
{
key: "isDeleted",
title: this.l("isDeleted"),
hide: true,
align: "left",
},
{
key: "deletionTime",
title: this.l("deletionTime"),
hide: true,
align: "left",
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
hide: true,
align: "left",
},
// {
// key: "specifications",
// title: this.l("specifications"),
// align: "left",
// easy: true,
// high: true,
// },
{
key: "totalNum",
title: this.l("totalNum"),
align: "right",
easy: true,
},
{
key: "numberAvailable",
title: this.l("numberAvailable"),
align: "right",
easy: true,
},
{
key: "measuringUnit",
title: this.l("measuringUnit"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "qualityCharacteristics",
title: this.l("qualityCharacteristics"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "batchNo",
title: this.l("batchNo"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "storeId",
title: this.l("storeId"),
align: "left",
high: true,
hide: true,
},
{
key: "storeTitle",
title: this.l("storeTitle"),
align: "left",
},
{
key: "state",
title: this.l("state"),
align: "center",
code: "mes_xingchi_resource.resource.state",
},
// {
// key: "resourceType",
// title: this.l("resourceType"),
// align: "left",
// high: true,
// code: "mes_xingchi_resource.resource.resource_type",
// },
{
title: "操作",
width: 190,
align: "center",
key: "action",
hide: false,
render: (h, params) => {
return h(
"div", {
class: "action",
},
[
h(
"op", {
attrs: {
oprate: "delete",
title: "删除",
},
class: params.row.totalNum === params.row.numberAvailable ?
"remove" : "disable",
on: {
click: () => this.remove(params.row),
},
},
"删除"
),
h(
"op", {
attrs: {
oprate: "detail",
title: "查看日志",
},
on: {
click: () => this.logDetail(params.row.id),
},
},
"查看日志"
),
]
);
},
},
],
treeData: [],
ocolumn: [],
treeHeight: "",
ids: [],
list: [],
cartList: [],
cartListCount: 0,
selectRows: [],
//导入
ModalIm: false,
codeRuleType: null,
};
},
created() {
this.treeHeight = window.innerHeight - 150;
},
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.treeHeight = window.screenHeight - 150;
})();
};
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
computed: {},
methods: {
checkData(items) {
// console.warn("items", items);
return items.map((u) => {
u._disabled = u.numberAvailable <= 0;
u._checked = false;
return u;
});
}, },
},
allchange(item) { postion: [10, 10],
this.selectRows = []; fscreeen: false,
this.selectRows = item; modal: false,
title: "新增",
detail: null,
curId: 0,
storeId: null,
rootName: "",
storeTitle: "",
materialType: "",
mCode: "",
columns: [
{
key: "selection",
type: "selection",
width: 50,
align: "center",
}, },
onSelect(item) { {
this.selectRows = []; key: "id",
this.selectRows = item; title: this.l("id"),
hide: true,
align: "left",
sortable: true,
}, },
{
//加入借出车 key: "ico",
addCart(arr) { title: " ",
this.cartListCount = this.$store.state.count; align: "center",
this.cartList = this.$store.state.cart; easy: true,
// console.log(this.cartListCount); high: true,
// console.log(this.cartList); width: 60,
// console.log(this.selectRows); render: (h, params) => {
if (arr.id) { return h(
let id = arr.id; "Tooltip",
if (arr.numberAvailable > 0) { {
const index = this.$store.state.cart.findIndex(function (item) { class: "action",
return item.id === id; props: {
}); content: "请加入借出车",
// console.log(index); placement: "top",
if (index == -1) { },
arr.numberAvailable1 = arr.numberAvailable; //用于最大借出数量 },
this.cartList.push(arr); [
this.cartListCount += 1; h(params.row.numberAvailable > 0 ? "op" : "", {
this.$store.commit("setCart", this.cartList); attrs: {
this.$store.commit("setCartCount", this.cartListCount); icon: "ios-cart-outline",
this.$Message.success("加入借出车成功"); type: "icon",
} else { },
this.$Message.error("已加入借出车"); on: {
} click: () => this.addCart(params.row),
} else { },
this.$Message.error("资源无库存"); }),
} ]
} else { );
// this.$Message.success("已加入借出车,请在借出车查看"); },
let arr = this.selectRows.concat(this.cartList); //两个数组对象合并
let newArr = []; //盛放去重后数据的新数组
arr.forEach(function (item) {
let hasPush = false;
newArr.forEach((item2, index, thisArr) => {
if (item.id == item2.id) {
hasPush = true;
thisArr[index] = {
...item,
...item2,
};
return;
}
});
!hasPush && newArr.push(item);
});
this.cartList = newArr;
this.cartListCount = newArr.length;
this.$store.commit("setCart", this.cartList);
this.$store.commit("setCartCount", this.cartListCount);
this.$refs.grid.load();
this.$refs.grid.footerToolbar = false;
}
}, },
//移除借出车 {
substr(value, index) { key: "resourceCode",
// console.log(value); title: this.l("resourceId"),
// console.log(index); align: "left",
if (index > -1) { easy: true,
this.cartListCount -= value;
this.cartList.splice(index, 1);
if (value == 0 || this.cartList.length == 0) {
this.cartListCount = 0;
}
this.$store.commit("setCart", this.cartList);
this.$store.commit("setCartCount", this.cartListCount);
} else {
this.cartListCount = 0;
this.cartList = [];
this.$store.commit("setCart", this.cartList);
this.$store.commit("setCartCount", this.cartListCount);
}
// console.log(this.$store.state.count);
// console.log(this.$store.state.cart);
}, },
showCart() { {
if (this.$store.state.count > 0) { key: "nameOfResource",
this.title = "借出车"; title: this.l("nameOfResource"),
this.detail = () => import("./cart"); align: "left",
this.fscreeen = false; easy: true,
this.modal = true; tooltip: true,
} else {
this.$Message.error("请将资源加入借出车");
}
}, },
lendingRecord() { {
// window.open("/resource/resource/record", "_blank"); key: "code",
this.$router.push("/resource/resource/record"); title: "编码",
align: "left",
}, },
ok() { // {
this.$refs.grid.load(); // key: "creationTime",
this.modal = false; // title: this.l("creationTime"),
this.fscreeen = false; // sortable: true,
this.cartList = []; // hide: true,
// this.curId = 0; // align: "left",
// },
{
key: "creatorUserId",
title: this.l("creatorUserId"),
hide: false,
type: "user",
align: "left",
}, },
search() { {
this.$refs.grid.reload(this.easySearch); key: "lastModificationTime",
title: this.l("lastModificationTime"),
hide: true,
align: "left",
}, },
add() { {
if (this.curId) { key: "lastModifierUserId",
if (this.codeRuleType == 3) { title: this.l("lastModifierUserId"),
this.title = "新增"; hide: true,
this.detail = () => import("./add"); align: "left",
this.fscreeen = false;
this.modal = true;
} else {
this.$Message.error("请先选择正确的库房类型");
}
} else {
this.$Message.error("请先选择库房库位");
}
}, },
copy(id) { {
this.curId = id; key: "isDeleted",
this.title = "克隆"; title: this.l("isDeleted"),
this.detail = () => import("./add"); hide: true,
this.modal = true; align: "left",
}, },
{
remove(id) { key: "deletionTime",
Api.delete(id).then((r) => { title: this.l("deletionTime"),
if (r.success) { hide: true,
this.$refs.grid.load(); align: "left",
this.$Message.success("删除成功");
}
});
}, },
logDetail(id) { {
this.curId = id; key: "deleterUserId",
this.title = "查看日志"; title: this.l("deleterUserId"),
this.detail = () => import("./log"); hide: true,
this.fscreeen = false; align: "left",
this.modal = true;
}, },
cancel() {
this.curId = 0; // {
this.modal = false; // key: "specifications",
// title: this.l("specifications"),
// align: "left",
// easy: true,
// high: true,
// },
{
key: "totalNum",
title: this.l("totalNum"),
align: "right",
easy: true,
}, },
onHide() { {
// this.$Message.info("收起左侧树") key: "numberAvailable",
this.showMenu = false; title: this.l("numberAvailable"),
align: "right",
easy: true,
}, },
showMenuFn() { {
//this.$Message.info("展开左侧树") key: "measuringUnit",
this.showMenu = true; title: this.l("measuringUnit"),
align: "left",
easy: true,
high: true,
hide: true,
}, },
productSearch(item, ids, rootName) { {
// console.log(item); key: "qualityCharacteristics",
this.codeRuleType = null; title: this.l("qualityCharacteristics"),
this.curId = item.id; align: "left",
this.type = []; easy: true,
this.type = item.codeRuleType.split(","); high: true,
if (this.type) { hide: true,
this.type.forEach((e) => {
if (e == 3) {
this.codeRuleType = 3;
}
});
}
this.storeTitle = item.title;
this.rootName = rootName.join(" / ");
this.materialType = item.materialType;
let where = {
storeId: {
op: "In",
value: ids,
},
};
this.$refs.grid.reload(where);
}, },
setNum(row) { {
this.curId = row.id; key: "batchNo",
this.title = "预警"; title: this.l("batchNo"),
// this.detail = () => import("./setNum"); align: "left",
this.fscreeen = false; easy: true,
this.modal = true; high: true,
hide: true,
}, },
//批量导入start {
//导入功能 key: "storeId",
openModalIm() { title: this.l("storeId"),
this.ModalIm = true; align: "left",
high: true,
hide: true,
}, },
ModalImCancel() { {
this.ModalIm = false; key: "storeTitle",
title: this.l("storeTitle"),
align: "left",
}, },
getData(val) { {
let url = `${resourceUrl}/resourceimportservice/import`; key: "state",
this.$refs.importExcel.deelData( title: this.l("state"),
url, align: "center",
this.columns, code: "mes_xingchi_resource.resource.state",
this.formatMethod(val)
);
}, },
//根据页面二次处理数据 // {
formatMethod(val) { // key: "resourceType",
let tempData = this.$u.clone(val); // title: this.l("resourceType"),
let tempList = []; // align: "left",
tempData.forEach((ele) => { // high: true,
let obj = { // code: "mes_xingchi_resource.resource.resource_type",
nameOfResource: ele.nameOfResource ? ele.nameOfResource : "", // },
resourceCode: ele.resourceCode ? ele.resourceCode : "", {
code: ele.code ? ele.code : "", title: "操作",
totalNum: ele.totalNum ? ele.totalNum : 0, width: 190,
storeTitle: ele.storeTitle ? ele.storeTitle : "", align: "center",
storeId: ele.storeId ? ele.storeId : null, key: "action",
state: 1, hide: false,
numberAvailable: ele.numberAvailable ? ele.numberAvailable : 0, render: (h, params) => {
json: {}, return h(
}; "div",
if ( {
ele.nameOfResource && class: "action",
ele.nameOfResource != "" && },
ele.code && [
ele.code != "" && h(
ele.resourceCode && "op",
ele.resourceCode != "" {
) { attrs: {
obj.ico = false; oprate: "delete",
} else { title: "删除",
obj.ico = true; },
} class:
tempList.push(obj); params.row.totalNum === params.row.numberAvailable
}); ? "remove"
return tempList; : "disable",
on: {
click: () => this.remove(params.row),
},
},
"删除"
),
h(
"op",
{
attrs: {
oprate: "detail",
title: "查看日志",
},
on: {
click: () => this.logDetail(params.row.id),
},
},
"查看日志"
),
]
);
},
}, },
//批量导入end ],
l(key) { treeData: [],
let vkey = "resource" + "." + key; ocolumn: [],
return this.$t(vkey) || key; treeHeight: "",
ids: [],
list: [],
cartList: [],
cartListCount: 0,
selectRows: [],
//导入
ModalIm: false,
codeRuleType: null,
};
},
created() {
this.treeHeight = window.innerHeight - 150;
},
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.treeHeight = window.screenHeight - 150;
})();
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
computed: {},
methods: {
checkData(items) {
// console.warn("items", items);
return items.map((u) => {
u._disabled = u.numberAvailable <= 0;
u._checked = false;
return u;
});
},
allchange(item) {
this.selectRows = [];
this.selectRows = item;
},
onSelect(item) {
this.selectRows = [];
this.selectRows = item;
},
//加入借出车
addCart(arr) {
this.cartListCount = this.$store.state.count;
this.cartList = this.$store.state.cart;
// console.log(this.cartListCount);
// console.log(this.cartList);
// console.log(this.selectRows);
if (arr.id) {
let id = arr.id;
if (arr.numberAvailable > 0) {
const index = this.$store.state.cart.findIndex(function (item) {
return item.id === id;
});
// console.log(index);
if (index == -1) {
arr.numberAvailable1 = arr.numberAvailable; //用于最大借出数量
this.cartList.push(arr);
this.cartListCount += 1;
this.$store.commit("setCart", this.cartList);
this.$store.commit("setCartCount", this.cartListCount);
this.$Message.success("加入借出车成功");
} else {
this.$Message.error("已加入借出车");
}
} else {
this.$Message.error("资源无库存");
}
} else {
// this.$Message.success("已加入借出车,请在借出车查看");
let arr = this.selectRows.concat(this.cartList); //两个数组对象合并
let newArr = []; //盛放去重后数据的新数组
arr.forEach(function (item) {
let hasPush = false;
newArr.forEach((item2, index, thisArr) => {
if (item.id == item2.id) {
hasPush = true;
thisArr[index] = {
...item,
...item2,
};
return;
}
});
!hasPush && newArr.push(item);
});
this.cartList = newArr;
this.cartListCount = newArr.length;
this.$store.commit("setCart", this.cartList);
this.$store.commit("setCartCount", this.cartListCount);
this.$refs.grid.load();
this.$refs.grid.footerToolbar = false;
}
},
//移除借出车
substr(value, index) {
// console.log(value);
// console.log(index);
if (index > -1) {
this.cartListCount -= value;
this.cartList.splice(index, 1);
if (value == 0 || this.cartList.length == 0) {
this.cartListCount = 0;
}
this.$store.commit("setCart", this.cartList);
this.$store.commit("setCartCount", this.cartListCount);
} else {
this.cartListCount = 0;
this.cartList = [];
this.$store.commit("setCart", this.cartList);
this.$store.commit("setCartCount", this.cartListCount);
}
// console.log(this.$store.state.count);
// console.log(this.$store.state.cart);
},
showCart() {
if (this.$store.state.count > 0) {
this.title = "借出车";
this.detail = () => import("./cart");
this.fscreeen = false;
this.modal = true;
} else {
this.$Message.error("请将资源加入借出车");
}
},
lendingRecord() {
// window.open("/resource/resource/record", "_blank");
this.$router.push("/resource/resource/record");
},
ok() {
this.$refs.grid.load();
this.modal = false;
this.fscreeen = false;
this.cartList = [];
// this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
if (this.curId) {
if (this.codeRuleType == 3) {
this.title = "新增";
this.detail = () => import("./add");
this.fscreeen = false;
this.modal = true;
} else {
this.$Message.error("请先选择正确的库房类型");
}
} else {
this.$Message.error("请先选择库房库位");
}
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
logDetail(id) {
this.curId = id;
this.title = "查看日志";
this.detail = () => import("./log");
this.fscreeen = false;
this.modal = true;
},
cancel() {
this.curId = 0;
this.modal = false;
},
onHide() {
// this.$Message.info("收起左侧树")
this.showMenu = false;
},
showMenuFn() {
//this.$Message.info("展开左侧树")
this.showMenu = true;
},
productSearch(item, ids, rootName) {
// console.log(item);
this.codeRuleType = null;
this.curId = item.id;
this.type = [];
this.type = item.codeRuleType.split(",");
if (this.type) {
this.type.forEach((e) => {
if (e == 3) {
this.codeRuleType = 3;
}
});
}
this.storeTitle = item.title;
this.rootName = rootName.join(" / ");
this.materialType = item.materialType;
let where = {
storeId: {
op: "In",
value: ids,
}, },
};
this.$refs.grid.reload(where);
},
setNum(row) {
this.curId = row.id;
this.title = "预警";
// this.detail = () => import("./setNum");
this.fscreeen = false;
this.modal = true;
}, },
//批量导入start
//导入功能
openModalIm() {
this.ModalIm = true;
},
ModalImCancel() {
this.ModalIm = false;
},
getData(val) {
let url = `${resourceUrl}/resourceimportservice/import`;
this.$refs.importExcel.deelData(
url,
this.columns,
this.formatMethod(val)
);
},
//根据页面二次处理数据
formatMethod(val) {
let tempData = this.$u.clone(val);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
nameOfResource: ele.nameOfResource ? ele.nameOfResource : "",
resourceCode: ele.resourceCode ? ele.resourceCode : "",
code: ele.code ? ele.code : "",
totalNum: ele.totalNum ? ele.totalNum : 0,
storeTitle: ele.storeTitle ? ele.storeTitle : "",
storeId: ele.storeId ? ele.storeId : null,
state: 1,
numberAvailable: ele.numberAvailable ? ele.numberAvailable : 0,
json: {},
};
if (
ele.nameOfResource &&
ele.nameOfResource != "" &&
ele.code &&
ele.code != "" &&
ele.resourceCode &&
ele.resourceCode != ""
) {
obj.ico = false;
} else {
obj.ico = true;
}
tempList.push(obj);
});
return tempList;
},
//批量导入end
l(key) {
let vkey = "resource" + "." + key;
return this.$t(vkey) || key;
},
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
.full { .full {
margin-top: 0; margin-top: 0;
.content { .content {
margin-top: 6px; margin-top: 6px;
.ivu-icon-ios-add:before { .ivu-icon-ios-add:before {
content: "\f341"; content: "\f341";
} }
.ivu-icon-ios-remove:before { .ivu-icon-ios-remove:before {
content: "\f33d"; content: "\f33d";
}
} }
}
} }
</style> </style>
...@@ -116,12 +116,11 @@ export default { ...@@ -116,12 +116,11 @@ export default {
let obj = this.list[i]; let obj = this.list[i];
for (let j = 0; j < val.length; j++) { for (let j = 0; j < val.length; j++) {
if (obj.id == val[j]) { if (obj.id == val[j]) {
code.push(obj.code); code.push(obj.name);
type.push(obj.codeRuleType); type.push(obj.codeRuleType);
} }
} }
} }
this.entity.materialTypeName = code.join(","); this.entity.materialTypeName = code.join(",");
this.entity.codeRuleType = type.join(","); this.entity.codeRuleType = type.join(",");
}, },
......
...@@ -57,9 +57,7 @@ export default { ...@@ -57,9 +57,7 @@ export default {
materialType: [], materialType: [],
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
materialType: [ materialType: [{ required: true, message: "必填", trigger: "blur" }],
{ required: true, message: "必填", trigger: "blur", },
],
}, },
}; };
}, },
...@@ -101,7 +99,7 @@ export default { ...@@ -101,7 +99,7 @@ export default {
let obj = this.list[i]; let obj = this.list[i];
for (let j = 0; j < val.length; j++) { for (let j = 0; j < val.length; j++) {
if (obj.id == val[j]) { if (obj.id == val[j]) {
code.push(obj.code); code.push(obj.name);
type.push(obj.codeRuleType); type.push(obj.codeRuleType);
} }
} }
......
...@@ -94,15 +94,15 @@ export default { ...@@ -94,15 +94,15 @@ export default {
import: true, import: true,
}, },
{ // {
key: "materialType", // key: "materialType",
title: this.l("materialType"), // title: this.l("materialType"),
align: "center", // align: "center",
easy: true, // easy: true,
high: true, // high: true,
code: "mes_xingchi_resource.material.materialReType", // code: "mes_xingchi_resource.material.materialReType",
width: 100, // width: 100,
}, // },
{ {
key: "materialNumber", key: "materialNumber",
title: this.l("materialNumber"), title: this.l("materialNumber"),
......
...@@ -461,7 +461,7 @@ export default { ...@@ -461,7 +461,7 @@ export default {
} }
}) })
.catch((err) => { .catch((err) => {
this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err); console.warn(err);
}); });
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<fm-making-form ref="makingform" style="height: 880px;" :data="jsonData" generate-json> <fm-making-form ref="makingform" style="height: 880px;" :data="jsonData" generate-json>
<template slot="action"> <template slot="action">
<!-- 自定义操作区域插槽 --> <!-- 自定义操作区域插槽 -->
<el-button type="text" icon="el-icon-upload">保存</el-button> <el-button type="text" icon="el-icon-upload" v-noClick>保存</el-button>
</template> </template>
</fm-making-form> </fm-making-form>
</template> </template>
......
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