Commit 9cb44734 authored by wangdanlei's avatar wangdanlei

调漆

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