Commit cb2849b7 authored by jingnan's avatar jingnan 👀

胶料记录卡创建区域时同时把创建时间选好,然后其他地方都不可更改创建时间和卡号

parent e59b8828
...@@ -21,17 +21,31 @@ ...@@ -21,17 +21,31 @@
:basic-data=" { ...basicData,setAttrs:setAttrs }" :basic-data=" { ...basicData,setAttrs:setAttrs }"
/> />
</dee-drawer> </dee-drawer>
<dee-dialog title="区域" :dialog-visible="dialogVisible" width="20%" @handleClose="dialogAddClose"> <dee-dialog title="区域" :dialog-visible="dialogVisible" width="30%" @handleClose="dialogAddClose">
<el-select v-model="productArea"> <el-form ref="form" :model="form" :rules="formRules">
<el-option <el-form-item label-width="100px" label="区域" prop="productArea">
v-for="item in productAreaOptions" <el-select v-model="form.productArea">
:key="item.value" <el-option
:label="item.label" v-for="item in productAreaOptions"
:value="item.value" :key="item.value"
/> :label="item.label"
</el-select> :value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label-width="100px" label="创建日期" prop="createTimeTo">
<el-date-picker
v-model="form.createTimeTo"
type="datetime"
clearable
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"
/>
</el-form-item>
</el-form>
<div slot="footer"> <div slot="footer">
<el-button type="primary" :disabled="!productArea" @click="save">确 定</el-button> <el-button type="primary" :disabled="!form.productArea||!form.createTimeTo" @click="save">确 定</el-button>
<el-button @click="dialogAddClose">取 消</el-button> <el-button @click="dialogAddClose">取 消</el-button>
</div> </div>
</dee-dialog> </dee-dialog>
...@@ -49,6 +63,7 @@ export default { ...@@ -49,6 +63,7 @@ export default {
} }
}, },
data() { data() {
const _that = this
return { return {
drawer: false, drawer: false,
dialogVisible: false, dialogVisible: false,
...@@ -61,7 +76,10 @@ export default { ...@@ -61,7 +76,10 @@ export default {
} }
], ],
setAttrs: {}, setAttrs: {},
productArea: '', form: {
productArea: '',
createTimeTo: _that.$moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
},
productAreaOptions: [ productAreaOptions: [
{ {
label: '205厂房', label: '205厂房',
...@@ -103,7 +121,15 @@ export default { ...@@ -103,7 +121,15 @@ export default {
label: '宜昌', label: '宜昌',
value: '宜昌' value: '宜昌'
} }
] ],
formRules: {
productArea: [
{ required: true, message: '该项必填', trigger: 'blur' }
],
createTimeTo: [
{ required: true, message: '该项必填', trigger: 'blur' }
]
}
} }
}, },
computed: { computed: {
...@@ -173,7 +199,8 @@ export default { ...@@ -173,7 +199,8 @@ export default {
'取消', '取消',
() => { () => {
if (['AssignCardLacquer', 'AssignCardPaint', 'AssignCardAlodine'].includes(this.subTypeName)) { if (['AssignCardLacquer', 'AssignCardPaint', 'AssignCardAlodine'].includes(this.subTypeName)) {
this.productArea = '' this.form.productArea = ''
this.form.createTimeTo = this.$moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
this.dialogVisible = true this.dialogVisible = true
} else { } else {
this.adjustCardCreate(e, this.subTypeName) this.adjustCardCreate(e, this.subTypeName)
...@@ -205,7 +232,8 @@ export default { ...@@ -205,7 +232,8 @@ export default {
this.setAttrs.modelNo = this.setAttrs.assignCardDetails[0].extMaterial.modelNo.split('-')[0] this.setAttrs.modelNo = this.setAttrs.assignCardDetails[0].extMaterial.modelNo.split('-')[0]
} }
} }
this.productArea = '' this.form.productArea = ''
this.form.createTimeTo = this.$moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
this.dialogVisible = true this.dialogVisible = true
} }
}, },
...@@ -221,7 +249,8 @@ export default { ...@@ -221,7 +249,8 @@ export default {
this.drawer = false this.drawer = false
}, },
dialogAddClose() { dialogAddClose() {
this.productArea = '' this.form.productArea = ''
this.form.createTimeTo = this.$moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
this.dialogVisible = false this.dialogVisible = false
}, },
save() { save() {
...@@ -229,9 +258,9 @@ export default { ...@@ -229,9 +258,9 @@ export default {
'dxClassName': 'com.yonde.tf.mom.common.vo.schedule.AssignCardVO', 'dxClassName': 'com.yonde.tf.mom.common.vo.schedule.AssignCardVO',
'subTypeName': this.subTypeName, 'subTypeName': this.subTypeName,
'operator': 'ADD', 'operator': 'ADD',
productArea: this.productArea, productArea: this.form.productArea,
modelNo: this.setAttrs.assignCardDetails && this.setAttrs.assignCardDetails.length && this.setAttrs.assignCardDetails[0].extMaterial && this.setAttrs.assignCardDetails[0].extMaterial.modelNo || '', modelNo: this.setAttrs.assignCardDetails && this.setAttrs.assignCardDetails.length && this.setAttrs.assignCardDetails[0].extMaterial && this.setAttrs.assignCardDetails[0].extMaterial.modelNo || '',
createTimeTo: this.$moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), createTimeTo: this.form.createTimeTo,
assignCardDetails: this.setAttrs && this.setAttrs.assignCardDetails && this.setAttrs.assignCardDetails.length && this.setAttrs.assignCardDetails.map(item => { assignCardDetails: this.setAttrs && this.setAttrs.assignCardDetails && this.setAttrs.assignCardDetails.length && this.setAttrs.assignCardDetails.map(item => {
return { return {
subTypeName: 'AssignCardDetail', subTypeName: 'AssignCardDetail',
...@@ -248,6 +277,7 @@ export default { ...@@ -248,6 +277,7 @@ export default {
if (res.code === 0) { if (res.code === 0) {
this.setAttrs.cardNo = res.items.cardNo this.setAttrs.cardNo = res.items.cardNo
this.setAttrs.createTime = res.items.createTime this.setAttrs.createTime = res.items.createTime
this.setAttrs.createTimeTo = res.items.createTimeTo
this.setAttrs.id = res.items.id this.setAttrs.id = res.items.id
this.setAttrs.assignCard = res.items this.setAttrs.assignCard = res.items
this.dialogVisible = false this.dialogVisible = false
......
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