Commit eef3a74b authored by wangdanlei's avatar wangdanlei

调胶

parent 2611d0c0
......@@ -19,7 +19,7 @@ import _get from 'lodash.get'
import _set from 'lodash.set'
import router from '../router'
import { downFileByFileId } from '../api/file'
import { export_json_to_excel } from '@/Excel/Export2Excel'
import { export_json_to_excel } from '../Excel/Export2Excel'
// 限制promise并发数量
export function promiseLimit(func, funcParams, limit = 5) {
let i = 0
......@@ -1630,7 +1630,35 @@ export function export_excel(columns, tableData, title) {
const data = formatJson(filterVal, tableData)
export_json_to_excel(tHeader, data, title)
}
export function dateFormat(date) {
// 日期格式化
const d = new Date(date)
const year = d.getFullYear()
let month = d.getMonth() + 1
month = '0' + month
month = month.substring(month.length - 2)
let day = '0' + d.getDate()
day = day.substring(day.length - 2)
let hour = '0' + d.getHours()
hour = hour.substring(hour.length - 2)
let m = '0' + d.getMinutes()
m = m.substring(m.length - 2)
let s = '0' + d.getSeconds()
s = s.substring(s.length - 2)
return year + '-' + month + '-' + day + ' ' + hour + ':' + m + ':' + s
}
export function findByNameVnode(obj, targetName) {
if (obj && obj.$vnode && obj.$vnode.tag && obj.$vnode.tag.includes(targetName)) {
return obj
} else {
return findByNameVnode(obj.$parent, targetName)
}
}
export default {
findByNameVnode,
dateFormat,
treeFindBackArray,
throttle,
formateFilterDataFun,
......
export default {
props: {},
layoutConfigData: [
{
title: '高级组件配置',
data: [
{
title: '是否首次加载',
key: 'loadState',
component: {
name: 'el-input',
placeholder: '',
options: []
}
},
{
title: 'attrKey',
key: 'attrKey',
component: {
name: 'el-input',
placeholder: ''
}
},
{
title: '是否禁用',
key: 'disabled',
component: {
name: 'el-select',
placeholder: '',
options: [{
label: '是',
value: true
},
{
label: '否',
value: false
}]
}
}
]
}
],
data() {
return {
}
},
created() {
},
computed: {
},
methods: {
}
}
<template>
<div>
<el-select
v-if="['certificateNo','modelNo'].includes(itemObj.attrKey)"
v-model="form[itemObj.attrKey]"
filterable
remote
:disabled="disabled"
placeholder="请输入"
:remote-method="remoteMethod"
:loading="loading"
@change="changeEvent"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
>
<div v-if="itemObj.attrKey==='certificateNo'">
<span>{{ item.label }}</span>
<span>{{ item.lotNo?' / ':'' }}</span>
<span>{{ item.lotNo || '' }}</span>
</div>
</el-option>
</el-select>
<el-select v-else v-model="form[itemObj.attrKey]" :disabled="disabled" @change="changeEvent">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</template>
<script>
import config from './config'
import { post } from '@/utils/http'
export default {
componentName: '调配卡联动属性',
name: 'DeploymentCardInfoSelect',
components: {},
mixins: [config],
props: {
basicData: {
type: Object,
default: null
},
form: {
type: Object,
default: null
},
itemObj: {
type: Object,
default: null
},
componentProp: {
type: Object,
default: () => { return {} }
}
},
data() {
return {
selVal: '',
linkageValue: '',
com: {
formData: []
},
requestOp: [],
isEdit: false,
loading: false,
time: null
}
},
computed: {
options() {
let op = []
this.com.formData.forEach(item => {
item.data && item.data.forEach(x => {
if (x.key === this.itemObj.attrKey) {
op = x.component.options
}
})
})
return op
},
disabled() {
let disabled = false
this.com.formData.forEach(item => {
item.data && item.data.forEach(x => {
if (x.key === this.itemObj.attrKey) {
disabled = x.component.disabled
}
})
})
return disabled
}
},
watch: {},
// 生命周期 - 创建完成(可以访问当前this 实例)
created() {
},
// 生命周期 - 挂载之前
beforeMount() {
},
// 生命周期 - 挂载完成(可以访问 DOM 元素)
mounted() {
this.com = this.findByNameVnode(this, 'DeeAsForm')
if (this.itemObj.attrKey === 'certificateNo') {
//
} else {
if (this.basicData.setAttrs) {
Object.keys(this.basicData.setAttrs).forEach(key => {
this.$set(this.form, key, this.basicData.setAttrs[key])
})
}
this.isEdit = this.form.modelNo && this.form.spec && this.form.realityMark
if (this.isEdit) {
this.editInit()
} else {
this.initFn()
}
}
},
methods: {
initFn() {
let params = []
if (this.itemObj.attrKey === 'modelNo') {
// 如果页面配置的不是禁用状态
if (!this.disabled) {
this.setFormDataAttr('modelNo', 'disabled', !!this.form.modelNo)
}
params = [
{
'fieldName': 'modelNo',
'operator': 'LIKE',
'value': this.form.modelNo || ''
},
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': 'ShellacCardLacquer'
}
]
this.setOptions('modelNo', params)
}
if (this.itemObj.attrKey === 'spec') {
if (this.form.modelNo) {
params = [
{
'fieldName': 'modelNo',
'operator': 'LIKE',
'value': this.form.modelNo || ''
},
{
'fieldName': 'spec',
'operator': 'LIKE',
'value': this.form.spec || ''
}
]
this.setOptions(this.itemObj.attrKey, 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(this.itemObj.attrKey, params)
}
}
},
editInit() {
if (this.itemObj.attrKey === 'modelNo') {
const params = [
{
'fieldName': 'modelNo',
'operator': 'LIKE',
'value': ''
}
]
this.setOptions('modelNo', params)
}
if (this.itemObj.attrKey === 'spec') {
const params = [
{
'fieldName': 'modelNo',
'operator': 'LIKE',
'value': this.form.modelNo
},
{
'fieldName': 'spec',
'operator': 'LIKE',
'value': ''
}
]
this.setOptions(this.itemObj.attrKey, params)
}
if (this.itemObj.attrKey === 'realityMark') {
const params = [
{
'fieldName': 'modelNo',
'operator': 'LIKE',
'value': this.form.modelNo
},
{
'fieldName': 'spec',
'operator': 'LIKE',
'value': this.form.spec
},
{
'fieldName': 'realityMark',
'operator': 'LIKE',
'value': ''
}
]
this.setOptions(this.itemObj.attrKey, params)
}
this.requestShellacDeploy()
},
async setOptions(key, params) {
await this.requestOptions(key, params)
this.setFormDataAttr(key, 'options', this.requestOp)
},
setFormDataAttr(key, attrKey, value) {
this.com.formData.forEach(item => {
item.data && item.data.forEach(x => {
if (x.key === key) {
this.$set(x.component, attrKey, value)
}
})
})
},
// 根据组件名查询父级组件
findByNameVnode(obj, targetName) {
if (obj && obj.$vnode && obj.$vnode.tag && obj.$vnode.tag.includes(targetName)) {
return obj
} else {
return this.findByNameVnode(obj.$parent, targetName)
}
},
async requestOptions(key, items) {
const params = {
'searchItems': {
'items': items,
'operator': 'AND'
},
'openProps': [],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
await post(`/ShellacDeploy/queryModel?param=${key}`, params)
.then(res => {
if (res.code === 0) {
this.requestOp = res.items.map(item => {
return {
label: item,
value: item
}
})
}
})
},
changeEvent(value) {
if (this.itemObj.attrKey === 'certificateNo') {
const obj = this.form.inventory.find(item => item.testNo === value)
this.$set(this.form, 'lotNo', obj.lotNo)
} else {
this.$set(this.form, this.itemObj.attrKey, value)
this.changeRequest()
}
},
changeRequest() {
let params = []
if (this.itemObj.attrKey === 'modelNo') {
this.$set(this.form, 'spec', '')
this.$set(this.form, 'realityMark', '')
params = [
{
'fieldName': 'modelNo',
'operator': 'LIKE',
'value': this.form.modelNo || ''
},
{
'fieldName': 'spec',
'operator': 'LIKE',
'value': this.form.spec || ''
}
]
this.setOptions('spec', params)
}
if (this.itemObj.attrKey === 'spec') {
this.$set(this.form, 'realityMark', '')
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.setOptions('realityMark', params)
}
if (this.itemObj.attrKey === 'realityMark') {
this.requestShellacDeploy()
}
},
requestShellacDeploy() {
const params = {
'searchItems': {
'items': [
{
'fieldName': 'modelNo',
'operator': 'LIKE',
'value': this.form.modelNo
},
{
'fieldName': 'spec',
'operator': 'LIKE',
'value': this.form.spec
},
{
'fieldName': 'realityMark',
'operator': 'LIKE',
'value': this.form.realityMark
}
],
'operator': 'AND'
},
'openProps': [],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
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()))
}
}
})
},
remoteMethod(query) {
if (query && query.length >= 2) {
this.time = setTimeout(() => {
this.loading = true
if (this.itemObj.attrKey === 'certificateNo') {
this.getCertificateNo(query)
} else {
this.getModelNo(query)
}
}, 200)
}
},
getModelNo(query) {
const params = {
'pageFrom': 1,
'pageSize': 200,
'searchItems': {
'operator': 'AND',
'items': [{
'fieldName': 'modelNo',
'operator': 'LIKE',
'value': query
},
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': 'ShellacCardLacquer'
}]
}
}
post(`/ShellacDeploy/queryModel?param=modelNo`, params).then(res => {
this.loading = false
if (res.code === 0) {
this.requestOp = res.items.map(item => {
return {
label: item,
value: item
}
})
this.setFormDataAttr('modelNo', 'options', this.requestOp)
}
})
},
getCertificateNo(query) {
const params = {
'pageFrom': 1,
'pageSize': 20,
'searchItems': {
'operator': 'AND',
'items': [{
'fieldName': 'testNo',
'operator': 'LIKE',
'value': query
}]
}
}
post(`/Inventory/search`, params).then(res => {
this.loading = false
if (res.code === 0) {
this.form.inventory = res.items.content
this.requestOp = res.items.content.map(item => {
let disabled = false
if (item.qualityPeriod) {
disabled = Date.parse(item.qualityPeriod) > new Date().getTime()
}
return {
label: `${item.testNo}`,
value: item.testNo,
lotNo: item.lotNo,
disabled
}
})
this.setFormDataAttr('certificateNo', 'options', this.requestOp)
}
})
}
}
}
</script>
<style lang='scss' scoped>
</style>
<template>
<div>
<PrintTag ref="print" :config="printConfig" />
</div>
</template>
<script>
import { post } from '@/utils/http'
import PrintTag from './printTag'
export default {
name: 'SubpackagePrint',
components: { PrintTag },
props: {
baseComInfo: {
type: Object,
default: null
}
},
data() {
return {
sectionData: [],
printConfig: {
visible: false,
width: 260,
prints: []
}
}
},
computed: {},
watch: {},
// 生命周期 - 创建完成(可以访问当前this 实例)
created() {
},
// 生命周期 - 挂载之前
beforeMount() {
},
// 生命周期 - 挂载完成(可以访问 DOM 元素)
mounted() {
this.eventFunc()
},
methods: {
eventFunc() {
this.selectedData = this.$utils.findByNameVnode(this, 'DeeAsTable').selectedData
if (this.selectedData.length) {
let state = true
this.selectedData.forEach(item => {
if (item.state !== 'Audited') {
state = false
}
})
if (!state) {
this.$utils.showMessageWarning('勾选数据中存在状态为未审核的数据!')
} else {
this.print()
}
}
},
print() {
this.selectedData = this.$utils.findByNameVnode(this, 'DeeAsTable').selectedData
this.loading = true
const params = {
'pageFrom': 1,
'pageSize': 1,
'searchItems': {
'items': [
{
'fieldName': 'id',
'operator': 'EQ',
'value': this.selectedData[0].id
}
],
'operator': 'AND'
},
'openProps': [
{
'name': 'assignCard',
'openProps': [
{
'name': 'material'
}
]
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post('/AssignCardItem/detail', params)
.then((res) => {
var data = res.items.content[0]
this.printConfig = Object.assign({}, this.printConfig, {
visible: true
})
var b =
(data.assignCard.validityEnd &&
data.assignCard.validityEnd.split(':')) ||
[]
b.pop()
var c = (data.thawPickTime && data.thawPickTime.split(':')) || []
c.pop()
var d = (data.activeTime && data.activeTime.split(':')) || []
d.pop()
this.printConfig.prints = [
{
text: data.itemNo,
title: '胶料冷冻标签',
count: data.weight,
number: { label: '编号', value: data.itemNo },
mark: {
label: '牌号',
value: data.assignCard.modelNo
},
mixingUnit: {
label: '合格证号',
value: data.assignCard.certificateNo
},
remainingConstructionPeriod: {
label: '剩余施工期',
value: data.assignCard.leftWorkMinutes
},
ineffectiveTime: {
label: '失效时间',
value: b.join(':')
},
validity: {
label: '解冻及施工期',
value: {
start: {
label: '始',
value: c.join(':')
},
end: {
label: '止',
value: d.join(':')
}
}
},
deployment: { label: '调配员', value: data.creator.userName },
inspector: {
label: '检验员',
value: data.assignCard.checker
}
}
]
this.$refs.print.print()
})
.catch((err) => console.log(err))
.finally(() => {
this.loading = false
})
}
}
}
</script>
<style lang='scss' scoped>
</style>
......@@ -4,7 +4,36 @@
:lay-config="layConfig"
@tableToolHandler="tableToolHandler"
@row-click="onRowClick"
@selectionChange="selectionChange($event)"
/>
<dee-drawer
width="60%"
title="创建调胶调配记录卡"
:dialog-visible="drawer"
@handleClose="handleClose"
>
<dee-as-com
:lay-config="{
typeName: 'AssignCard',
layKey: 'defaultCreate'
}"
: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>
<div slot="footer">
<el-button type="primary" :disabled="!productArea" @click="save">确 定</el-button>
<el-button @click="dialogAddClose">取 消</el-button>
</div>
</dee-dialog>
</div>
</template>
<script>
......@@ -20,11 +49,57 @@ export default {
},
data() {
return {
drawer: false,
dialogVisible: false,
evenList: [
{
even: 'row-click',
name: '行点击事件'
}
],
setAttrs: {},
productArea: '',
productAreaOptions: [
{
label: '205厂房',
value: '205厂房'
},
{
label: '206厂房',
value: '206厂房'
},
{
label: '203厂房',
value: '203厂房'
},
{
label: '荆门铁鸟',
value: '荆门铁鸟'
},
{
label: '阎良强度所',
value: '阎良强度所'
},
{
label: '阎良试飞院',
value: '阎良试飞院'
},
{
label: '阎良蒲城',
value: '阎良蒲城'
},
{
label: '荆门漳河',
value: '荆门漳河'
},
{
label: '青岛',
value: '青岛'
},
{
label: '宜昌',
value: '宜昌'
}
]
}
},
......@@ -37,6 +112,9 @@ export default {
}
},
mounted() {
this.$bus.$on('completeEvent', (res) => {
this.drawer = false
})
},
methods: {
onRowClick(data) {
......@@ -44,7 +122,6 @@ export default {
},
tableToolHandler(e) {
if (e && e.key && e.key.btnValue) {
console.log(e)
let type
const { btnValue } = e.key
switch (btnValue) {
......@@ -63,14 +140,70 @@ export default {
'确定',
'取消',
() => {
this.adjustCardCreate(e, type)
if (btnValue === 'deploymentCardCreate') {
this.productArea = ''
this.dialogVisible = true
} else {
this.adjustCardCreate(e, type)
}
}
)
} else {
this.adjustCardCreate(e, type)
if (btnValue === 'deploymentCardCreate') {
this.dataCheck()
} else {
this.adjustCardCreate(e, type)
}
}
}
},
dataCheck() {
if (this.setAttrs.assignCardDetails && this.setAttrs.assignCardDetails.length) {
if (this.setAttrs.assignCardDetails.length === 1) {
this.$set(this.setAttrs, 'modelNo', this.setAttrs.assignCardDetails[0].extMaterial.modelNo.split('-')[0])
}
if (this.setAttrs.assignCardDetails.length > 1) {
const modelNoList = this.setAttrs.assignCardDetails.map(item => {
return item.extMaterial.modelNo.split('-')[0]
})
if (new Set(modelNoList).size !== 1) {
this.$utils.showMessageError('勾选的数据牌号不一致!', 'error')
return false
} else {
this.setAttrs.modelNo = this.setAttrs.assignCardDetails[0].extMaterial.modelNo.split('-')[0]
}
}
this.productArea = ''
this.dialogVisible = true
}
},
selectionChange(val) {
this.setAttrs.assignCardDetails = val
},
handleClose() {
this.drawer = false
},
dialogAddClose() {
this.productArea = ''
this.dialogVisible = false
},
save() {
const params = {
'dxClassName': 'com.yonde.tf.mom.common.vo.schedule.AssignCardVO',
'subTypeName': 'AssignCardLacquer',
'operator': 'ADD',
productArea: this.productArea
}
post(`/AssignCard/recursion`, params).then(res => {
if (res.code === 0) {
this.setAttrs.cardNo = res.items.cardNo
this.setAttrs.id = res.items.id
this.setAttrs.assignCard = res.items
this.dialogVisible = false
this.drawer = true
}
})
},
adjustCardCreate(e, type) {
let arr = []
let materialId = null
......
......@@ -7,7 +7,7 @@
v-model="popoverVisible"
placement="left"
width="200"
trigger="manual"
trigger="click"
>
<div>
<el-input
......@@ -16,15 +16,21 @@
placeholder="请使用扫码枪录入"
@change="getQRcodeBar"
/>
<br>
<el-input
ref="scanCode"
v-model="amount"
placeholder="请填写数量"
@change="getQRcodeBar"
/>
</div>
<span
slot="reference"
class="qiang"
title="扫码枪录入"
@click="codeScanBar"
/>
</el-popover>
<scan class="qrcode" title="扫码录入" @getQrCode="getQRcode"> <span class="scan" /></scan>
<scan class="qrcode" title="扫码录入" @getQrCode="getScanCode"> <span class="scan" /></scan>
</div>
</div>
<!-- 表格 -->
......@@ -69,6 +75,12 @@
label="记实时间"
:min-width="180"
/>
<el-table-column
prop="amount"
align="center"
label="数量"
:min-width="180"
/>
<el-table-column
prop="dxProcessMaterial.unit.unitCode"
align="center"
......@@ -97,6 +109,23 @@
@current-change="setPage($event, true)"
/>
</div>
<dee-dialog
:dialog-visible="dialogVisible"
width="20%"
title="数量"
:append-to-body="true"
@handleClose="handleClose"
>
<el-input
ref="scanCode"
v-model="amount"
placeholder="请填写数量"
@change="getQRcodeBar"
/>
<div slot="footer">
<el-button type="primary" :disabled="!amount" @click="getQRcode">确 定</el-button>
</div>
</dee-dialog>
</section>
</template>
......@@ -112,6 +141,7 @@ export default {
return {
// 加载中
loading: false,
dialogVisible: false,
// 分页
tablePagination: {
currentPage: 1,
......@@ -123,7 +153,8 @@ export default {
tableData: [],
tableId: null,
popoverVisible: false,
scanId: null
scanId: null,
amount: ''
}
},
created() {},
......@@ -185,11 +216,14 @@ export default {
* **扫描胶漆合格证二维码记实**
*/
getQRcode(info) {
this.popoverVisible = false
this.dialogVisible = false
// 发送请求
post(
'/ExtScanCodeRecord/scanCode',
{
allocateNo: info, // 记录卡号
allocateNo: this.scanId, // 记录卡号
amount: this.amount,
extSupportingItemId: this.tableId
}
)
......@@ -227,6 +261,7 @@ export default {
operator: 'REMOVE'
}
// 发送请求
// `ExtScanCodeRecord/removeScanCode?id=${row.extScanCodeRecords[0].id}&reqName=${row.extMaterial.resType2.typeName}`
post('/ExtScanCodeRecord/recursion', params)
.then((res) => {
if (res.message.includes('成功')) {
......@@ -258,9 +293,19 @@ export default {
* 扫码枪录入
*/
getQRcodeBar($event) {
this.popoverVisible = false
this.getQRcode($event)
this.scanId = null
if (this.amount && this.scanId) {
this.getQRcode($event)
this.scanId = null
this.amount = ''
}
},
getScanCode(scanId) {
this.scanId = scanId
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
this.amount = ''
}
}
}
......
......@@ -3,7 +3,7 @@
<p class="lacclaims-header-title">
<span class="title">胶漆材料</span>
<span class="button">
<span>提示:双击可编辑时间</span>
<span>提示:双击可编辑时间/规格</span>
<el-button
size="mini"
:disabled="
......@@ -104,19 +104,12 @@
placeholder="选择日期"
value-format="yyyy-MM-dd HH:mm:ss"
@focus="tableInputFocus"
@change="deeTableBlur(scope.row, false)"
@change="deeTableBlur(scope.row, 'needTime')"
/>
<!-- <el-input
v-if="scope.row.needTimeSelect"
v-model="scope.row.needTime"
@focus="tableInputFocus"
@blur="deeTableBlur(scope.row, false)"
/> -->
<span v-else>{{ scope.row[scope.column.property] }}</span>
<i
v-if="scope.row.needTimeLoading"
class="el-icon-loading"
/> </template></el-table-column>
<i v-if="scope.row.needTimeLoading" class="el-icon-loading" />
</template>
</el-table-column>
<el-table-column
prop="applyStatus"
align="center"
......@@ -125,6 +118,27 @@
sortable
:formatter="applyStatusFormatter"
/>
<el-table-column
prop="spec"
align="center"
label="规格"
:width="120"
>
<template slot="header">
<span>规格 </span>
<i class="el-icon-edit-outline" />
</template>
<template slot-scope="scope">
<el-input
v-if="scope.row.needSpecSelect"
v-model="scope.row.spec"
@focus="tableInputFocus"
@change="deeTableBlur(scope.row, 'spec')"
/>
<span v-else>{{ scope.row[scope.column.property] }}</span>
<i v-if="scope.row.needSpecLoading" class="el-icon-loading" />
</template>
</el-table-column>
<el-table-column
prop="cardNo"
align="center"
......@@ -169,6 +183,7 @@ export default {
tableData: [],
timer: null,
needTimeRow: null,
needSpecRow: null,
rowData: {},
defultRow: null
}
......@@ -231,7 +246,9 @@ export default {
return {
...p,
needTimeLoading: false,
needTimeSelect: false
needTimeSelect: false,
needSpecLoading: false,
needSpecSelect: false
}
})
this.tablePagination.total = res.items.totalElements
......@@ -253,6 +270,9 @@ export default {
if (column.property === 'needTime' && row.needTimeSelect) {
return 'highlight'
}
if (column.property === 'spec' && row.needSpecSelect) {
return 'highlight'
}
},
applyStatusFormatter(row, column, cellValue, index) {
var label = ''
......@@ -343,22 +363,37 @@ export default {
.catch((err) => console.error(err))
.finally(() => {})
},
deeTableBlur(row) {
deeTableBlur(row, key) {
var that = this
const param = {
id: row.id,
operator: 'MODIFY',
needTime: row.needTime
needTime: row.needTime,
spec: row.spec
}
row.needTimeSelect = false
row.needTimeLoading = true
if (this.needTimeRow === row.needTime) {
row.needTimeLoading = false
return
if (key === 'spec') {
this.needSpecSelect = false
row.needSpecLoading = true
if (this.needSpecRow === row.spec) {
row.needSpecLoading = false
return
}
} else {
row.needTimeSelect = false
row.needTimeLoading = true
if (this.needTimeRow === row.needTime) {
row.needTimeLoading = false
return
}
}
post('/ExtSupportingItem/recursion', param)
.then((res) => {
if (res.message.includes('成功')) {
if (key === 'spec') {
row.needSpecSelect = false
} else {
row.needTimeSelect = false
}
that.$message({
showClose: true,
message: '保存成功',
......@@ -375,6 +410,7 @@ export default {
.catch((err) => console.error(err))
.finally(() => {
row.needTimeLoading = false
row.needSpecLoading = false
})
},
tableInputFocus() {
......@@ -387,6 +423,11 @@ export default {
if (column.property === 'needTime') {
row.needTimeSelect = true
this.needTimeRow = row.needTime
} if (column.property === 'spec') {
if (row.applyStatus === 'applied') {
row.needSpecSelect = true
this.needSpecRow = row.spec
}
} else {
return
}
......
......@@ -123,7 +123,7 @@ export default {
class: 'link-style',
on: {
click: () => {
getInstancePbo(params.processInstanceId).then(res => {
getInstancePbo(params.processInstanceId || params.id).then(res => {
const pbo = res.items
if (pbo) {
let modelName = pbo.dxClassname.split('.').splice(-1)[0]
......
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