Commit cb2849b7 authored by jingnan's avatar jingnan 👀

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

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