Commit 2c8fbb84 authored by 仇晓婷's avatar 仇晓婷

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

parents 56f858f0 40bf3fd1
...@@ -1296,7 +1296,7 @@ html [type=button] { ...@@ -1296,7 +1296,7 @@ html [type=button] {
left: 0; left: 0;
text-align: center; text-align: center;
padding: 20px 0; padding: 20px 0;
background: #08080894; background: #080808;
div { div {
height: 25px; height: 25px;
......
...@@ -920,7 +920,7 @@ export default { ...@@ -920,7 +920,7 @@ export default {
productId: '产品Id', productId: '产品Id',
quantity: '数量', quantity: '数量',
remark: '备注', remark: '备注',
taskRequire: '任务节点要求', taskRequire: '任务要求',
status: '订单状态', status: '订单状态',
divideMark: '分解标记:1-已分解;0-未分解', divideMark: '分解标记:1-已分解;0-未分解',
productCode: '产品序号:No1~No99', productCode: '产品序号:No1~No99',
...@@ -930,13 +930,13 @@ export default { ...@@ -930,13 +930,13 @@ export default {
batchNumber: '批次号', batchNumber: '批次号',
projectNumber: '项目号', projectNumber: '项目号',
urgencyLevel: '紧急程度', urgencyLevel: '紧急程度',
productingPreparationPeople: '生产准备(主制车间)', productingPreparationPeople: '生产车间',
productingPreparationFinishDate: '生产准备完成时间', productingPreparationFinishDate: '生产完成时间',
quotationPeople: '订单报价人员', quotationPeople: '订单报价人员',
quotationFinishDate: '订单报价完成时间', quotationFinishDate: '订单报价完成时间',
upId: '父订单id', upId: '父订单id',
demandStartDate: '投料时间', demandStartDate: '开始时间',
demandFinishDate: '节点时间', demandFinishDate: '完成时间',
//tempTitle------ //tempTitle------
stage: '阶段', stage: '阶段',
materialId: '材料', materialId: '材料',
......
...@@ -150,9 +150,9 @@ export default { ...@@ -150,9 +150,9 @@ export default {
modalAccessory: false, modalAccessory: false,
columns: [{ columns: [{
key: "selection", key: "selection",
title: "#", title: '多选',
type: "selection", type: "selection",
width: 70, width: 50,
align: "center", align: "center",
}, },
{ {
...@@ -259,13 +259,13 @@ export default { ...@@ -259,13 +259,13 @@ export default {
high: true, high: true,
hide: true, hide: true,
}, },
{ // {
key: "spareQty", // key: "spareQty",
title: this.l("spareQty"), // title: this.l("spareQty"),
align: "left", // align: "left",
high: true, // high: true,
hide: true, // hide: true,
}, // },
{ {
key: "isPreschedule", key: "isPreschedule",
title: this.l("isPreschedule"), title: this.l("isPreschedule"),
...@@ -274,28 +274,28 @@ export default { ...@@ -274,28 +274,28 @@ export default {
high: true, high: true,
code: "aps.plan.ispreschedule", code: "aps.plan.ispreschedule",
}, },
{ // {
key: "demandStart", // key: "demandStart",
title: this.l("demandStart"), // title: this.l("demandStart"),
align: "left", // align: "left",
high: true, // high: true,
hide: true, // hide: true,
}, // },
{ // {
key: "demandFinish", // key: "demandFinish",
title: this.l("demandFinish"), // title: this.l("demandFinish"),
align: "left", // align: "left",
high: true, // high: true,
hide: true, // hide: true,
}, // },
{ // {
key: "partNamePro", // key: "partNamePro",
title: this.l("partNamePro"), // title: this.l("partNamePro"),
align: "left", // align: "left",
easy: true, // easy: true,
high: true, // high: true,
hide: true, // hide: true,
}, // },
{ {
title: "操作", title: "操作",
key: "action", key: "action",
......
<template> <template>
<div style="padding:30px 0"> <div style="padding:30px 0">
<Detail :idVal="detailId" /> <Detail :idVal="detailId" />
<Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" @node-click="show"/> <Process ref="userProcess" :idVal="detailId" :resulstInfo="testObj" @node-click="show" />
<!-- <Footer :idVal="detailId" :footerStatu="footerStatu" @showModalCheckOk='modalCheckOk=true'></Footer> --> <!-- <Footer :idVal="detailId" :footerStatu="footerStatu" @showModalCheckOk='modalCheckOk=true'></Footer> -->
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;"> <div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form <Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
:model="formMyCheck" <Row>
:label-width="100" <Col span="18">
:rules="ruleValidate" <FormItem label="审批意见:">
inline <RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
ref="formValidate" <Radio label="通过"></Radio>
> <Radio label="驳回"></Radio>
<Row> <Radio label="终止"></Radio>
<Col span="18"> </RadioGroup>
<FormItem label="审批意见:"> </FormItem>
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px"> <FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<Radio label="通过"></Radio> <Select style="width:200px" clearable transfer placeholder="请选择驳回节点" v-model="formMyCheck.rejectToNodeId">
<Radio label="驳回"></Radio> <Option value class="option-text">请选择驳回节点</Option>
<Radio label="终止"></Radio> <Option v-for="(item, index) in nodeList" :value="item.value" :label="item.label" :key="index" :disabled="item.statu > 0 ? false : true"></Option>
</RadioGroup> </Select>
</FormItem> <RadioGroup type="button" size="small" @on-change="changeToNode">
<FormItem <Radio label="1">上一节点</Radio>
label="驳回节点:" <Radio label="2">第一节点</Radio>
v-if="formMyCheck.radioSp === '驳回'" </RadioGroup>
prop="rejectToNodeId" </FormItem>
> <FormItem label="原因:" v-if="
<Select
style="width:200px"
clearable
transfer
placeholder="请选择驳回节点"
v-model="formMyCheck.rejectToNodeId"
>
<Option value class="option-text">请选择驳回节点</Option>
<Option
v-for="(item, index) in nodeList"
:value="item.value"
:label="item.label"
:key="index"
:disabled="item.statu > 0 ? false : true"
></Option>
</Select>
<RadioGroup type="button" size="small" @on-change="changeToNode">
<Radio label="1">上一节点</Radio>
<Radio label="2">第一节点</Radio>
</RadioGroup>
</FormItem>
<FormItem
label="原因:"
v-if="
formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止' formMyCheck.radioSp === '驳回' || formMyCheck.radioSp === '终止'
" " prop="comment">
prop="comment" <Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
> </FormItem>
<Input </Col>
v-model="formMyCheck.comment" <Col span="6" style="text-align:right;padding-right:40px">
style="width:400px;margin-left:10px" <Button type="primary" @click="nextCheckOk">下一步</Button>
placeholder="请输入原因" </Col>
/> </Row>
</FormItem> </Form>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div> </div>
<!-- 订单审里通过form --> <!-- 订单审核通过form -->
<Modal <Modal v-model="modalCheckOk" title="订单审核" width="800" :scrollable="true">
v-model="modalCheckOk" <Form :model="formMyCheck" :label-width="100" v-if="false">
title="订单审里" <Row>
width="800" <Col span="12">
:scrollable="true" <FormItem label="工时:" style="width:100%">
> <InputNumber v-model="formMyCheck.workHours" :step="1" :min="2" style="width:240px" />
<Form :model="formMyCheck" :label-width="100"> </FormItem>
<Row> </Col>
<Col span="12"> <Col span="12">
<FormItem label="工时:" style="width:100%"> <FormItem label="打印周期:" style="width:100%">
<InputNumber <InputNumber v-model="formMyCheck.printPeriod" :step="1" :min="2" style="width:240px" />
v-model="formMyCheck.workHours" </FormItem>
:step="1" </Col>
:min="2" </Row>
style="width:240px" <Row>
/> <Col span="12">
</FormItem> <FormItem label="设备:" style="width:100%">
</Col> <Input v-model="formMyCheck.equipment" style="width:240px" />
<Col span="12"> </FormItem>
<FormItem label="打印周期:" style="width:100%"> </Col>
<InputNumber <Col span="12">
v-model="formMyCheck.printPeriod" <FormItem label="材料重量:" style="width:100%">
:step="1" <Input v-model="formMyCheck.materialWeight" style="width:240px" />
:min="2" </FormItem>
style="width:240px" </Col>
/> </Row>
</FormItem> </Form>
</Col> <br />
</Row> <h4>
<Row> 您确定 <span class="new-red">通过</span> 此订单审批?
<Col span="12"> </h4>
<FormItem label="设备:" style="width:100%"> <br />
<Input v-model="formMyCheck.equipment" style="width:240px" /> <div slot="footer">
</FormItem> <Button @click="modalCheckOk = false">取消</Button>
</Col> <Button type="primary" @click="checkOk" v-show="footerStatue">确定</Button>
<Col span="12"> </div>
<FormItem label="材料重量:" style="width:100%">
<Input v-model="formMyCheck.materialWeight" style="width:240px" />
</FormItem>
</Col>
</Row>
</Form>
<div slot="footer">
<Button @click="modalCheckOk = false">取消</Button>
<Button type="primary" @click="checkOk" v-show="footerStatue">确定</Button>
</div>
</Modal> </Modal>
<Modal <Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true">
v-model="modalCheckNo" <br />
title="订单审批" <h4>
width="800" 您确定 <span class="new-red">{{ statuTitle }}</span> 此订单审批?
:scrollable="true" </h4>
> <br />
<br /> <div slot="footer">
<h4> <Button @click="modalCheckNo = false">取消</Button>
您确定 <span class="new-red">{{ statuTitle }}</span> 此订单审批? <Button type="primary" @click="checkFalse">确定</Button>
</h4> </div>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from '../api'
import Detail from './detail' import Detail from './detail'
import Process from '../process' import Process from '../process'
export default { export default {
layout: 'empty', layout: 'empty',
name: 'Index', name: 'Index',
components: { components: {
Detail, Detail,
Process, Process,
},
data() {
return {
currentUserId: 0,
formMyCheck: {
radioSp: '通过',
comment: '',
workHours: 0, //工时
printPeriod: 0, //打印周期
equipment: '', //设备
materialWeight: 0, //材料重量
rejectToNodeId: null
},
modalCheckOk: false,
footerStatue:true,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [
{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}
],
comment: [
{
required: true,
message: '请输入原因',
trigger: 'blur'
}
]
}
}
},
props: {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
// await store.dispatch("loadUsers");//加载缓存的用户
},
created() {
this.currentUserId=this.$store.state.userInfo.userId
this.detailId = this.$http.common.getquerystring('id')
this.footerStatu = this.$http.common.getquerystring('statu')
this.getDetailInfos(this.detailId)
},
methods: {
nextCheckOk() {
if (this.formMyCheck.radioSp == '通过') {
this.footerStatue=true
this.modalCheckOk = true
} else if (this.formMyCheck.radioSp == '驳回') {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '驳回'
} else {
}
})
} else {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '终止'
} else {
}
})
}
},
show(a){
this.footerStatue=false
let contextDate=JSON.parse(a.contextData)
this.formMyCheck=contextDate
this.modalCheckOk=true
}, },
getDetailInfos(idVal) { data() {
this.getDetailRecords = [] return {
let param = { currentUserId: 0,
Id: idVal formMyCheck: {
} radioSp: '通过',
Api.getdetail(param).then((r) => { comment: '',
this.testObj = r workHours: 0, //工时
if (r.success) { printPeriod: 0, //打印周期
this.currentNodeID = r.result.currentNodeId equipment: '', //设备
this.passId=r.result.currentRecordId materialWeight: 0, //材料重量
this.nextNodeUserIdList=this.$refs.userProcess.immutData//获取下一节点的审核人 rejectToNodeId: null
this.getNodes(r.result.nodes) },
} else { modalCheckOk: false,
this.$Message.error('加载失败') footerStatue: true,
modalCheckNo: false,
detailId: null,
statuTitle: '',
footerStatu: null, //是否显示footer
getDetailResults: [], //getdetail返回数据
getDetailResultOrder: [], //getdetail返回订单detail数据
getDetailProcess: [], //getdetail返回process信息
getDetailRecords: [], //getdetail返回当前records信息
passId: null, //通过审批/驳回/终止接口 id,
nodeList: [], //返回节点
currentNodeID: null, //当前节点
firstNodeID: null, //第一个节点
preNodeID: null, //上一个节点
nextNodeUserIdList: [], //通过时提交的下一个节点UserId
testObj: {},
ruleValidate: {
rejectToNodeId: [{
required: true,
message: '请选择驳回节点',
type: 'number',
trigger: 'change'
}],
comment: [{
required: true,
message: '请输入原因',
trigger: 'blur'
}]
}
} }
})
},
//根据当前登录用户返回records的id
getRecordsId(records) {
records.forEach((data) => {
if (data.operatorId == this.currentUserId) {
this.passId = data.id
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
//根据当前nodeid找到下一节点的defaultUser
// this.nextNodeUserIdList = []
// if (index + 1 < nodes.length) {
// this.nextNodeUserIdList = nodes[index + 1].defaultUsers.immutable
// }
//返回当前节点的records,用于查找在records里当前登录用户的对应的id
//this.getDetailRecords = nodes[index].records
//this.getRecordsId(this.getDetailRecords)
}, },
changeToNode(val) { props: {},
if (val == '1') { async fetch({
this.formMyCheck.rejectToNodeId = this.preNodeID store,
} else { params
this.formMyCheck.rejectToNodeId = this.firstNodeID }) {
} await store.dispatch('loadDictionary') // 加载数据字典
// await store.dispatch("loadUsers");//加载缓存的用户
}, },
//审批通过 created() {
checkOk() { this.currentUserId = this.$store.state.userInfo.userId
let param = { this.detailId = this.$http.common.getquerystring('id')
id: this.passId, this.footerStatu = this.$http.common.getquerystring('statu')
comment: '', this.getDetailInfos(this.detailId)
nextOperationIdList: this.nextNodeUserIdList,
data: {
workHours: this.formMyCheck.workHours,
printPeriod: this.formMyCheck.printPeriod,
equipment: this.formMyCheck.equipment,
materialWeight: this.formMyCheck.materialWeight
}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckOk = false
},
//审批驳回
checkNo() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
}, },
//审批终止 methods: {
checkCancel() { nextCheckOk() {
let param = { if (this.formMyCheck.radioSp == '通过') {
id: this.passId, this.footerStatue = true
comment: this.formMyCheck.comment this.modalCheckOk = true
} } else if (this.formMyCheck.radioSp == '驳回') {
Api.terminate(param).then((r) => { this.$refs['formValidate'].validate((valid) => {
if (r.success) { if (valid) {
this.$Message.success('终止审批成功') this.modalCheckNo = true
this.footerStatu = 3 this.statuTitle = '驳回'
} else { } else {}
this.$Message.error('加载失败') })
} else {
this.$refs['formValidate'].validate((valid) => {
if (valid) {
this.modalCheckNo = true
this.statuTitle = '终止'
} else {}
})
}
},
show(a) {
this.footerStatue = false
let contextDate = JSON.parse(a.contextData)
this.formMyCheck = contextDate
this.modalCheckOk = true
},
getDetailInfos(idVal) {
this.getDetailRecords = []
let param = {
Id: idVal
}
Api.getdetail(param).then((r) => {
this.testObj = r
if (r.success) {
this.currentNodeID = r.result.currentNodeId
this.passId = r.result.currentRecordId
this.nextNodeUserIdList = this.$refs.userProcess.immutData //获取下一节点的审核人
this.getNodes(r.result.nodes)
} else {
this.$Message.error('加载失败')
}
})
},
//根据当前登录用户返回records的id
getRecordsId(records) {
records.forEach((data) => {
if (data.operatorId == this.currentUserId) {
this.passId = data.id
}
})
},
//获取流程节点
getNodes(nodes) {
this.nodeList = []
nodes.forEach((data) => {
let nodeObj = {}
nodeObj.value = data.id
nodeObj.label = data.name
nodeObj.statu = 1
this.nodeList.push(nodeObj)
})
//第一节点node的ID
this.firstNodeID = this.nodeList[0].value
//根据当前nodeid找到上一节点的nodeId
var index = this.nodeList.findIndex(
(item) => item.value == this.currentNodeID
)
if (index > 0) {
this.preNodeID = this.nodeList[index - 1].value
} else {
this.preNodeID = this.nodeList[0].value
}
//根据当前nodeid找到下一节点的defaultUser
// this.nextNodeUserIdList = []
// if (index + 1 < nodes.length) {
// this.nextNodeUserIdList = nodes[index + 1].defaultUsers.immutable
// }
//返回当前节点的records,用于查找在records里当前登录用户的对应的id
//this.getDetailRecords = nodes[index].records
//this.getRecordsId(this.getDetailRecords)
},
changeToNode(val) {
if (val == '1') {
this.formMyCheck.rejectToNodeId = this.preNodeID
} else {
this.formMyCheck.rejectToNodeId = this.firstNodeID
}
},
//审批通过
checkOk() {
let param = {
id: this.passId,
comment: '',
nextOperationIdList: this.nextNodeUserIdList,
data: null,
// {
// workHours: this.formMyCheck.workHours,
// printPeriod: this.formMyCheck.printPeriod,
// equipment: this.formMyCheck.equipment,
// materialWeight: this.formMyCheck.materialWeight
//}
}
Api.pass(param).then((r) => {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu = 3
} else {
this.$Message.error('审批通过失败')
}
})
this.modalCheckOk = false
},
//审批驳回
checkNo() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment,
rejectToNodeId: this.formMyCheck.rejectToNodeId
}
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//审批终止
checkCancel() {
let param = {
id: this.passId,
comment: this.formMyCheck.comment
}
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
}
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
this.footerStatu = 3
},
l(key) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
} }
this.modalCheckNo = false
})
},
//终止或驳回
checkFalse() {
if (this.formMyCheck.radioSp == '驳回') {
this.checkNo()
} else if (this.formMyCheck.radioSp == '终止') {
this.checkCancel()
}
this.footerStatu = 3
}, },
l(key) { watch: {}
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
} }
</script> </script>
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
productId: null, //产品id productId: null, //产品id
productName: "", //产品名称 productName: "", //产品名称
drawnNumber: null, //图号 drawnNumber: null, //图号
taskType: null, //任务类型 taskType: 1, //任务类型
quantity: 1, //数量 quantity: 1, //数量
taskRequire: "", //任务接点要求 taskRequire: "", //任务接点要求
demandStartDate: this.getFormatDate(nowDate), //开始时间 demandStartDate: this.getFormatDate(nowDate), //开始时间
...@@ -114,7 +114,7 @@ export default { ...@@ -114,7 +114,7 @@ export default {
remark: "", //备注 remark: "", //备注
projectNumber: "", //项目号 projectNumber: "", //项目号
batchNumber: "", //批次号 batchNumber: "", //批次号
urgencyLevel: null, //紧急程度 urgencyLevel: 1, //紧急程度
bomId: null, bomId: null,
}, },
ruleValidate: { ruleValidate: {
...@@ -147,7 +147,9 @@ export default { ...@@ -147,7 +147,9 @@ export default {
wfstatu: 1, wfstatu: 1,
}; };
}, },
created() {},
mounted() { mounted() {
let params = { let params = {
id: "123327da-42b3-41f6-b785-cf933f137a95", id: "123327da-42b3-41f6-b785-cf933f137a95",
}; };
...@@ -161,8 +163,8 @@ export default { ...@@ -161,8 +163,8 @@ export default {
} }
} }
}); });
this.loadTree(); this.loadTree();
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
...@@ -173,6 +175,7 @@ export default { ...@@ -173,6 +175,7 @@ export default {
.then((r) => { .then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.resetFields();
this.$emit("on-ok"); this.$emit("on-ok");
} else { } else {
this.$Message.error("保存失败"); this.$Message.error("保存失败");
...@@ -215,10 +218,11 @@ export default { ...@@ -215,10 +218,11 @@ export default {
}, },
resetFields() { resetFields() {
this.orderSearchForm = { this.orderSearchForm = {
productId: null, //产品id productId: null, //产品id
productName: "", //产品名称 productName: "", //产品名称
drawnNumber: null, //图号 drawnNumber: null, //图号
taskType: null, //任务类型 taskType: 1, //任务类型
quantity: 1, //数量 quantity: 1, //数量
taskRequire: "", //任务接点要求 taskRequire: "", //任务接点要求
demandStartDate: this.getFormatDate(nowDate), //开始时间 demandStartDate: this.getFormatDate(nowDate), //开始时间
...@@ -226,7 +230,7 @@ export default { ...@@ -226,7 +230,7 @@ export default {
remark: "", //备注 remark: "", //备注
projectNumber: "", //项目号 projectNumber: "", //项目号
batchNumber: "", //批次号 batchNumber: "", //批次号
urgencyLevel: null, //紧急程度 urgencyLevel: 1, //紧急程度
}; };
}, },
loadTree() { loadTree() {
......
<template> <template>
<div class="orderDetail"> <div class="orderDetail">
<Row> <Row>
<Col span="8"> <Col span="8">
<span class="fwBold">{{l('mesCode')}}</span> <span class="fwBold">{{l('mesCode')}}</span>
<p>{{entity.mesCode}}</p> <p>{{entity.mesCode}}</p>
</Col> </Col>
<Col span="8"> <Col span="8">
<span class="fwBold">{{l('taskType')}}</span> <span class="fwBold">{{l('taskType')}}</span>
<p> <state code="plan.order.taskType" :value="entity.taskType" type="text"></state></p> <p>
</Col> <state code="plan.order.taskType" :value="entity.taskType" type="text"></state>
<Col span="8"> </p>
</Col>
<Col span="8">
<span class="fwBold">{{l('quantity')}}</span> <span class="fwBold">{{l('quantity')}}</span>
<p>{{entity.quantity}}</p> <p>{{entity.quantity}}</p>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="8"> <Col span="8">
<span class="fwBold">{{l('status')}}</span> <span class="fwBold">{{l('status')}}</span>
<p><state code="plan.order.status" :value="entity.status" type="text"></state></p> <p>
</Col> <state code="plan.order.status" :value="entity.status" type="text"></state>
<Col span="8"> </p>
</Col>
<Col span="8">
<span class="fwBold">{{l('productName')}}</span> <span class="fwBold">{{l('productName')}}</span>
<p>{{entity.productName}}</p> <p>{{entity.productName}}</p>
</Col> </Col>
<Col span="8"> <Col span="8">
<span class="fwBold">{{l('drawnNumber')}}</span> <span class="fwBold">{{l('drawnNumber')}}</span>
<p>{{entity.drawnNumber}}</p> <p>{{entity.drawnNumber}}</p>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="8"> <Col span="8">
<span class="fwBold">{{l('batchNumber')}}</span> <span class="fwBold">{{l('batchNumber')}}</span>
<p>{{entity.batchNumber}}</p> <p>{{entity.batchNumber}}</p>
</Col> </Col>
<Col span="8"> <Col span="8">
<span class="fwBold">{{l('projectNumber')}}</span> <span class="fwBold">{{l('projectNumber')}}</span>
<p>{{entity.projectNumber}}</p> <p>{{entity.projectNumber}}</p>
</Col> </Col>
<Col span="8"> <Col span="8">
<span class="fwBold">{{l('urgencyLevel')}}</span> <span class="fwBold">{{l('urgencyLevel')}}</span>
<p><state code="plan.order.urgencyLevel" :value="entity.urgencyLevel" type="text"></state></p> <p>
</Col> <state code="plan.order.urgencyLevel" :value="entity.urgencyLevel" type="text"></state>
</p>
</Col>
</Row> </Row>
<Row> <Row>
<Col span="8"> <Col span="8">
<span class="fwBold">{{l('demandStartDate')}}</span> <span class="fwBold">{{l('demandStartDate')}}</span>
<p><DTSpan type="date" v-model="entity.demandStartDate"></DTSpan></p> <p>
</Col> <DTSpan type="date" v-model="entity.demandStartDate"></DTSpan>
<Col span="8"> </p>
</Col>
<Col span="8">
<span class="fwBold">{{l('demandFinishDate')}}</span> <span class="fwBold">{{l('demandFinishDate')}}</span>
<p><DTSpan type="date" v-model="entity.demandFinishDate"></DTSpan></p> <p>
</Col> <DTSpan type="date" v-model="entity.demandFinishDate"></DTSpan>
<Col span="8"> </p>
</Col>
<Col span="8">
<span class="fwBold">{{l('taskRequire')}}</span> <span class="fwBold">{{l('taskRequire')}}</span>
<p>{{entity.taskRequire}}</p> <p>{{entity.taskRequire}}</p>
</Col> </Col>
</Row>
<Row>
<Col span="8">
<span class="fwBold">{{l('productingPreparationPeople')}}</span>
<p>
<WorkShopName v-model="entity.productingPreparationPeople" v-if="entity.productingPreparationPeople>0"></WorkShopName>
</p>
</Col>
<Col span="8">
<span class="fwBold">{{l('quotationPeople')}}</span>
<p>
<User v-model="entity.quotationPeople" v-if="entity.quotationPeople>0"></User>
</p>
</Col>
<Col span="8">
<span class="fwBold">&nbsp;</span>
<p>&nbsp;</p>
</Col>
</Row> </Row>
<Row class="lastRow"> <Row class="lastRow">
<Col span="24"> <Col span="24">
<span class="fwBold">{{l('remark')}}</span> <span class="fwBold">{{l('remark')}}</span>
<p>{{entity.remark}}</p> <p>{{entity.remark}}</p>
</Col> </Col>
</Row> </Row>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
name: "detail", name: "detail",
data() { data() {
return { return {
entity: {} entity: {}
}; };
},
props: {
row: {
type: Object,
default: () => {
return null;
}
}
},
methods: {
handleClose() {
this.$emit("on-close");
}, },
l(key) { props: {
key = "mes_plan" + "." + key; row: {
return this.$t(key); type: Object,
} default: () => {
}, return null;
watch: { }
row(v) { }
if (v != null) { },
this.entity = this.$u.clone(this.row); methods: {
} handleClose() {
this.$emit("on-close");
},
l(key) {
key = "mes_plan" + "." + key;
return this.$t(key);
}
},
watch: {
row(v) {
if (v != null) {
this.entity = this.$u.clone(this.row);
}
}
} }
}
}; };
</script> </script>
<style lang="less"> <style lang="less">
.orderDetail .orderDetail {
{ line-height: 30px;
line-height: 30px; width: 90%;
width: 90%; margin: 0 auto;
margin: 0 auto;
.ivu-row{ .ivu-row {
padding-top: 20px; padding-top: 20px;
padding-bottom: 20px; padding-bottom: 20px;
border-bottom:#ccc solid 1px; border-bottom: #ccc solid 1px;
} }
.lastRow
{ .lastRow {
border-bottom:none; border-bottom: none;
} }
} }
</style> </style>
...@@ -163,15 +163,16 @@ export default { ...@@ -163,15 +163,16 @@ export default {
.then((r) => { .then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
//this.resetFields()
this.$emit("on-ok"); this.$emit("on-ok");
} else { } else {
this.$Message.error("保存失败"); this.$Message.error("保存失败");
} }
}) })
.catch((err) => { // .catch((err) => {
this.$Message.error("保存失败"); // this.$Message.error("保存失败");
console.warn(err); // console.warn(err);
}); // });
} }
}); });
}, },
......
...@@ -141,15 +141,11 @@ export default { ...@@ -141,15 +141,11 @@ export default {
id: "id", id: "id",
columns: [{ columns: [{
key: "selection", key: "selection",
title: '多选',
type: "selection", type: "selection",
width: 50, width: 50,
align: "center" align: "center"
}, },
{
key: "id",
title: this.l("id"),
hide: true
},
{ {
key: "mesCode", key: "mesCode",
title: this.l("mesCode"), title: this.l("mesCode"),
......
<template> <template>
<div style="width:100%;margin:0 auto"> <div style="width:100%;margin:0 auto">
<Detail ref="detailRow" :row="row1" v-show="dataList.length==1"></Detail> <Detail ref="detailRow" :row="row1" v-show="dataList.length==1"></Detail>
<Table <Table border :columns="columns1" :data="dataList" class="tableCommon" v-show="dataList.length>1" :height="tbHeight"></Table>
border
:columns="columns1"
:data="dataList"
class="tableCommon"
v-show="dataList.length>1"
:height="tbHeight"
></Table>
<div style="width100%;margin:40px auto"> <div style="width100%;margin:40px auto">
<Form <Form :model="orderForm" :label-width="140" class="margin-top-20 margin-bottom-50" :rules="ruleValidate" ref="formValidate">
:model="orderForm" <Row>
:label-width="110" <Col span="6">
class="margin-top-20 margin-bottom-50" <FormItem label="生产车间" style="width:100%" prop="ProductingPreparationPeople">
:rules="ruleValidate" <WorkShopSelect ref="userSelected" v-model="orderForm.ProductingPreparationPeople" />
ref="formValidate" </FormItem>
> </Col>
<Row> <Col span="6">
<Col span="6"> <FormItem label="生产完成时间" style="width:100%" prop="ProductingPreparationFinishDate">
<FormItem label="生产车间" style="width:100%" prop="ProductingPreparationPeople"> <DatePicker v-model="orderForm.ProductingPreparationFinishDate" type="date" placeholder="请选择日期" @on-change="getTimeProductPFD"></DatePicker>
<WorkShopSelect ref="userSelected" v-model="orderForm.ProductingPreparationPeople" /> </FormItem>
</FormItem> </Col>
</Col> <Col span="6">
<Col span="6"> <FormItem label="订单报价人员" style="width:100%" prop="QuotationPeople">
<FormItem label="完成时间" style="width:100%" prop="ProductingPreparationFinishDate"> <UserSelect ref="userSelected" v-model="orderForm.QuotationPeople" />
<DatePicker </FormItem>
v-model="orderForm.ProductingPreparationFinishDate" </Col>
type="date" <Col span="6">
placeholder="请选择日期" <FormItem label="订单报价完成时间" style="width:100%" prop="QuotationFinishDate">
@on-change="getTimeProductPFD" <DatePicker v-model="orderForm.QuotationFinishDate" type="date" placeholder="请选择日期" @on-change="getTimeQuotationFD"></DatePicker>
></DatePicker> </FormItem>
</FormItem> </Col>
</Col> </Row>
<Col span="6"> </Form>
<FormItem label="订单报价人员" style="width:100%" prop="QuotationPeople">
<UserSelect ref="userSelected" v-model="orderForm.QuotationPeople" />
</FormItem>
</Col>
<Col span="6">
<FormItem label="完成时间" style="width:100%" prop="QuotationFinishDate">
<DatePicker
v-model="orderForm.QuotationFinishDate"
type="date"
placeholder="请选择日期"
@on-change="getTimeQuotationFD"
></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import Detail from "./detail"; import Detail from "./detail";
var myDate = new Date(); var myDate = new Date();
export default { export default {
name: "send", name: "send",
components: { components: {
Detail Detail
}, },
data() { data() {
return { return {
divHeight: "400px", divHeight: "400px",
roleTitle: "工艺员", roleTitle: "工艺员",
orderForm: { orderForm: {
ProductingPreparationPeople: null, //生产准备 ProductingPreparationPeople: null, //生产准备
ProductingPreparationFinishDate: "", //生产准备完成时间 ProductingPreparationFinishDate: "", //生产准备完成时间
QuotationPeople: null, //订单报价人员 QuotationPeople: null, //订单报价人员
QuotationFinishDate: "" //订单报价完成时间 QuotationFinishDate: "" //订单报价完成时间
}, },
columns1: [ columns1: [{
{ title: this.l("mesCode"),
title: this.l("mesCode"), key: "mesCode",
key: "mesCode", width: 180,
width: 180, tooltip: true
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: [], //确定后返回数据
ruleValidate: {
ProductingPreparationPeople: [{
required: true,
message: "请选择人员",
trigger: "change",
type: "number"
}],
ProductingPreparationFinishDate: [{
required: true,
message: "请选择时间",
trigger: "change"
}],
QuotationPeople: [{
required: true,
message: "请选择人员",
trigger: "change",
type: "number"
}],
QuotationFinishDate: [{
required: true,
message: "请选择时间",
trigger: "change"
}]
},
rowList: [],
row1: {},
tbHeight: 0
};
},
props: {
row: {
type: Array,
default: () => {
return [];
}
}
},
methods: {
returnData() {
let objStr = {};
objStr.ProductingPreparationPeople = this.orderForm.ProductingPreparationPeople;
objStr.ProductingPreparationFinishDate = this.orderForm.ProductingPreparationFinishDate;
objStr.QuotationPeople = this.orderForm.QuotationPeople;
objStr.QuotationFinishDate = this.orderForm.QuotationFinishDate;
//返回审批数据
return objStr;
}, },
{ getTimeProductPFD(value) {
title: this.l("productName"), this.orderForm.ProductingPreparationFinishDate = this.getFormatDateEnd(
key: "productName", value
tooltip: true );
}, },
{ getTimeQuotationFD(value) {
key: "drawnNumber", this.orderForm.QuotationFinishDate = this.getFormatDateEnd(value);
title: this.l("drawnNumber"),
align: "center",
width: 140
}, },
{ getFormatDateEnd(dates) {
title: this.l("projectNumber"), const d = new Date(dates);
key: "projectNumber", const resDate =
width: 140 d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 23:59:59";
return resDate;
}, },
{ p(s) {
title: this.l("batchNumber"), return s < 10 ? "0" + s : s;
key: "batchNumber",
width: 120,
tooltip: true
}, },
{ l(key) {
title: this.l("quantity"), let vkey = "mes_plan" + "." + key;
key: "quantity", return this.$t(vkey) || key;
align: "right",
width: 70
} }
],
dataList: [],
row1: {},
dataListRetrun: [], //确定后返回数据
ruleValidate: {
ProductingPreparationPeople: [
{
required: true,
message: "请选择人员",
trigger: "change",
type: "number"
}
],
ProductingPreparationFinishDate: [
{
required: true,
message: "请选择时间",
trigger: "change"
}
],
QuotationPeople: [
{
required: true,
message: "请选择人员",
trigger: "change",
type: "number"
}
],
QuotationFinishDate: [
{
required: true,
message: "请选择时间",
trigger: "change"
}
]
},
rowList: [],
row1: {},
tbHeight: 0
};
},
props: {
row: {
type: Array,
default: () => {
return [];
}
}
},
methods: {
returnData() {
let objStr = {};
objStr.ProductingPreparationPeople = this.orderForm.ProductingPreparationPeople;
objStr.ProductingPreparationFinishDate = this.orderForm.ProductingPreparationFinishDate;
objStr.QuotationPeople = this.orderForm.QuotationPeople;
objStr.QuotationFinishDate = this.orderForm.QuotationFinishDate;
//返回审批数据
return objStr;
},
getTimeProductPFD(value) {
this.orderForm.ProductingPreparationFinishDate = this.getFormatDateEnd(
value
);
}, },
getTimeQuotationFD(value) { created() {
this.orderForm.QuotationFinishDate = this.getFormatDateEnd(value); //var theight = window.innerHeight - 400 + "px";
// this.divHeight = theight;
}, },
getFormatDateEnd(dates) { mounted() {
const d = new Date(dates); // window.onresize = () => {
const resDate = // ///浏览器窗口大小变化
d.getFullYear() + // return (() => {
"-" + // window.screenHeight = window.innerHeight;
this.p(d.getMonth() + 1) + // this.divHeight = window.screenHeight - 400 + "px";
"-" + // })();
this.p(d.getDate()) + // };
" 23:59:59";
return resDate;
}, },
p(s) { watch: {
return s < 10 ? "0" + s : s; row(v) {
}, if (v != []) {
l(key) { this.dataList = this.$u.clone(this.row);
let vkey = "mes_plan" + "." + key; this.row1 = this.dataList[0];
return this.$t(vkey) || key; this.tbHeight = 0;
} if (this.dataList.length > 3) {
}, this.tbHeight = 200;
created() { }
//var theight = window.innerHeight - 400 + "px"; }
// this.divHeight = theight;
},
mounted() {
// window.onresize = () => {
// ///浏览器窗口大小变化
// return (() => {
// window.screenHeight = window.innerHeight;
// this.divHeight = window.screenHeight - 400 + "px";
// })();
// };
},
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> </script>
\ No newline at end of file
<template> <template>
<div style="width:100%;overflow:auto" :style="{height:divHeight}"> <div style="width:100%;overflow:auto" :style="{height:divHeight}">
<Form <Form :model="orderForm" :label-width="80" class="margin-top-20 margin-bottom-50" :rules="ruleValidate" ref="formValidate">
:model="orderForm" <Row>
:label-width="80" <Col span="12">
class="margin-top-20 margin-bottom-50" <FormItem label="订单编号" style="width:100%">
:rules="ruleValidate" <Input v-model="orderForm.mesCode" disabled style="width:240px" />
ref="formValidate" </FormItem>
> </Col>
<Row> <Col span="12">
<Col span="12"> <FormItem label="产品名称" style="width:100%">
<FormItem label="订单编号" style="width:100%"> <Input v-model="orderForm.productName" disabled style="width:240px" />
<Input v-model="orderForm.mesCode" disabled style="width:240px" /> </FormItem>
</FormItem> </Col>
</Col> </Row>
<Col span="12"> <Row>
<FormItem label="产品名称" style="width:100%"> <Col span="12">
<Input v-model="orderForm.productName" disabled style="width:240px" /> <FormItem label="开始时间" style="width:100%">
</FormItem> <Input v-model="orderForm.planStartTime" disabled style="width:240px" />
</Col> </FormItem>
</Row> </Col>
<Row> <Col span="12">
<Col span="12"> <FormItem label="完成时间" style="width:100%">
<FormItem label="开始时间" style="width:100%"> <Input v-model="orderForm.planEndTime" disabled style="width:240px" />
<Input v-model="orderForm.planStartTime" disabled style="width:240px" /> </FormItem>
</FormItem> </Col>
</Col> </Row>
<Col span="12"> <Row>
<FormItem label="完成时间" style="width:100%"> <Col span="12">
<Input v-model="orderForm.planEndTime" disabled style="width:240px" /> <FormItem label="数量" style="width:100%">
</FormItem> <Input v-model="orderForm.quantity" disabled style="width:240px" />
</Col> </FormItem>
</Row> </Col>
<Row> <Col span="12">
<Col span="12"> <FormItem label="分解数量" style="width:100%" prop="splitQuantity">
<FormItem label="数量" style="width:100%"> <InputNumber :min="0" v-model="orderForm.splitQuantity" style="width:180px"></InputNumber>
<Input v-model="orderForm.quantity" disabled style="width:240px" /> <Button type="primary" @click="addSplitOrder" v-noClick>确定</Button>
</FormItem> </FormItem>
</Col> </Col>
<Col span="12"> </Row>
<FormItem label="分解数量" style="width:100%" prop="splitQuantity">
<InputNumber :min="0" v-model="orderForm.splitQuantity" style="width:180px"></InputNumber>
<Button type="primary" @click="addSplitOrder" v-noClick>确定</Button>
</FormItem>
</Col>
</Row>
</Form> </Form>
<Table :loading="loading" border :columns="columns1" :data="dataList" class="tableCommon"> <Table :loading="loading" border :columns="columns1" :data="dataList" class="tableCommon">
<template slot-scope="{ row, index }" slot="slotPlanQ"> <template slot-scope="{ row, index }" slot="slotPlanQ">
<Input type="text" v-model="row.quantity" @on-change="inputOrderCat(row,index)" /> <Input type="text" v-model="row.quantity" @on-change="inputOrderCat(row,index)" />
</template> </template>
<template slot-scope="{ row, index }" slot="slotTime"> <template slot-scope="{ row, index }" slot="slotTime">
<DatePicker <DatePicker v-model="row.demandDate" type="daterange" placeholder="请选择日期" style="width:240px" :transfer="true" :options="optionsDate" @on-change="inputOrderCat(row,index)"></DatePicker>
v-model="row.demandDate" </template>
type="daterange"
placeholder="请选择日期"
style="width:240px"
:transfer="true"
:options="optionsDate"
@on-change="inputOrderCat(row,index)"
></DatePicker>
</template>
</Table> </Table>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "split", name: "split",
data() { data() {
return { return {
optionsDate: { optionsDate: {
disabledDate: date => { disabledDate: date => {
let beginDateVal = new Date(this.orderForm.planStartTime); let beginDateVal = new Date(this.orderForm.planStartTime);
let endDateVal = new Date(this.orderForm.planEndTime); let endDateVal = new Date(this.orderForm.planEndTime);
if (beginDateVal) { if (beginDateVal) {
return ( return (
(date && date.valueOf() < beginDateVal.getTime() - 86400000) || (date && date.valueOf() < beginDateVal.getTime() - 86400000) ||
date.valueOf() > endDateVal.getTime() date.valueOf() > endDateVal.getTime()
); );
} }
}
},
divHeight: "260px",
osrOneList: false, //一条数据显示详细
osrMoreList: false, //多条数据只显示列表
loading: false,
orderInfo: {
id: "", //订单id
mesCode: "", //订单编号
productName: "", //产品名称
drawingNo: "", //图号
orderCat: "", //任务类型
quantity: "", //数量
remark: "" //备注
},
orderForm: {
mesCode: "", //订单编号
productName: "", //产品名称
stage: "", //阶段
quantity: "", //数量
planStartTime: "", //计划开始时间
planEndTime: "", //计划结束时间
splitQuantity: 2, //分解数量
splitList: [] //分解后产生的列表
},
columns1: [{
title: "序号",
type: "index",
width: 80,
align: "right",
tooltip: true
},
{
title: "计划编号",
key: "mesCode",
tooltip: true
},
{
title: "计划数量",
key: "quantity",
align: "right",
width: 100,
slot: "slotPlanQ"
},
{
title: "开始--完成时间",
key: "demandDate",
width: 320,
align: "center",
slot: "slotTime"
}
],
dataList: [],
dataListRetrun: {
id: null,
quantity: null,
mesCode: "",
items: []
}, //确定后返回数据
ruleValidate: {
splitQuantity: [{
required: true,
message: "请输入数量",
type: "number",
trigger: "change"
}]
}
};
},
props: {
row: {
type: Object,
default: () => {
return null;
}
} }
}, },
divHeight: "260px", methods: {
osrOneList: false, //一条数据显示详细 intData(data) {
osrMoreList: false, //多条数据只显示列表 //打开modal层时给订单list赋值
loading: false, //alert(JSON.stringify(data))
orderInfo: { this.dataListRetrun.id = data[0].id;
id: "", //订单id this.dataListRetrun.quantity = data[0].quantity;
mesCode: "", //订单编号 this.dataListRetrun.mesCode = data[0].mesCode;
productName: "", //产品名称 this.orderInfo = [];
drawingNo: "", //图号 this.dataList = [];
orderCat: "", //任务类型 this.orderInfo = data[0];
quantity: "", //数量 this.orderForm = {
remark: "" //备注 mesCode: this.orderInfo.mesCode, //订单编号
}, productName: this.orderInfo.productName, //产品名称
orderForm: { stage: this.orderInfo.stage, //阶段
mesCode: "", //订单编号 quantity: this.orderInfo.quantity, //数量
productName: "", //产品名称 planStartTime: this.orderInfo.demandStartDate, //计划开始时间
stage: "", //阶段 planEndTime: this.orderInfo.demandFinishDate, //计划结束时间
quantity: "", //数量 splitQuantity: 2, //分解数量
planStartTime: "", //计划开始时间 splitList: [] //分解后产生的列表
planEndTime: "", //计划结束时间 };
splitQuantity: 2, //分解数量 },
splitList: [] //分解后产生的列表 //确定增加数量
}, addSplitOrder() {
columns1: [
{ if (this.orderForm.splitQuantity < 2 || this.orderForm.splitQuantity == undefined) {
title: "序号", this.dataList = [];
type: "index", return;
width: 80, }
align: "right", if (this.orderForm.quantity >= this.orderForm.splitQuantity) {
tooltip: true this.dataListRetrun.items = [];
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.dataList = [];
let demandDate = [];
let splitQuantity = this.orderForm.splitQuantity;
let mesCodeSon = this.orderForm.mesCode;
let planStartTime = this.orderForm.planStartTime;
let planEndTime = this.orderForm.planEndTime;
for (var i = 0; i < splitQuantity; i++) {
this.dataList.push({
mesCode: i + 1 < 10 ?
mesCodeSon + "0" + (i + 1) : mesCodeSon + "" + (i + 1),
quantity: "",
demandDate: [planStartTime, planEndTime],
demandStartDate: planStartTime,
demandFinishDate: planEndTime
});
}
this.dataListRetrun.items = this.dataListRetrun.items.concat(
this.dataList
);
}
});
} else {
this.$Message.error("分解数量大于订单数量");
}
}, },
{ inputOrderCat(row, index) {
title: "计划编号", let forDemandStartDate = this.getFormatDate(row.demandDate[0]);
key: "mesCode", let forDemandFinishDate = this.getFormatDate(row.demandDate[1]);
tooltip: true this.dataListRetrun.items[index].mesCode = row.mesCode;
this.dataListRetrun.items[index].quantity = row.quantity;
this.dataListRetrun.items[index].demandStartDate = forDemandStartDate;
this.dataListRetrun.items[index].demandFinishDate = forDemandFinishDate;
this.dataList[index].demandDate = [
forDemandStartDate,
forDemandFinishDate
];
}, },
{ getFormatDate(dates) {
title: "计划数量", const d = new Date(dates);
key: "quantity", const resDate =
align: "right", d.getFullYear() +
width: 100, "-" +
slot: "slotPlanQ" this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate());
return resDate;
}, },
{ p(s) {
title: "开始--完成时间", return s < 10 ? "0" + s : s;
key: "demandDate", },
width: 320, returnDataList() {
align: "center", //返回审批数据
slot: "slotTime" return this.dataListRetrun;
} }
],
dataList: [],
dataListRetrun: { id: null, quantity: null, mesCode: "", items: [] }, //确定后返回数据
ruleValidate: {
splitQuantity: [
{
required: true,
message: "请输入数量",
type: "number",
trigger: "change"
}
]
}
};
},
props: {
row: {
type: Object,
default: () => {
return null;
}
}
},
methods: {
intData(data) {
//打开modal层时给订单list赋值
//alert(JSON.stringify(data))
this.dataListRetrun.id = data[0].id;
this.dataListRetrun.quantity = data[0].quantity;
this.dataListRetrun.mesCode = data[0].mesCode;
this.orderInfo = [];
this.dataList = [];
this.orderInfo = data[0];
this.orderForm = {
mesCode: this.orderInfo.mesCode, //订单编号
productName: this.orderInfo.productName, //产品名称
stage: this.orderInfo.stage, //阶段
quantity: this.orderInfo.quantity, //数量
planStartTime: this.orderInfo.demandStartDate, //计划开始时间
planEndTime: this.orderInfo.demandFinishDate, //计划结束时间
splitQuantity: 2, //分解数量
splitList: [] //分解后产生的列表
};
},
//确定增加数量
addSplitOrder() {
if (this.orderForm.splitQuantity < 2||this.orderForm.splitQuantity==undefined) {
this.dataList = [];
return;
}
if (this.orderForm.quantity >= this.orderForm.splitQuantity) {
this.dataListRetrun.items = [];
this.$refs["formValidate"].validate(valid => {
if (valid) {
this.dataList = [];
let demandDate = [];
let splitQuantity = this.orderForm.splitQuantity;
let mesCodeSon = this.orderForm.mesCode;
let planStartTime = this.orderForm.planStartTime;
let planEndTime = this.orderForm.planEndTime;
for (var i = 0; i < splitQuantity; i++) {
this.dataList.push({
mesCode:
i + 1 < 10
? mesCodeSon + "0" + (i + 1)
: mesCodeSon + "" + (i + 1),
quantity: "",
demandDate: [planStartTime, planEndTime],
demandStartDate: planStartTime,
demandFinishDate: planEndTime
});
}
this.dataListRetrun.items = this.dataListRetrun.items.concat(
this.dataList
);
}
});
} else {
this.$Message.error("分解数量大于订单数量");
}
}, },
inputOrderCat(row, index) { created() {
let forDemandStartDate = this.getFormatDate(row.demandDate[0]); var theight = window.innerHeight - 400 + "px";
let forDemandFinishDate = this.getFormatDate(row.demandDate[1]); this.divHeight = theight;
this.dataListRetrun.items[index].mesCode = row.mesCode;
this.dataListRetrun.items[index].quantity = row.quantity;
this.dataListRetrun.items[index].demandStartDate = forDemandStartDate;
this.dataListRetrun.items[index].demandFinishDate = forDemandFinishDate;
this.dataList[index].demandDate = [
forDemandStartDate,
forDemandFinishDate
];
}, },
getFormatDate(dates) { mounted() {
const d = new Date(dates); window.onresize = () => {
const resDate = ///浏览器窗口大小变化
d.getFullYear() + return (() => {
"-" + window.screenHeight = window.innerHeight;
this.p(d.getMonth() + 1) + this.divHeight = window.screenHeight - 400 + "px";
"-" + })();
this.p(d.getDate()); };
return resDate; this.orderForm = {
mesCode: this.orderInfo.mesCode, //订单编号
productName: "", //产品名称
stage: "", //阶段
quantity: "", //数量
planStartTime: "", //计划开始时间
planEndTime: "", //计划结束时间
splitQuantity: 2, //分解数量
splitList: [] //分解后产生的列表
};
this.dataList = []
}, },
p(s) { watch: {
return s < 10 ? "0" + s : s; row(v) {
}, if (v != null) {
returnDataList() { this.orderForm = this.$u.clone(this.row);
//返回审批数据 this.orderForm.planStartTime = this.orderForm.demandStartDate;
return this.dataListRetrun; this.orderForm.planEndTime = this.orderForm.demandFinishDate;
} //this.orderForm.splitQuantity = 2;
}, this.dataListRetrun.id = this.orderForm.id;
created() { this.dataListRetrun.quantity = this.orderForm.quantity;
var theight = window.innerHeight - 400 + "px"; this.dataListRetrun.mesCode = this.orderForm.mesCode;
this.divHeight = theight; this.dataList = []
}, }
mounted() { }
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.divHeight = window.screenHeight - 400 + "px";
})();
};
this.orderForm = {
mesCode: this.orderInfo.mesCode, //订单编号
productName: "", //产品名称
stage: "", //阶段
quantity: "", //数量
planStartTime: "", //计划开始时间
planEndTime: "", //计划结束时间
splitQuantity: 2, //分解数量
splitList: [] //分解后产生的列表
};
},
watch: {
row(v) {
if (v != null) {
this.orderForm = this.$u.clone(this.row);
this.orderForm.planStartTime = this.orderForm.demandStartDate;
this.orderForm.planEndTime = this.orderForm.demandFinishDate;
//this.orderForm.splitQuantity = 2;
this.dataListRetrun.id = this.orderForm.id;
this.dataListRetrun.quantity = this.orderForm.quantity;
this.dataListRetrun.mesCode = this.orderForm.mesCode;
}
} }
}
}; };
</script> </script>
\ No newline at end of file
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