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] {
left: 0;
text-align: center;
padding: 20px 0;
background: #08080894;
background: #080808;
div {
height: 25px;
......
......@@ -920,7 +920,7 @@ export default {
productId: '产品Id',
quantity: '数量',
remark: '备注',
taskRequire: '任务节点要求',
taskRequire: '任务要求',
status: '订单状态',
divideMark: '分解标记:1-已分解;0-未分解',
productCode: '产品序号:No1~No99',
......@@ -930,13 +930,13 @@ export default {
batchNumber: '批次号',
projectNumber: '项目号',
urgencyLevel: '紧急程度',
productingPreparationPeople: '生产准备(主制车间)',
productingPreparationFinishDate: '生产准备完成时间',
productingPreparationPeople: '生产车间',
productingPreparationFinishDate: '生产完成时间',
quotationPeople: '订单报价人员',
quotationFinishDate: '订单报价完成时间',
upId: '父订单id',
demandStartDate: '投料时间',
demandFinishDate: '节点时间',
demandStartDate: '开始时间',
demandFinishDate: '完成时间',
//tempTitle------
stage: '阶段',
materialId: '材料',
......
......@@ -150,9 +150,9 @@ export default {
modalAccessory: false,
columns: [{
key: "selection",
title: "#",
title: '多选',
type: "selection",
width: 70,
width: 50,
align: "center",
},
{
......@@ -259,13 +259,13 @@ export default {
high: true,
hide: true,
},
{
key: "spareQty",
title: this.l("spareQty"),
align: "left",
high: true,
hide: true,
},
// {
// key: "spareQty",
// title: this.l("spareQty"),
// align: "left",
// high: true,
// hide: true,
// },
{
key: "isPreschedule",
title: this.l("isPreschedule"),
......@@ -274,28 +274,28 @@ export default {
high: true,
code: "aps.plan.ispreschedule",
},
{
key: "demandStart",
title: this.l("demandStart"),
align: "left",
high: true,
hide: true,
},
{
key: "demandFinish",
title: this.l("demandFinish"),
align: "left",
high: true,
hide: true,
},
{
key: "partNamePro",
title: this.l("partNamePro"),
align: "left",
easy: true,
high: true,
hide: true,
},
// {
// key: "demandStart",
// title: this.l("demandStart"),
// align: "left",
// high: true,
// hide: true,
// },
// {
// key: "demandFinish",
// title: this.l("demandFinish"),
// align: "left",
// high: true,
// hide: true,
// },
// {
// key: "partNamePro",
// title: this.l("partNamePro"),
// align: "left",
// easy: true,
// high: true,
// hide: true,
// },
{
title: "操作",
key: "action",
......
<template>
<div style="padding:30px 0">
<div style="padding:30px 0">
<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> -->
<div class="footers" v-if="footerStatu === '2'" style="text-align:left;">
<Form
:model="formMyCheck"
:label-width="100"
:rules="ruleValidate"
inline
ref="formValidate"
>
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem
label="驳回节点:"
v-if="formMyCheck.radioSp === '驳回'"
prop="rejectToNodeId"
>
<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="
<Form :model="formMyCheck" :label-width="100" :rules="ruleValidate" inline ref="formValidate">
<Row>
<Col span="18">
<FormItem label="审批意见:">
<RadioGroup v-model="formMyCheck.radioSp" style="width:200px">
<Radio label="通过"></Radio>
<Radio label="驳回"></Radio>
<Radio label="终止"></Radio>
</RadioGroup>
</FormItem>
<FormItem label="驳回节点:" v-if="formMyCheck.radioSp === '驳回'" prop="rejectToNodeId">
<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 === '终止'
"
prop="comment"
>
<Input
v-model="formMyCheck.comment"
style="width:400px;margin-left:10px"
placeholder="请输入原因"
/>
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
" prop="comment">
<Input v-model="formMyCheck.comment" style="width:400px;margin-left:10px" placeholder="请输入原因" />
</FormItem>
</Col>
<Col span="6" style="text-align:right;padding-right:40px">
<Button type="primary" @click="nextCheckOk">下一步</Button>
</Col>
</Row>
</Form>
</div>
<!-- 订单审里通过form -->
<Modal
v-model="modalCheckOk"
title="订单审里"
width="800"
:scrollable="true"
>
<Form :model="formMyCheck" :label-width="100">
<Row>
<Col span="12">
<FormItem label="工时:" style="width:100%">
<InputNumber
v-model="formMyCheck.workHours"
:step="1"
:min="2"
style="width:240px"
/>
</FormItem>
</Col>
<Col span="12">
<FormItem label="打印周期:" style="width:100%">
<InputNumber
v-model="formMyCheck.printPeriod"
:step="1"
:min="2"
style="width:240px"
/>
</FormItem>
</Col>
</Row>
<Row>
<Col span="12">
<FormItem label="设备:" style="width:100%">
<Input v-model="formMyCheck.equipment" style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<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>
<!-- 订单审核通过form -->
<Modal v-model="modalCheckOk" title="订单审核" width="800" :scrollable="true">
<Form :model="formMyCheck" :label-width="100" v-if="false">
<Row>
<Col span="12">
<FormItem label="工时:" style="width:100%">
<InputNumber v-model="formMyCheck.workHours" :step="1" :min="2" style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="打印周期:" style="width:100%">
<InputNumber v-model="formMyCheck.printPeriod" :step="1" :min="2" style="width:240px" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="12">
<FormItem label="设备:" style="width:100%">
<Input v-model="formMyCheck.equipment" style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="材料重量:" style="width:100%">
<Input v-model="formMyCheck.materialWeight" style="width:240px" />
</FormItem>
</Col>
</Row>
</Form>
<br />
<h4>
您确定 <span class="new-red">通过</span> 此订单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckOk = false">取消</Button>
<Button type="primary" @click="checkOk" v-show="footerStatue">确定</Button>
</div>
</Modal>
<Modal
v-model="modalCheckNo"
title="订单审批"
width="800"
:scrollable="true"
>
<br />
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
<Modal v-model="modalCheckNo" title="订单审批" width="800" :scrollable="true">
<br />
<h4>
您确定 <span class="new-red">{{ statuTitle }}</span> 此订单审批?
</h4>
<br />
<div slot="footer">
<Button @click="modalCheckNo = false">取消</Button>
<Button type="primary" @click="checkFalse">确定</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from '../api'
import Detail from './detail'
import Process from '../process'
export default {
layout: 'empty',
name: 'Index',
components: {
Detail,
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
layout: 'empty',
name: 'Index',
components: {
Detail,
Process,
},
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('加载失败')
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'
}]
}
}
})
},
//根据当前登录用户返回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
}
props: {},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
// await store.dispatch("loadUsers");//加载缓存的用户
},
//审批通过
checkOk() {
let param = {
id: this.passId,
comment: '',
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
})
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)
},
//审批终止
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('加载失败')
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) {
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) {
key = 'MaterialPlacode' + '.' + key
return this.$t(key)
}
},
watch: {}
watch: {}
}
</script>
......@@ -106,7 +106,7 @@ export default {
productId: null, //产品id
productName: "", //产品名称
drawnNumber: null, //图号
taskType: null, //任务类型
taskType: 1, //任务类型
quantity: 1, //数量
taskRequire: "", //任务接点要求
demandStartDate: this.getFormatDate(nowDate), //开始时间
......@@ -114,7 +114,7 @@ export default {
remark: "", //备注
projectNumber: "", //项目号
batchNumber: "", //批次号
urgencyLevel: null, //紧急程度
urgencyLevel: 1, //紧急程度
bomId: null,
},
ruleValidate: {
......@@ -147,7 +147,9 @@ export default {
wfstatu: 1,
};
},
created() {},
mounted() {
let params = {
id: "123327da-42b3-41f6-b785-cf933f137a95",
};
......@@ -161,8 +163,8 @@ export default {
}
}
});
this.loadTree();
},
methods: {
handleSubmit() {
......@@ -173,6 +175,7 @@ export default {
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.resetFields();
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
......@@ -215,10 +218,11 @@ export default {
},
resetFields() {
this.orderSearchForm = {
productId: null, //产品id
productName: "", //产品名称
drawnNumber: null, //图号
taskType: null, //任务类型
taskType: 1, //任务类型
quantity: 1, //数量
taskRequire: "", //任务接点要求
demandStartDate: this.getFormatDate(nowDate), //开始时间
......@@ -226,7 +230,7 @@ export default {
remark: "", //备注
projectNumber: "", //项目号
batchNumber: "", //批次号
urgencyLevel: null, //紧急程度
urgencyLevel: 1, //紧急程度
};
},
loadTree() {
......
<template>
<div class="orderDetail">
<div class="orderDetail">
<Row>
<Col span="8">
<Col span="8">
<span class="fwBold">{{l('mesCode')}}</span>
<p>{{entity.mesCode}}</p>
</Col>
<Col span="8">
</Col>
<Col span="8">
<span class="fwBold">{{l('taskType')}}</span>
<p> <state code="plan.order.taskType" :value="entity.taskType" type="text"></state></p>
</Col>
<Col span="8">
<p>
<state code="plan.order.taskType" :value="entity.taskType" type="text"></state>
</p>
</Col>
<Col span="8">
<span class="fwBold">{{l('quantity')}}</span>
<p>{{entity.quantity}}</p>
</Col>
</Col>
</Row>
<Row>
<Col span="8">
<Col span="8">
<span class="fwBold">{{l('status')}}</span>
<p><state code="plan.order.status" :value="entity.status" type="text"></state></p>
</Col>
<Col span="8">
<p>
<state code="plan.order.status" :value="entity.status" type="text"></state>
</p>
</Col>
<Col span="8">
<span class="fwBold">{{l('productName')}}</span>
<p>{{entity.productName}}</p>
</Col>
<Col span="8">
</Col>
<Col span="8">
<span class="fwBold">{{l('drawnNumber')}}</span>
<p>{{entity.drawnNumber}}</p>
</Col>
</Col>
</Row>
<Row>
<Col span="8">
<Col span="8">
<span class="fwBold">{{l('batchNumber')}}</span>
<p>{{entity.batchNumber}}</p>
</Col>
<Col span="8">
</Col>
<Col span="8">
<span class="fwBold">{{l('projectNumber')}}</span>
<p>{{entity.projectNumber}}</p>
</Col>
<Col span="8">
</Col>
<Col span="8">
<span class="fwBold">{{l('urgencyLevel')}}</span>
<p><state code="plan.order.urgencyLevel" :value="entity.urgencyLevel" type="text"></state></p>
</Col>
<p>
<state code="plan.order.urgencyLevel" :value="entity.urgencyLevel" type="text"></state>
</p>
</Col>
</Row>
<Row>
<Col span="8">
<Row>
<Col span="8">
<span class="fwBold">{{l('demandStartDate')}}</span>
<p><DTSpan type="date" v-model="entity.demandStartDate"></DTSpan></p>
</Col>
<Col span="8">
<p>
<DTSpan type="date" v-model="entity.demandStartDate"></DTSpan>
</p>
</Col>
<Col span="8">
<span class="fwBold">{{l('demandFinishDate')}}</span>
<p><DTSpan type="date" v-model="entity.demandFinishDate"></DTSpan></p>
</Col>
<Col span="8">
<p>
<DTSpan type="date" v-model="entity.demandFinishDate"></DTSpan>
</p>
</Col>
<Col span="8">
<span class="fwBold">{{l('taskRequire')}}</span>
<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 class="lastRow">
<Col span="24">
<Col span="24">
<span class="fwBold">{{l('remark')}}</span>
<p>{{entity.remark}}</p>
</Col>
</Col>
</Row>
</div>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "detail",
data() {
return {
entity: {}
};
},
props: {
row: {
type: Object,
default: () => {
return null;
}
}
},
methods: {
handleClose() {
this.$emit("on-close");
name: "detail",
data() {
return {
entity: {}
};
},
l(key) {
key = "mes_plan" + "." + key;
return this.$t(key);
}
},
watch: {
row(v) {
if (v != null) {
this.entity = this.$u.clone(this.row);
}
props: {
row: {
type: Object,
default: () => {
return null;
}
}
},
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>
<style lang="less">
.orderDetail
{
line-height: 30px;
width: 90%;
margin: 0 auto;
.ivu-row{
padding-top: 20px;
padding-bottom: 20px;
border-bottom:#ccc solid 1px;
}
.lastRow
{
border-bottom:none;
}
.orderDetail {
line-height: 30px;
width: 90%;
margin: 0 auto;
.ivu-row {
padding-top: 20px;
padding-bottom: 20px;
border-bottom: #ccc solid 1px;
}
.lastRow {
border-bottom: none;
}
}
</style>
......@@ -163,15 +163,16 @@ export default {
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
//this.resetFields()
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.$Message.error("保存失败");
console.warn(err);
});
// .catch((err) => {
// this.$Message.error("保存失败");
// console.warn(err);
// });
}
});
},
......
......@@ -141,15 +141,11 @@ export default {
id: "id",
columns: [{
key: "selection",
title: '多选',
type: "selection",
width: 50,
align: "center"
},
{
key: "id",
title: this.l("id"),
hide: true
},
{
key: "mesCode",
title: this.l("mesCode"),
......
<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>
<Table
border
:columns="columns1"
:data="dataList"
class="tableCommon"
v-show="dataList.length>1"
:height="tbHeight"
></Table>
<Table border :columns="columns1" :data="dataList" class="tableCommon" v-show="dataList.length>1" :height="tbHeight"></Table>
<div style="width100%;margin:40px auto">
<Form
:model="orderForm"
:label-width="110"
class="margin-top-20 margin-bottom-50"
:rules="ruleValidate"
ref="formValidate"
>
<Row>
<Col span="6">
<FormItem label="生产车间" style="width:100%" prop="ProductingPreparationPeople">
<WorkShopSelect ref="userSelected" v-model="orderForm.ProductingPreparationPeople" />
</FormItem>
</Col>
<Col span="6">
<FormItem label="完成时间" style="width:100%" prop="ProductingPreparationFinishDate">
<DatePicker
v-model="orderForm.ProductingPreparationFinishDate"
type="date"
placeholder="请选择日期"
@on-change="getTimeProductPFD"
></DatePicker>
</FormItem>
</Col>
<Col span="6">
<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>
<Form :model="orderForm" :label-width="140" class="margin-top-20 margin-bottom-50" :rules="ruleValidate" ref="formValidate">
<Row>
<Col span="6">
<FormItem label="生产车间" style="width:100%" prop="ProductingPreparationPeople">
<WorkShopSelect ref="userSelected" v-model="orderForm.ProductingPreparationPeople" />
</FormItem>
</Col>
<Col span="6">
<FormItem label="生产完成时间" style="width:100%" prop="ProductingPreparationFinishDate">
<DatePicker v-model="orderForm.ProductingPreparationFinishDate" type="date" placeholder="请选择日期" @on-change="getTimeProductPFD"></DatePicker>
</FormItem>
</Col>
<Col span="6">
<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>
</template>
<script>
import Detail from "./detail";
var myDate = new Date();
export default {
name: "send",
components: {
Detail
},
data() {
return {
divHeight: "400px",
roleTitle: "工艺员",
orderForm: {
ProductingPreparationPeople: null, //生产准备
ProductingPreparationFinishDate: "", //生产准备完成时间
QuotationPeople: null, //订单报价人员
QuotationFinishDate: "" //订单报价完成时间
},
columns1: [
{
title: this.l("mesCode"),
key: "mesCode",
width: 180,
tooltip: true
name: "send",
components: {
Detail
},
data() {
return {
divHeight: "400px",
roleTitle: "工艺员",
orderForm: {
ProductingPreparationPeople: null, //生产准备
ProductingPreparationFinishDate: "", //生产准备完成时间
QuotationPeople: null, //订单报价人员
QuotationFinishDate: "" //订单报价完成时间
},
columns1: [{
title: this.l("mesCode"),
key: "mesCode",
width: 180,
tooltip: true
},
{
title: this.l("productName"),
key: "productName",
tooltip: true
},
{
key: "drawnNumber",
title: this.l("drawnNumber"),
align: "center",
width: 140
},
{
title: this.l("projectNumber"),
key: "projectNumber",
width: 140
},
{
title: this.l("batchNumber"),
key: "batchNumber",
width: 120,
tooltip: true
},
{
title: this.l("quantity"),
key: "quantity",
align: "right",
width: 70
}
],
dataList: [],
row1: {},
dataListRetrun: [], //确定后返回数据
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;
},
{
title: this.l("productName"),
key: "productName",
tooltip: true
getTimeProductPFD(value) {
this.orderForm.ProductingPreparationFinishDate = this.getFormatDateEnd(
value
);
},
{
key: "drawnNumber",
title: this.l("drawnNumber"),
align: "center",
width: 140
getTimeQuotationFD(value) {
this.orderForm.QuotationFinishDate = this.getFormatDateEnd(value);
},
{
title: this.l("projectNumber"),
key: "projectNumber",
width: 140
getFormatDateEnd(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 23:59:59";
return resDate;
},
{
title: this.l("batchNumber"),
key: "batchNumber",
width: 120,
tooltip: true
p(s) {
return s < 10 ? "0" + s : s;
},
{
title: this.l("quantity"),
key: "quantity",
align: "right",
width: 70
l(key) {
let vkey = "mes_plan" + "." + key;
return this.$t(vkey) || key;
}
],
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) {
this.orderForm.QuotationFinishDate = this.getFormatDateEnd(value);
created() {
//var theight = window.innerHeight - 400 + "px";
// this.divHeight = theight;
},
getFormatDateEnd(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 23:59:59";
return resDate;
mounted() {
// window.onresize = () => {
// ///浏览器窗口大小变化
// return (() => {
// window.screenHeight = window.innerHeight;
// this.divHeight = window.screenHeight - 400 + "px";
// })();
// };
},
p(s) {
return s < 10 ? "0" + s : s;
},
l(key) {
let vkey = "mes_plan" + "." + key;
return this.$t(vkey) || key;
}
},
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;
watch: {
row(v) {
if (v != []) {
this.dataList = this.$u.clone(this.row);
this.row1 = this.dataList[0];
this.tbHeight = 0;
if (this.dataList.length > 3) {
this.tbHeight = 200;
}
}
}
}
}
}
};
</script>
\ No newline at end of file
</script>
<template>
<div style="width:100%;overflow:auto" :style="{height:divHeight}">
<Form
:model="orderForm"
:label-width="80"
class="margin-top-20 margin-bottom-50"
:rules="ruleValidate"
ref="formValidate"
>
<Row>
<Col span="12">
<FormItem label="订单编号" style="width:100%">
<Input v-model="orderForm.mesCode" disabled style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="产品名称" style="width:100%">
<Input v-model="orderForm.productName" disabled style="width:240px" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="12">
<FormItem label="开始时间" style="width:100%">
<Input v-model="orderForm.planStartTime" disabled style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="完成时间" style="width:100%">
<Input v-model="orderForm.planEndTime" disabled style="width:240px" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="12">
<FormItem label="数量" style="width:100%">
<Input v-model="orderForm.quantity" disabled style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<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>
<div style="width:100%;overflow:auto" :style="{height:divHeight}">
<Form :model="orderForm" :label-width="80" class="margin-top-20 margin-bottom-50" :rules="ruleValidate" ref="formValidate">
<Row>
<Col span="12">
<FormItem label="订单编号" style="width:100%">
<Input v-model="orderForm.mesCode" disabled style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="产品名称" style="width:100%">
<Input v-model="orderForm.productName" disabled style="width:240px" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="12">
<FormItem label="开始时间" style="width:100%">
<Input v-model="orderForm.planStartTime" disabled style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="完成时间" style="width:100%">
<Input v-model="orderForm.planEndTime" disabled style="width:240px" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="12">
<FormItem label="数量" style="width:100%">
<Input v-model="orderForm.quantity" disabled style="width:240px" />
</FormItem>
</Col>
<Col span="12">
<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>
<Table :loading="loading" border :columns="columns1" :data="dataList" class="tableCommon">
<template slot-scope="{ row, index }" slot="slotPlanQ">
<Input type="text" v-model="row.quantity" @on-change="inputOrderCat(row,index)" />
</template>
<template slot-scope="{ row, index }" slot="slotTime">
<DatePicker
v-model="row.demandDate"
type="daterange"
placeholder="请选择日期"
style="width:240px"
:transfer="true"
:options="optionsDate"
@on-change="inputOrderCat(row,index)"
></DatePicker>
</template>
<template slot-scope="{ row, index }" slot="slotPlanQ">
<Input type="text" v-model="row.quantity" @on-change="inputOrderCat(row,index)" />
</template>
<template slot-scope="{ row, index }" slot="slotTime">
<DatePicker v-model="row.demandDate" type="daterange" placeholder="请选择日期" style="width:240px" :transfer="true" :options="optionsDate" @on-change="inputOrderCat(row,index)"></DatePicker>
</template>
</Table>
</div>
</div>
</template>
<script>
export default {
name: "split",
data() {
return {
optionsDate: {
disabledDate: date => {
let beginDateVal = new Date(this.orderForm.planStartTime);
let endDateVal = new Date(this.orderForm.planEndTime);
if (beginDateVal) {
return (
(date && date.valueOf() < beginDateVal.getTime() - 86400000) ||
date.valueOf() > endDateVal.getTime()
);
}
name: "split",
data() {
return {
optionsDate: {
disabledDate: date => {
let beginDateVal = new Date(this.orderForm.planStartTime);
let endDateVal = new Date(this.orderForm.planEndTime);
if (beginDateVal) {
return (
(date && date.valueOf() < beginDateVal.getTime() - 86400000) ||
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",
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
},
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("分解数量大于订单数量");
}
},
{
title: "计划编号",
key: "mesCode",
tooltip: true
inputOrderCat(row, index) {
let forDemandStartDate = this.getFormatDate(row.demandDate[0]);
let forDemandFinishDate = this.getFormatDate(row.demandDate[1]);
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
];
},
{
title: "计划数量",
key: "quantity",
align: "right",
width: 100,
slot: "slotPlanQ"
getFormatDate(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate());
return resDate;
},
{
title: "开始--完成时间",
key: "demandDate",
width: 320,
align: "center",
slot: "slotTime"
p(s) {
return s < 10 ? "0" + s : s;
},
returnDataList() {
//返回审批数据
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) {
let forDemandStartDate = this.getFormatDate(row.demandDate[0]);
let forDemandFinishDate = this.getFormatDate(row.demandDate[1]);
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
];
created() {
var theight = window.innerHeight - 400 + "px";
this.divHeight = theight;
},
getFormatDate(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate());
return resDate;
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: [] //分解后产生的列表
};
this.dataList = []
},
p(s) {
return s < 10 ? "0" + s : s;
},
returnDataList() {
//返回审批数据
return this.dataListRetrun;
}
},
created() {
var theight = window.innerHeight - 400 + "px";
this.divHeight = theight;
},
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;
}
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;
this.dataList = []
}
}
}
}
};
</script>
\ No newline at end of file
</script>
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