Commit 9cb44734 authored by wangdanlei's avatar wangdanlei

调漆

parent 0a54a9d6
// eslint-disable-next-line no-unused-vars
import { get } from '../utils/http' import { get } from '../utils/http'
// 删除索引 // 删除索引
// eslint-disable-next-line no-redeclare
export function get(params) { export function get(params) {
return get(`/demo`) return get(`/demo`)
} }
......
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
} else { } else {
this.cmpOptions = { this.cmpOptions = {
typeName: 'AssignCardPaint', typeName: 'AssignCardPaint',
layKey: 'assignCardInfo' layKey: 'AssignCardPaintView'
} }
} }
} }
......
...@@ -71,9 +71,13 @@ export default { ...@@ -71,9 +71,13 @@ export default {
formData: [] formData: []
}, },
requestOp: [], requestOp: [],
isEdit: false,
loading: false, loading: false,
time: null time: null,
typeEnum: {
AssignCardPaint: 'ShellacCardPaint',
AssignCardLacquer: 'ShellacCardLacquer'
},
subTypeName: ''
} }
}, },
computed: { computed: {
...@@ -98,6 +102,9 @@ export default { ...@@ -98,6 +102,9 @@ export default {
}) })
}) })
return disabled return disabled
},
type() {
return this.subTypeName
} }
}, },
watch: {}, watch: {},
...@@ -110,6 +117,7 @@ export default { ...@@ -110,6 +117,7 @@ export default {
// 生命周期 - 挂载完成(可以访问 DOM 元素) // 生命周期 - 挂载完成(可以访问 DOM 元素)
mounted() { mounted() {
this.com = this.findByNameVnode(this, 'DeeAsForm') this.com = this.findByNameVnode(this, 'DeeAsForm')
this.getSubTypeName()
if (this.itemObj.attrKey === 'certificateNo') { if (this.itemObj.attrKey === 'certificateNo') {
// //
} else { } else {
...@@ -118,7 +126,6 @@ export default { ...@@ -118,7 +126,6 @@ export default {
this.$set(this.form, key, this.basicData.setAttrs[key]) this.$set(this.form, key, this.basicData.setAttrs[key])
}) })
} }
this.isEdit = this.form.modelNo && this.form.spec && this.form.realityMark
if (this.basicData.setAttrs) { if (this.basicData.setAttrs) {
this.initFn() this.initFn()
} else { } else {
...@@ -127,6 +134,13 @@ export default { ...@@ -127,6 +134,13 @@ export default {
} }
}, },
methods: { methods: {
getSubTypeName() {
if (this.basicData.setAttrs) {
this.subTypeName = this.basicData.setAttrs.assignCard.subTypeName
} else {
this.subTypeName = this.basicData.subTypeName || this.form.subTypeName
}
},
initFn() { initFn() {
let params = [] let params = []
if (this.itemObj.attrKey === 'modelNo') { if (this.itemObj.attrKey === 'modelNo') {
...@@ -143,7 +157,7 @@ export default { ...@@ -143,7 +157,7 @@ export default {
{ {
'fieldName': 'subTypeName', 'fieldName': 'subTypeName',
'operator': 'EQ', 'operator': 'EQ',
'value': 'ShellacCardLacquer' 'value': this.typeEnum[this.subTypeName]
} }
] ]
this.setOptions('modelNo', params) this.setOptions('modelNo', params)
...@@ -160,33 +174,49 @@ export default { ...@@ -160,33 +174,49 @@ export default {
'fieldName': 'spec', 'fieldName': 'spec',
'operator': 'LIKE', 'operator': 'LIKE',
'value': this.form.spec || '' 'value': this.form.spec || ''
},
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': this.typeEnum[this.subTypeName]
} }
] ]
this.setOptions('spec', params) this.setOptions('spec', params)
} }
} }
if (this.itemObj.attrKey === 'realityMark') { if (this.itemObj.attrKey === 'realityMark') {
if (this.form.modelNo && this.form.spec) { let params = [
params = [ {
{ 'fieldName': 'modelNo',
'fieldName': 'modelNo', 'operator': 'LIKE',
'operator': 'LIKE', 'value': this.form.modelNo || ''
'value': this.form.modelNo || '' },
}, {
{ 'fieldName': 'spec',
'fieldName': 'spec', 'operator': 'LIKE',
'operator': 'LIKE', 'value': this.form.spec || ''
'value': this.form.spec || '' },
}, {
{ 'fieldName': 'realityMark',
'fieldName': 'realityMark', 'operator': 'LIKE',
'operator': 'LIKE', 'value': this.form.realityMark || ''
'value': this.form.realityMark || '' },
} {
] 'fieldName': 'subTypeName',
this.$set(this.form, 'realityMark', '') 'operator': 'EQ',
this.setOptions('realityMark', params) 'value': this.typeEnum[this.subTypeName]
}
]
if (this.subTypeName === 'ShellacCardLacquer') {
if (!this.form.modelNo || !this.form.spec) {
return false
}
} else {
params = params.filter(item => item.fieldName !== 'spec')
} }
this.$set(this.form, 'realityMark', '')
this.setOptions('realityMark', params)
} }
}, },
editInit() { editInit() {
...@@ -200,7 +230,7 @@ export default { ...@@ -200,7 +230,7 @@ export default {
{ {
'fieldName': 'subTypeName', 'fieldName': 'subTypeName',
'operator': 'EQ', 'operator': 'EQ',
'value': 'ShellacCardLacquer' 'value': this.typeEnum[this.subTypeName]
} }
] ]
this.setOptions('modelNo', params) this.setOptions('modelNo', params)
...@@ -332,12 +362,17 @@ export default { ...@@ -332,12 +362,17 @@ export default {
'value': this.form.modelNo || '' 'value': this.form.modelNo || ''
}, },
{ {
'fieldName': 'spec', 'fieldName': this.subTypeName === 'AssignCardLacquer' ? 'spec' : 'realityMark',
'operator': 'LIKE', 'operator': 'LIKE',
'value': this.form.spec || '' 'value': this.form.spec || ''
},
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': this.typeEnum[this.subTypeName]
} }
] ]
this.setOptions('spec', params) this.setOptions(this.subTypeName === 'AssignCardLacquer' ? 'spec' : 'realityMark', params)
} }
if (this.itemObj.attrKey === 'spec') { if (this.itemObj.attrKey === 'spec') {
this.$set(this.form, 'realityMark', '') this.$set(this.form, 'realityMark', '')
...@@ -356,35 +391,55 @@ export default { ...@@ -356,35 +391,55 @@ export default {
'fieldName': 'realityMark', 'fieldName': 'realityMark',
'operator': 'LIKE', 'operator': 'LIKE',
'value': this.form.realityMark || '' 'value': this.form.realityMark || ''
},
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': this.typeEnum[this.subTypeName]
} }
] ]
this.setOptions('realityMark', params) this.setOptions('realityMark', params)
} }
if (this.itemObj.attrKey === 'realityMark') { if (this.itemObj.attrKey === 'realityMark' && this.form.realityMark) {
this.requestShellacDeploy(this.form.modelNo, this.form.spec, this.form.realityMark) this.requestShellacDeploy(this.form.modelNo, this.form.spec, this.form.realityMark)
} }
}, },
requestShellacDeploy(modelNo, spec, realityMark) { requestShellacDeploy(modelNo, spec, realityMark) {
if (modelNo && spec && realityMark) { let state = false
if (this.subTypeName === 'AssignCardLacquer') {
state = modelNo && spec && realityMark
} else {
state = modelNo && realityMark
}
if (state) {
let paramsItems = [
{
'fieldName': 'modelNo',
'operator': 'LIKE',
'value': modelNo
},
{
'fieldName': 'spec',
'operator': 'LIKE',
'value': spec
},
{
'fieldName': 'realityMark',
'operator': 'LIKE',
'value': realityMark
},
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': this.typeEnum[this.subTypeName]
}
]
if (this.subTypeName === 'AssignCardPaint') {
paramsItems = paramsItems.filter(item => item.fieldName !== 'spec')
}
const params = { const params = {
'searchItems': { 'searchItems': {
'items': [ 'items': paramsItems,
{
'fieldName': 'modelNo',
'operator': 'LIKE',
'value': modelNo
},
{
'fieldName': 'spec',
'operator': 'LIKE',
'value': spec
},
{
'fieldName': 'realityMark',
'operator': 'LIKE',
'value': realityMark
}
],
'operator': 'AND' 'operator': 'AND'
}, },
'openProps': [], 'openProps': [],
...@@ -398,19 +453,40 @@ export default { ...@@ -398,19 +453,40 @@ export default {
post(`/ShellacDeploy/search`, params) post(`/ShellacDeploy/search`, params)
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$set(this.form, 'standard', res.items.content[0].standard) if (this.subTypeName === 'AssignCardLacquer') {
this.$set(this.form, 'matching', res.items.content[0].matching) this.$set(this.form, 'standard', res.items.content[0].standard)
this.$set(this.form, 'theoreticalTemperature', res.items.content[0].temperature) this.$set(this.form, 'matching', res.items.content[0].matching)
this.$set(this.form, 'humidity', res.items.content[0].humidity) this.$set(this.form, 'theoreticalTemperature', res.items.content[0].temperature)
this.$set(this.form, 'component', res.items.content[0].component) this.$set(this.form, 'humidity', res.items.content[0].humidity)
this.$set(this.form, 'shellacDeployId', res.items.content[0].id) this.$set(this.form, 'component', res.items.content[0].component)
this.$set(this.form, 'storeUp', res.items.content[0].storeUp) this.$set(this.form, 'shellacDeployId', res.items.content[0].id)
this.$set(this.form, 'storeUpTo', res.items.content[0].storeUpTo) this.$set(this.form, 'storeUp', res.items.content[0].storeUp)
if (this.form.validityStart && this.form.freeTemperature) { this.$set(this.form, 'storeUpTo', res.items.content[0].storeUpTo)
const date = new Date(this.form.validityStart) if (this.form.validityStart && this.form.freeTemperature) {
const data = this.form.freeTemperature === '-24' ? (this.form.storeUp ? Number(this.form.storeUp) : 21) : (this.form.storeUp ? Number(this.form.storeUpTo) : 30) const date = new Date(this.form.validityStart)
date.setDate(date.getDate() + data) const data = this.form.freeTemperature === '-24' ? (this.form.storeUp ? Number(this.form.storeUp) : 21) : (this.form.storeUp ? Number(this.form.storeUpTo) : 30)
this.$set(this.form, 'validityEnd', this.$utils.dateFormat(date.toISOString())) date.setDate(date.getDate() + data)
this.$set(this.form, 'validityEnd', this.$utils.dateFormat(date.toISOString()))
}
} else {
this.$set(this.form, 'shellacDeployId', res.items.content[0].id)
Object.keys(res.items.content[0]).forEach(key => {
if (key === 'temperature') {
this.$set(this.form, 'theoreticalTemperature', res.items.content[0][key])
} else if (key === 'viscosity') {
this.$set(this.form, 'theoreticalViscosity', res.items.content[0][key])
} else if (key === 'bulk') {
this.$set(this.form, 'mixRateType', res.items.content[0][key] === 'A')
} else if (key === 'hunting') {
this.$set(this.form, 'shockTime', res.items.content[0][key])
} else if (key === 'hunting') {
this.$set(this.form, 'shockTime', res.items.content[0][key])
} else {
if (!['modelNo', 'realityMark', 'id'].includes(key)) {
this.$set(this.form, key, res.items.content[0][key])
}
}
})
} }
} }
}) })
...@@ -442,7 +518,7 @@ export default { ...@@ -442,7 +518,7 @@ export default {
{ {
'fieldName': 'subTypeName', 'fieldName': 'subTypeName',
'operator': 'EQ', 'operator': 'EQ',
'value': 'ShellacCardLacquer' 'value': this.typeEnum[this.subTypeName]
}] }]
} }
} }
...@@ -481,11 +557,19 @@ export default { ...@@ -481,11 +557,19 @@ export default {
if (item.qualityPeriod) { if (item.qualityPeriod) {
disabled = new Date().getTime() > Date.parse(item.qualityPeriod) disabled = new Date().getTime() > Date.parse(item.qualityPeriod)
} }
return { if (this.subTypeName === 'AssignCardPaint') {
label: `${item.testNo}`, return {
value: item.testNo, label: `${item.testNo}`,
lotNo: item.lotNo, value: item.testNo,
disabled disabled
}
} else {
return {
label: `${item.testNo}`,
value: item.testNo,
lotNo: item.lotNo,
disabled
}
} }
}) })
this.setFormDataAttr(attrKey, 'options', this.requestOp) this.setFormDataAttr(attrKey, 'options', this.requestOp)
......
...@@ -155,6 +155,7 @@ export default { ...@@ -155,6 +155,7 @@ export default {
name = '阿洛丁调配' name = '阿洛丁调配'
break break
} }
delete this.setAttrs.modelNo
if (e.el.selectedData.length === 0) { if (e.el.selectedData.length === 0) {
this.$utils.showConfirm( this.$utils.showConfirm(
`确定不关联${name}申请创建调配卡吗, 是否继续?`, `确定不关联${name}申请创建调配卡吗, 是否继续?`,
...@@ -215,7 +216,8 @@ export default { ...@@ -215,7 +216,8 @@ 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.productArea,
createTimeTo: this.$moment().format('YYYY-MM-DD hh:mm:ss')
} }
post(`/AssignCard/recursion`, params).then(res => { post(`/AssignCard/recursion`, params).then(res => {
if (res.code === 0) { if (res.code === 0) {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
class="input-with-select el-input--small" class="input-with-select el-input--small"
placeholder="" placeholder=""
clearable clearable
:disabled="itemObj.readOnly" :disabled="disabled"
style="width: 40%" style="width: 40%"
@change="change" @change="change"
/> />
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
class="input-with-select el-input--small" class="input-with-select el-input--small"
placeholder="" placeholder=""
clearable clearable
:disabled="itemObj.readOnly" :disabled="disabled"
style="width: 40%" style="width: 40%"
@change="change" @change="change"
/> />
...@@ -41,9 +41,13 @@ export default { ...@@ -41,9 +41,13 @@ export default {
data() { data() {
return { return {
cup: '', cup: '',
second: '' second: '',
com: {},
disabled: false
} }
}, },
computed: {
},
watch: { watch: {
'form.id': { 'form.id': {
immediate: true, immediate: true,
...@@ -55,9 +59,21 @@ export default { ...@@ -55,9 +59,21 @@ export default {
} }
}, },
mounted() {
this.com = this.$utils.findByNameVnode(this, 'DeeAsForm')
this.com.formData.forEach(item => {
item.data && item.data.forEach(x => {
if (x.key === 'viscosity') {
this.disabled = x.component.disabled
}
})
})
},
methods: { methods: {
change() { change() {
this.$emit('input', this.cup + ' ' + this.second) if (this.cup && this.second) {
this.$emit('input', this.cup + ' ' + this.second)
}
} }
} }
} }
......
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