Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
5bc106c31b
10
src/api/mes/prd/sales-order.js
Normal file
10
src/api/mes/prd/sales-order.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/router/axios'
|
||||
import { iep } from '@/api/prefix'
|
||||
|
||||
export function fetchList(query) {
|
||||
return request({
|
||||
url: iep('/salesOrder/page'),
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@ -17,4 +17,29 @@ export function listSoLineLabelValueSet(query) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getConfigLabelTemplate(query) {
|
||||
return request({
|
||||
url: nlv_print('/sales-order-line-label-value-config/get-config-label-template'),
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function changeTemplate(obj) {
|
||||
return request({
|
||||
url: nlv_print('/sales-order-line-label-value-config/change-template'),
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
export function saveValueSet(obj) {
|
||||
return request({
|
||||
url: nlv_print('/sales-order-line-label-value-config/save-value-set'),
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
47
src/api/mes/print/sales-order-line-label-value-set.js
Normal file
47
src/api/mes/print/sales-order-line-label-value-set.js
Normal file
@ -0,0 +1,47 @@
|
||||
import request from '@/router/axios'
|
||||
import {nlv_print} from '@/api/prefix'
|
||||
|
||||
export function fetchList(query) {
|
||||
return request({
|
||||
url: nlv_print('/sales-order-line-label-value-set/page'),
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj) {
|
||||
return request({
|
||||
url: nlv_print('/sales-order-line-label-value-set'),
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id) {
|
||||
return request({
|
||||
url: nlv_print('/sales-order-line-label-value-set/') + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function delObj(id) {
|
||||
return request({
|
||||
url: nlv_print('/sales-order-line-label-value-set/') + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj) {
|
||||
return request({
|
||||
url: nlv_print('/sales-order-line-label-value-set'),
|
||||
method: 'put',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
export function listByValueConfig(masterId) {
|
||||
return request({
|
||||
url: nlv_print('/sales-order-line-label-value-set/by-master-id/') + masterId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
346
src/views/mes/print/customer-label/content/field-value-set.vue
Normal file
346
src/views/mes/print/customer-label/content/field-value-set.vue
Normal file
@ -0,0 +1,346 @@
|
||||
<template>
|
||||
<div class="execution">
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:show-close="false"
|
||||
v-el-drag-dialog
|
||||
:fullscreen="false"
|
||||
:visible.sync="visible"
|
||||
title="标签字段自定义值集配置"
|
||||
@close="visible = false"
|
||||
center
|
||||
top="100px"
|
||||
>
|
||||
<div class="execution">
|
||||
<el-dialog title="值集生成" :visible.sync="valueSetGenerateDialogVisible" :append-to-body="true">
|
||||
<el-form ref="valueSetForm" :model="valueSetForm" :inline="true" :rules="valueSetFormRules">
|
||||
<el-form-item label="编号从" prop="numberFrom">
|
||||
<el-input v-model="valueSetForm.numberFrom"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span>-</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="编号至" prop="numberTo">
|
||||
<el-input v-model="valueSetForm.numberTo"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="width: 100%; display: flex; justify-content: center; margin-top: 20px">
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="valueSetGenerateConfirm">确 定</el-button>
|
||||
<el-button @click="valueSetGenerateDialogVisible = false">取 消</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="mainForm"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-row :gutter="5">
|
||||
<el-col :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="soNumber" label="销售订单">
|
||||
<el-input v-model="mainForm.soNumber" :disabled="true">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="soLineId" label="销售订单行">
|
||||
<el-input
|
||||
v-model="mainForm.soLineId"
|
||||
style="width: 100%"
|
||||
:disabled="true"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="labelCategoryName" label="标签类别">
|
||||
<el-input
|
||||
v-model="mainForm.labelCategoryName"
|
||||
style="width: 100%"
|
||||
:disabled="true"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="fieldDescription" label="标签字段">
|
||||
<el-input
|
||||
v-model="mainForm.fieldDescription"
|
||||
style="width: 100%"
|
||||
:disabled="true"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-row class="mb8">
|
||||
<el-button type="primary" size="small" @click.stop="handleAdd">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" @click.stop="handleGenerate">
|
||||
值集生成
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" @click.stop="handleDelete">
|
||||
删除
|
||||
</el-button>
|
||||
</el-row>
|
||||
<el-table ref="fieldValueSetTable" :data="tableData" height="400" border>
|
||||
<el-table-column type="selection" width="55" align="center" :selectable="isSelectable"/>
|
||||
<el-table-column label="序号" align="center" prop="seq" width="70"></el-table-column>
|
||||
<el-table-column
|
||||
label="字段值"
|
||||
align="center"
|
||||
prop="fieldValue"
|
||||
width="auto"
|
||||
show-overflow-tooltip="true"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="scope.row.fieldValue"
|
||||
size="mini"
|
||||
:disabled="scope.row.fieldValueStatus !== '0'"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="字段状态"
|
||||
align="center"
|
||||
prop="fieldValueStatus"
|
||||
width="auto"
|
||||
show-overflow-tooltip="true"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ formatFieldStatus(scope.row.fieldValueStatus) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('crud.menu')" align="center" width="80" class-name="small-padding" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
:disabled="scope.row.fieldValueStatus !== '0'"
|
||||
@click="handleDeleteRow(scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="width: 100%; display: flex; justify-content: center; margin-top: 20px">
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
size="small"
|
||||
@click="handleSave"
|
||||
>{{ $t('el.button.save') }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-circle-close" size="small" @click="closeForm"
|
||||
>{{ $t('crud.cancelBtn') }}
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {isBlank} from '@/util/string'
|
||||
import {clearValidate} from '@/util/util'
|
||||
import {showLoading, hideLoading} from '@/const/loading'
|
||||
import {changeTemplate, saveValueSet} from "@/api/mes/print/sales-order-line-label-value-config";
|
||||
import {listByValueConfig} from "@/api/mes/print/sales-order-line-label-value-set";
|
||||
import { setSeq } from '@/util/table'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
closeVisible: Boolean,
|
||||
form: Object,
|
||||
showTitle: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
rules: {},
|
||||
visible: false,
|
||||
open: '',
|
||||
mainForm: this.form,
|
||||
tableData: [],
|
||||
valueSetGenerateDialogVisible: false,
|
||||
valueSetForm: {
|
||||
numberFrom: '',
|
||||
numberTo: ''
|
||||
},
|
||||
valueSetFormRules: {
|
||||
numberFrom: [{required: true, message: '编号从不能为空', trigger: ['change', 'blur']}],
|
||||
numberTo: [{required: true, message: '编号至不能为空', trigger: ['change', 'blur']}]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
form: {
|
||||
handler() {
|
||||
this.mainForm = this.form
|
||||
this.$nextTick(() => {
|
||||
clearValidate.call(this, 'form', ['labelTempleCode'])
|
||||
})
|
||||
this.listByValueConfig()
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
closeVisible: {
|
||||
handler() {
|
||||
this.visible = this.closeVisible
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
listByValueConfig() {
|
||||
showLoading()
|
||||
listByValueConfig(this.mainForm.salesOrderLineLabelValueCofigBo)
|
||||
.then((response) => {
|
||||
hideLoading()
|
||||
this.tableData = response.data.data
|
||||
})
|
||||
.catch(() => {
|
||||
hideLoading()
|
||||
})
|
||||
},
|
||||
handleAdd() {
|
||||
// 新增一笔数据到tableData
|
||||
this.tableData.push({
|
||||
seq: this.tableData.length + 1,
|
||||
fieldValue: '',
|
||||
fieldValueStatus: '0'
|
||||
})
|
||||
},
|
||||
handleGenerate() {
|
||||
this.valueSetGenerateDialogVisible = true;
|
||||
this.valueSetForm.numberFrom = '';
|
||||
this.valueSetForm.numberTo = '';
|
||||
},
|
||||
handleDelete() {
|
||||
// 删除fieldValueSetTable选中的行
|
||||
const deleteRows = this.$refs.fieldValueSetTable.selection;
|
||||
if (deleteRows.length === 0) {
|
||||
// 如果没有选中任何行,可以显示一个提示
|
||||
this.$message.warning('请先选择要删除的行');
|
||||
return
|
||||
}
|
||||
// 删除deleteRows对应的数据
|
||||
this.tableData = this.tableData.filter((row) => !deleteRows.includes(row));
|
||||
setSeq(this.tableData, 'seq');
|
||||
this.$message.success('删除成功');
|
||||
},
|
||||
handleDeleteRow(row) {
|
||||
// 删除当前行
|
||||
const index = this.tableData.indexOf(row);
|
||||
if (index !== -1) {
|
||||
this.tableData.splice(index, 1);
|
||||
setSeq(this.tableData, 'seq');
|
||||
this.$message.success('删除成功');
|
||||
}
|
||||
},
|
||||
valueSetGenerateConfirm() {
|
||||
this.$refs['valueSetForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 根据this.valueSetForm.numberFrom和this.valueSetForm.numberTo字符串序列生成对应的列表
|
||||
let numberFrom = this.valueSetForm.numberFrom;
|
||||
let numberTo = this.valueSetForm.numberTo;
|
||||
let resultList = this.generateStringList(numberFrom, numberTo);
|
||||
for (let i = 0; i < resultList.length; i++) {
|
||||
this.tableData.push({
|
||||
seq: this.tableData.length + 1,
|
||||
fieldValue: resultList[i],
|
||||
fieldValueStatus: '0'
|
||||
})
|
||||
}
|
||||
this.$message.success("生成成功");
|
||||
this.valueSetGenerateDialogVisible = false;
|
||||
}
|
||||
})
|
||||
},
|
||||
nextString(s) {
|
||||
const match = s.match(/([a-zA-Z]+)(\d+)/);
|
||||
if (!match) {
|
||||
return this.$message.warning("输入的编号范围字符串格式不正确");
|
||||
}
|
||||
const prefix = match[1];
|
||||
const numberPart = parseInt(match[2], 10);
|
||||
const nextNumberPart = (numberPart + 1).toString().padStart(match[2].length, '0');
|
||||
return `${prefix}${nextNumberPart}`;
|
||||
},
|
||||
generateStringList(startStr, endStr, maxLength = 100) {
|
||||
if (startStr > endStr) {
|
||||
return this.$message.warning("起始值必须小于或等于结束值");
|
||||
}
|
||||
|
||||
let result = [startStr];
|
||||
let count = 1;
|
||||
|
||||
while (startStr !== endStr && count < maxLength) {
|
||||
startStr = this.nextString(startStr);
|
||||
result.push(startStr);
|
||||
count++;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
isSelectable(row, index) {
|
||||
return row.fieldValueStatus == '0';
|
||||
},
|
||||
formatFieldStatus(status) {
|
||||
return status === '0' ? '未使用' : '已使用';
|
||||
},
|
||||
handleSave() {
|
||||
let me = this;
|
||||
if(!me.tableData || me.tableData.length == 0) {
|
||||
return this.$message.warning("值集列表不能为空")
|
||||
}
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
// me.tableData fieldValue字段重复校验
|
||||
let fieldValueSet = [];
|
||||
for (let i = 0; i < me.tableData.length; i++) {
|
||||
let fieldValue = me.tableData[i].fieldValue;
|
||||
if (fieldValueSet.indexOf(fieldValue) !== -1) {
|
||||
return this.$message.warning("值集列表中存在重复的值")
|
||||
}
|
||||
fieldValueSet.push(fieldValue)
|
||||
}
|
||||
let param = {
|
||||
labelTempleCode: me.mainForm.labelTempleCode,
|
||||
configItem: me.mainForm.configItem,
|
||||
salesOrderLineBo: me.mainForm.salesOrderLineBo,
|
||||
labelFieldCode: me.mainForm.labelField,
|
||||
salesOrderLineLabelValueSets: me.tableData
|
||||
};
|
||||
// 处理响应成功后的操作
|
||||
showLoading()
|
||||
saveValueSet(param).then(response => {
|
||||
hideLoading()
|
||||
this.$message.warning("配置成功")
|
||||
this.doConfirm()
|
||||
}).catch(() => {
|
||||
hideLoading()
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
closeForm() {
|
||||
this.visible = false
|
||||
this.$set(this, 'mainForm', {})
|
||||
this.$emit('update:closeVisible', false)
|
||||
this.$emit('afterClose', true)
|
||||
},
|
||||
doConfirm() {
|
||||
this.$emit('doConfirm', this.mainForm)
|
||||
this.closeForm()
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,176 @@
|
||||
<template>
|
||||
<div class="execution">
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:show-close="false"
|
||||
v-el-drag-dialog
|
||||
:fullscreen="false"
|
||||
width="60%"
|
||||
:visible.sync="visible"
|
||||
title="标签更改"
|
||||
@close="visible = false"
|
||||
center
|
||||
top="100px"
|
||||
>
|
||||
<div class="execution">
|
||||
<input-select-dialog :modal-obj="labelTemplateDialogObj"
|
||||
:modal-fetch-fun='fetchLabelTemplateList'
|
||||
:modal-show.sync="labelTemplateDialogVisible"
|
||||
@inputDialogSelected="labelTemplateSelected"></input-select-dialog>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="mainForm"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-row :gutter="5">
|
||||
<el-col :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="labelTempleCode" label="标签编号">
|
||||
<el-input v-model="mainForm.labelTempleCode" :readOnly="true">
|
||||
<i slot="suffix" class="el-input__icon el-icon-search"
|
||||
@click.stop="showLabelTemplateDialog()"></i>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="templateName" label="标签名称">
|
||||
<el-input
|
||||
v-model="mainForm.templateName"
|
||||
style="width: 100%"
|
||||
:disabled="true"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="labelCategoryName" label="标签类别">
|
||||
<el-input
|
||||
v-model="mainForm.labelCategoryName"
|
||||
style="width: 100%"
|
||||
:disabled="true"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div style="width: 100%; display: flex; justify-content: center; margin-top: 20px">
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
size="small"
|
||||
@click="handleSave"
|
||||
>{{ $t('el.button.save') }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-circle-close" size="small" @click="closeForm"
|
||||
>{{ $t('crud.cancelBtn') }}
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {fetchList as fetchLabelTemplateList} from '@/api/mes/print/print-label-template'
|
||||
import {getByCode as getLabelCategory} from '@/api/mes/print/labelCategory'
|
||||
import { clearValidate } from '@/util/util'
|
||||
import { showLoading, hideLoading } from '@/const/loading'
|
||||
import {changeTemplate} from "@/api/mes/print/sales-order-line-label-value-config";
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
closeVisible: Boolean,
|
||||
form: Object,
|
||||
showTitle: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
rules: {
|
||||
labelTempleCode: [{ required: true, message: '标签编号不能为空', trigger: ['change', 'blur'] }]
|
||||
},
|
||||
visible: false,
|
||||
open: '',
|
||||
mainForm: this.form,
|
||||
labelTemplateDialogObj: {
|
||||
condition: "searchText",
|
||||
tableColumn: [
|
||||
{prop: "templateCode", label: "模板编号"},
|
||||
{prop: "templateName", label: "模板名称"},
|
||||
]
|
||||
},
|
||||
fetchLabelTemplateList,
|
||||
labelTemplateDialogVisible: false,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
form: {
|
||||
handler() {
|
||||
this.mainForm = this.form
|
||||
this.$nextTick(() => {
|
||||
clearValidate.call(this, 'form', ['labelTempleCode'])
|
||||
})
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
closeVisible: {
|
||||
handler() {
|
||||
this.visible = this.closeVisible
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
//显示操作弹窗框
|
||||
showLabelTemplateDialog() {
|
||||
this.labelTemplateDialogVisible = true
|
||||
},
|
||||
labelTemplateSelected(row) {
|
||||
let me = this
|
||||
me.mainForm.labelTempleCode = row.templateCode
|
||||
me.mainForm.templateName = row.templateName
|
||||
me.mainForm.labelCategoryId = row.templateCategory
|
||||
me.mainForm.labelCategoryName = ''
|
||||
getLabelCategory(row.templateCategory).then(response => {
|
||||
me.mainForm.labelCategoryName = response.data.data.labelCategoryName
|
||||
}).catch(() => {
|
||||
hideLoading()
|
||||
})
|
||||
},
|
||||
handleSave() {
|
||||
let me = this;
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let param = {
|
||||
labelTempleCode: me.mainForm.labelTempleCode,
|
||||
configItem: me.mainForm.configItem,
|
||||
salesOrderLineBo: me.mainForm.salesOrderLineBo
|
||||
};
|
||||
// 处理响应成功后的操作
|
||||
showLoading()
|
||||
changeTemplate(param).then(response => {
|
||||
hideLoading()
|
||||
this.doConfirm()
|
||||
}).catch(() => {
|
||||
hideLoading()
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
closeForm() {
|
||||
this.visible = false
|
||||
this.$set(this, 'mainForm', {})
|
||||
this.$emit('update:closeVisible', false)
|
||||
this.$emit('afterClose', true)
|
||||
},
|
||||
doConfirm() {
|
||||
this.$emit('doConfirm', this.mainForm)
|
||||
this.closeForm()
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@ -1,245 +0,0 @@
|
||||
<template>
|
||||
<div class="execution">
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:show-close="false"
|
||||
v-el-drag-dialog
|
||||
:fullscreen="false"
|
||||
width="60%"
|
||||
:visible.sync="visible"
|
||||
:title="showTitle"
|
||||
@close="visible = false"
|
||||
center
|
||||
top="100px"
|
||||
>
|
||||
<el-tabs v-model="tabActiveName">
|
||||
<el-tab-pane :label="$t('el.tabs.main')" name="main">
|
||||
<div class="execution">
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="mainForm"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-row :gutter="5">
|
||||
<el-col :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="unitNo" :label="$t('mes.sys.unitNo')">
|
||||
<el-input
|
||||
v-model="mainForm.unitNo"
|
||||
style="width: 100%"
|
||||
:disabled="state !== 'add'"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="unitType" :label="$t('mes.sys.unitType')">
|
||||
<el-input
|
||||
v-model="mainForm.unitType"
|
||||
style="width: 100%"
|
||||
:disabled="state !== 'add'"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="transferType" :label="$t('mes.sys.transferType')">
|
||||
<el-select
|
||||
v-model="mainForm.transferType"
|
||||
style="width: 100%"
|
||||
:disabled="state === 'view'"
|
||||
@change="handleChangeTransferType"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in mainForm.transferTypeList"
|
||||
:key="item.value"
|
||||
:label="$t(item.label)"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="mainForm.transferType === '1'" :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="transferRate" :label="$t('mes.sys.transferRate')">
|
||||
<el-input
|
||||
v-model="mainForm.transferRate"
|
||||
style="width: 100%"
|
||||
:disabled="state === 'view'"
|
||||
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,5})?).*$/g, '$1')"
|
||||
onafterpaste="value=value.replace(/^\D*(\d*(?:\.\d{0,5})?).*$/g, '$1')"
|
||||
@change="handleChangeTransferRate"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="mainForm.transferType === '2'" :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="transferFunction" :label="$t('mes.sys.transferFunction')">
|
||||
<el-input
|
||||
v-model="mainForm.transferFunction"
|
||||
style="width: 100%"
|
||||
:readonly="true"
|
||||
:disabled="state === 'view'"
|
||||
>
|
||||
<i
|
||||
slot="suffix"
|
||||
class="el-input__icon el-icon-copy-document"
|
||||
@click.stop="showDialog('transferFunction')"
|
||||
></i>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12">
|
||||
<el-form-item prop="systemUnit" :label="$t('mes.sys.systemUnit')">
|
||||
<el-input
|
||||
v-model="mainForm.systemUnit"
|
||||
style="width: 100%"
|
||||
:disabled="state === 'view'"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="description" :label="$t('mes.description')">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="mainForm.description"
|
||||
style="width: 100%"
|
||||
:disabled="state === 'view'"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div style="width: 100%; display: flex; justify-content: center; margin-top: 20px">
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
v-if="state != 'view'"
|
||||
type="primary"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
size="small"
|
||||
@click="handleSave"
|
||||
>{{ $t('el.button.save') }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-circle-close" size="small" @click="closeForm"
|
||||
>{{ $t('crud.cancelBtn') }}
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { isBlank } from '@/util/string'
|
||||
import { clearValidate } from '@/util/util'
|
||||
import { showLoading, hideLoading } from '@/const/loading'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
closeVisible: Boolean,
|
||||
form: Object,
|
||||
showTitle: String,
|
||||
state: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabActiveName: 'main',
|
||||
rules: {
|
||||
unitNo: [{ required: true, message: this.$t('mes.sys.unitNoCannotBeEmpty'), trigger: ['change', 'blur'] }],
|
||||
unitType: [{ required: true, message: this.$t('mes.sys.unitTypeCannotBeEmpty'), trigger: ['change', 'blur'] }],
|
||||
transferRate: [{ required: true, message: this.$t('mes.sys.transferRateCannotBeEmpty'), trigger: ['change', 'blur'] }],
|
||||
transferFunction: [{ required: true, message: this.$t('mes.sys.transferFunctionCannotBeEmpty'), trigger: ['change', 'blur'] }],
|
||||
transferType: [
|
||||
{ required: true, trigger: ['change', 'blur'] },
|
||||
],
|
||||
systemUnit: [{ required: true, message: this.$t('mes.sys.systemUnitCannotBeEmpty'), trigger: ['change', 'blur'] }]
|
||||
},
|
||||
visible: false,
|
||||
open: '',
|
||||
mainForm: this.form,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
form: {
|
||||
handler() {
|
||||
this.mainForm = this.form
|
||||
this.$nextTick(() => {
|
||||
clearValidate.call(this, 'form', ['unitNo', 'unitType', 'transferType', 'systemUnit'])
|
||||
})
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
closeVisible: {
|
||||
handler() {
|
||||
this.visible = this.closeVisible
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleChangeTransferRate(value) {
|
||||
this.mainForm.transferRate = value
|
||||
},
|
||||
handleChangeTransferType(value) {
|
||||
if(value === '1') {
|
||||
this.mainForm.transferFunction = ''
|
||||
this.mainForm.transferRate = '1'
|
||||
} else if(value === '2') {
|
||||
this.mainForm.transferRate = '0'
|
||||
}
|
||||
},
|
||||
handleSave() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
showLoading()
|
||||
// 处理响应成功后的操作
|
||||
function handleResponse() {
|
||||
hideLoading();
|
||||
this.$message.success(this.$t('mes.save_successful'));
|
||||
this.closeForm();
|
||||
}
|
||||
|
||||
// 处理错误响应
|
||||
function handleError(error) {
|
||||
hideLoading();
|
||||
console.error('操作失败:', error);
|
||||
this.$message.error('操作失败,请检查输入数据或稍后再试');
|
||||
}
|
||||
|
||||
// 根据状态执行不同的操作
|
||||
if (this.state === 'edit') {
|
||||
update(this.mainForm)
|
||||
.then(handleResponse.bind(this))
|
||||
.catch(handleError.bind(this));
|
||||
} else {
|
||||
save(this.mainForm)
|
||||
.then(handleResponse.bind(this))
|
||||
.catch(handleError.bind(this));
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
closeForm() {
|
||||
this.visible = false
|
||||
this.$set(this, 'mainForm', {})
|
||||
this.$emit('update:closeVisible', false)
|
||||
this.$emit('afterClose', true)
|
||||
},
|
||||
showDialog(key) {
|
||||
this.$set(this, 'open', key)
|
||||
},
|
||||
selected(row) {
|
||||
if (!isBlank(row.scriptName)) {
|
||||
this.form.transferFunction = row.scriptName
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@ -1,5 +1,19 @@
|
||||
<template>
|
||||
<div class="basic-container-custom">
|
||||
<input-select-dialog :modal-obj="salesOrderDialogObj"
|
||||
:modal-fetch-fun='fetchSalesOrderList'
|
||||
:modal-show.sync="salesOrderDialogVisible"
|
||||
@inputDialogSelected="salesOrderSelected"></input-select-dialog>
|
||||
<labelTemplateChange
|
||||
:close-visible.sync="changeLabelDialogVisible"
|
||||
:form="changeLabelForm"
|
||||
@doConfirm="updateSoLineTemplate"
|
||||
></labelTemplateChange>
|
||||
<fieldValueSet
|
||||
:close-visible.sync="fieldValueSetDialogVisible"
|
||||
:form="fieldValueSetForm"
|
||||
@doConfirm="updateFiledValueSetStatus"
|
||||
></fieldValueSet>
|
||||
<div class="flex-content">
|
||||
<el-form label-suffix=":" :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
|
||||
<el-form-item
|
||||
@ -7,11 +21,11 @@
|
||||
prop="soNumber"
|
||||
>
|
||||
<el-input v-model="queryParams.soNumber" size="small" @keyup.enter.native="handleQuery">
|
||||
<i
|
||||
<!--<i
|
||||
slot="suffix"
|
||||
class="el-input__icon el-icon-copy-document"
|
||||
@click.stop="showDialog('soNumber')"
|
||||
></i>
|
||||
@click.stop="showSalesOrderDialog()"
|
||||
></i>-->
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
@ -49,7 +63,7 @@
|
||||
<div class="flex-auto">
|
||||
<el-row style="height: 100%">
|
||||
<el-col :span="16" style="height: 100%">
|
||||
<el-table ref="searchTable" :data="tableData" height="100%" :fit="true" highlight-current-row
|
||||
<el-table ref="orderLineTable" :data="tableData" height="100%" :fit="true" highlight-current-row
|
||||
@current-change="handleCurrentChange" border>
|
||||
<!-- <el-table-column label="序号" align="center" prop="seq" width="70"></el-table-column>-->
|
||||
<el-table-column
|
||||
@ -63,89 +77,130 @@
|
||||
align="center"
|
||||
prop="soLineId"
|
||||
width="100"
|
||||
show-overflow-tooltip="true"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="数量"
|
||||
align="center"
|
||||
prop="qty"
|
||||
width="100"
|
||||
show-overflow-tooltip="true"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="单位"
|
||||
align="center"
|
||||
prop="uom"
|
||||
width="70"
|
||||
show-overflow-tooltip="true"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建日期"
|
||||
align="center"
|
||||
prop="soCreateTime"
|
||||
width="140"
|
||||
show-overflow-tooltip="true"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="销售助理"
|
||||
align="center"
|
||||
prop="soAssistant"
|
||||
width="110"
|
||||
show-overflow-tooltip="true"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="标签样式"
|
||||
align="center"
|
||||
prop="configItem"
|
||||
width="100"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ formatConfigItem(scope.row.configItem) }}
|
||||
</template>
|
||||
<!--<template slot-scope="scope">
|
||||
<el-select
|
||||
:disabled="true"
|
||||
v-model="scope.row.configItem"
|
||||
@change="changeLabelTemplate($event, scope.row)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in labelConfigItemList"
|
||||
:key="item.value"
|
||||
:label="$t(item.label)"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>-->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="标签编号"
|
||||
align="center"
|
||||
prop="labelTempleCode"
|
||||
width="150"
|
||||
show-overflow-tooltip="true"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="标签类别"
|
||||
align="center"
|
||||
prop="labelCategoryName"
|
||||
width="auto"
|
||||
show-overflow-tooltip="true"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="标签名称"
|
||||
align="center"
|
||||
prop="templateName"
|
||||
width="150"
|
||||
show-overflow-tooltip="true"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column :label="$t('crud.menu')" align="center" width="80" class-name="small-padding" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="handleChangeLabelTemplate(scope.row)"
|
||||
>标签修改
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="8" style="height: 100%">
|
||||
<el-table ref="valueSetDataTabel" :data="valueSetData" height="100%" border>
|
||||
<el-table ref="valueSetDataTabel" :data="valueSetData" height="100%" :fit="true" border>
|
||||
<el-table-column label="序号" align="center" prop="seq" width="70"></el-table-column>
|
||||
<el-table-column
|
||||
label="标签字段"
|
||||
align="center"
|
||||
prop="fieldNumber"
|
||||
prop="labelField"
|
||||
width="auto"
|
||||
show-overflow-tooltip="true"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="标签字段描述"
|
||||
align="center"
|
||||
prop="fieldDescription"
|
||||
width="auto"
|
||||
show-overflow-tooltip="true"
|
||||
width="100"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="自定义值集"
|
||||
align="center"
|
||||
prop="configStatus"
|
||||
width="auto"
|
||||
show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column :label="$t('crud.menu')" align="center" width="80" class-name="small-padding">
|
||||
width="90"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ formatConfigStatus(scope.row.configStatus) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('crud.menu')" align="center" width="80" class-name="small-padding" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<!-- 複製 -->
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
:disabled="!(scope.row.fieldType === 'zdyzj' && scope.row.getValueContext === 'SERIAL_NUMBER')"
|
||||
@click="handleSetValue(scope.row)"
|
||||
>值集配置
|
||||
</el-button>
|
||||
@ -172,14 +227,18 @@
|
||||
import { mapGetters } from 'vuex'
|
||||
import { isBlank } from '@/util/string'
|
||||
import { copyJSON } from '@/util/util'
|
||||
import { iniCopy, initForm, initQueryParam, transferTypeList } from '@/views/mes/print/customer-label/init'
|
||||
import { renderSpecNameHeader, clear } from '@/components/table-header-pop/render'
|
||||
import {fetchList, listSoLineLabelValueSet} from '@/api/mes/print/sales-order-line-label-value-config'
|
||||
import { initForm, initFieldSetForm, initQueryParam } from '@/views/mes/print/customer-label/init'
|
||||
import { renderSpecNameHeader } from '@/components/table-header-pop/render'
|
||||
import {fetchList, listSoLineLabelValueSet, getConfigLabelTemplate} from '@/api/mes/print/sales-order-line-label-value-config'
|
||||
import {fetchList as fetchSalesOrderList} from '@/api/mes/prd/sales-order'
|
||||
import {remote} from '@/api/admin/dict'
|
||||
import {showLoading, hideLoading} from "@/const/loading";
|
||||
import labelTemplateChange from '@/views/mes/print/customer-label/content/label-template-change.vue'
|
||||
import fieldValueSet from '@/views/mes/print/customer-label/content/field-value-set.vue'
|
||||
|
||||
export default {
|
||||
name: 'customer-label',
|
||||
components: {},
|
||||
components: {labelTemplateChange, fieldValueSet},
|
||||
data() {
|
||||
return {
|
||||
// 显示搜索条件
|
||||
@ -189,14 +248,13 @@ export default {
|
||||
// 已办任务列表数据
|
||||
tableData: [],
|
||||
valueSetData: [],
|
||||
labelConfigItemList: [],
|
||||
currentRow: null,
|
||||
title: this.$t('mes.sys.unitBasis'),
|
||||
// 弹出层显示标识
|
||||
visible: false,
|
||||
// 弹出层标题
|
||||
showTitle: '',
|
||||
// 弹出层状态
|
||||
state: '',
|
||||
changeLabelDialogVisible: false,
|
||||
fieldValueSetDialogVisible: false,
|
||||
salesOrderDialogVisible: false,
|
||||
// 是否显示弹出层
|
||||
open: '',
|
||||
src: '',
|
||||
@ -204,28 +262,26 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: copyJSON(initQueryParam),
|
||||
// 表单参数
|
||||
form: copyJSON(initForm),
|
||||
changeLabelForm: copyJSON(initForm),
|
||||
fieldValueSetForm: copyJSON(initFieldSetForm),
|
||||
fetchSalesOrderList,
|
||||
salesOrderDialogObj: {
|
||||
condition: "searchText",
|
||||
tableColumn: [
|
||||
{prop: "soNumber", label: "订单编号"}
|
||||
]
|
||||
},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
transferTypeList,
|
||||
isBlank,
|
||||
renderSpecNameHeader,
|
||||
options: {
|
||||
refresh: this.refresh,
|
||||
visible: true,
|
||||
property: {
|
||||
dateCreate: {
|
||||
type: 'datetime',
|
||||
}
|
||||
},
|
||||
},
|
||||
renderSpecNameHeader
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.addBtn = this.permissions['sys_unit_basis_save']
|
||||
this.editBtn = this.permissions['sys_unit_basis_edit']
|
||||
this.delBtn = this.permissions['sys_unit_basis_del']
|
||||
this.transferTypeList = transferTypeList
|
||||
this.getLabelConfigItem()
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['permissions']),
|
||||
@ -245,10 +301,113 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
//显示操作弹窗框
|
||||
showSalesOrderDialog() {
|
||||
this.salesOrderDialogVisible = true
|
||||
},
|
||||
salesOrderSelected(row) {
|
||||
let me = this
|
||||
me.queryParams.soNumber = row.soNumber
|
||||
},
|
||||
changeLabelTemplate(e, row) {
|
||||
let me = this;
|
||||
let param = {
|
||||
salesOrderLineBo: row.salesOrderLineBo,
|
||||
configName: row.configItem
|
||||
}
|
||||
row.labelTempleCode = ''
|
||||
row.labelCategoryName = ''
|
||||
row.templateName = ''
|
||||
getConfigLabelTemplate(param)
|
||||
.then((response) => {
|
||||
let data = response.data.data
|
||||
row.labelTempleCode = data.templateCode
|
||||
row.labelCategoryName = data.templateCategory
|
||||
row.templateName = data.templateName
|
||||
// 判断当前行是否选中
|
||||
if (!me.currentRow || me.currentRow.salesOrderLineBo !== row.salesOrderLineBo) {
|
||||
me.$refs.orderLineTable.setCurrentRow(row)
|
||||
} else {
|
||||
me.handleCurrentChange()
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
getLabelConfigItem() {
|
||||
remote("label_config_item").then((response) => {
|
||||
const code = response.data.code
|
||||
if (code === 0) {
|
||||
this.labelConfigItemList = response.data.data
|
||||
}
|
||||
})
|
||||
},
|
||||
formatConfigItem(configItem) {
|
||||
if(this.labelConfigItemList && this.labelConfigItemList.length > 0) {
|
||||
for(let i = 0; i < this.labelConfigItemList.length; i++) {
|
||||
if(configItem === this.labelConfigItemList[i].value) {
|
||||
return this.labelConfigItemList[i].label
|
||||
}
|
||||
}
|
||||
}
|
||||
return configItem
|
||||
},
|
||||
formatConfigStatus(configStatus) {
|
||||
return configStatus === '0' ? '不可用' : configStatus === '1' ? '未配置' : '已配置'
|
||||
},
|
||||
handleChangeLabelTemplate(row) {
|
||||
if(isBlank(row.configItem)) {
|
||||
return this.$message.warning("请先选择标签样式")
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.changeLabelDialogVisible = true
|
||||
this.changeLabelForm = copyJSON(row)
|
||||
}, 100)
|
||||
},
|
||||
handleSetValue(row) {
|
||||
setTimeout(() => {
|
||||
this.fieldValueSetDialogVisible = true
|
||||
let soLineRow = this.currentRow
|
||||
this.fieldValueSetForm = copyJSON(row)
|
||||
this.fieldValueSetForm.soNumber = soLineRow.soNumber
|
||||
this.fieldValueSetForm.soLineId = soLineRow.soLineId
|
||||
this.fieldValueSetForm.labelCategoryName = soLineRow.labelCategoryName
|
||||
this.fieldValueSetForm.salesOrderLineBo = soLineRow.salesOrderLineBo
|
||||
this.fieldValueSetForm.configItem = soLineRow.configItem
|
||||
this.fieldValueSetForm.labelTempleCode = soLineRow.labelTempleCode
|
||||
}, 100)
|
||||
},
|
||||
updateSoLineTemplate(row) {
|
||||
for(let i = 0; i < this.tableData.length; i++) {
|
||||
let data = this.tableData[i]
|
||||
if(data.salesOrderLineBo === row.salesOrderLineBo) {
|
||||
data.labelTempleCode = row.labelTempleCode
|
||||
data.labelCategoryName = row.labelCategoryName
|
||||
data.templateName = row.templateName
|
||||
data.labelCategoryId = row.labelCategoryId
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
updateFiledValueSetStatus(row) {
|
||||
for(let i = 0; i < this.valueSetData.length; i++) {
|
||||
let data = this.valueSetData[i]
|
||||
if(data.labelField === row.labelField) {
|
||||
data.configStatus = '2'
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 查询流程定义列表 */
|
||||
getList() {
|
||||
showLoading()
|
||||
fetchList(this.addDateRange(this.queryParams, this.dateRange))
|
||||
// 获取this.labelConfigItemList的value列表
|
||||
let configItemList = ['ZCT_WXYS','ZCT_GXMYS'];
|
||||
if(this.labelConfigItemList && this.labelConfigItemList.length > 0) {
|
||||
configItemList = this.labelConfigItemList.map(item => item.value)
|
||||
}
|
||||
this.queryParams.configItemList = configItemList
|
||||
showLoading()
|
||||
fetchList(this.addDateRange(this.queryParams, this.dateRange))
|
||||
.then((response) => {
|
||||
hideLoading()
|
||||
this.tableData = response.data.data.records
|
||||
@ -261,7 +420,8 @@ export default {
|
||||
getValueSetList(row) {
|
||||
let param = {
|
||||
labelNumber: row.labelTempleCode,
|
||||
salesOrderLineBo: row.salesOrderLineBo
|
||||
salesOrderLineBo: row.salesOrderLineBo,
|
||||
configItem: row.configItem
|
||||
}
|
||||
this.valueSetData = []
|
||||
showLoading()
|
||||
@ -278,70 +438,6 @@ export default {
|
||||
this.currentRow = val;
|
||||
this.getValueSetList(val);
|
||||
},
|
||||
handleAdd() {
|
||||
setTimeout(() => {
|
||||
this.state = 'add'
|
||||
this.visible = true
|
||||
this.showTitle = this.title + ' - ' + this.$t('mes.new')
|
||||
this.form = copyJSON(initForm)
|
||||
this.form.transferTypeList = this.transferTypeList
|
||||
}, 100)
|
||||
},
|
||||
view(row) {
|
||||
setTimeout(() => {
|
||||
this.state = 'view'
|
||||
this.visible = true
|
||||
this.showTitle = this.title + ' - ' + this.$t('mes.view')
|
||||
this.form = copyJSON(row)
|
||||
this.form.transferTypeList = this.transferTypeList
|
||||
}, 100)
|
||||
},
|
||||
handleUpdate(row) {
|
||||
setTimeout(() => {
|
||||
this.state = 'edit'
|
||||
this.visible = true
|
||||
this.showTitle = this.title + ' - ' + this.$t('mes.edit')
|
||||
this.form = copyJSON(row)
|
||||
this.form.transferTypeList = this.transferTypeList
|
||||
}, 100)
|
||||
},
|
||||
handleSetValue(row) {
|
||||
setTimeout(() => {
|
||||
this.state = 'add'
|
||||
this.visible = true
|
||||
this.showTitle = this.title + ' - ' + this.$t('mes.new')
|
||||
this.form = copyJSON(row)
|
||||
this.form = Object.assign({}, this.form, iniCopy)
|
||||
this.form.transferTypeList = this.transferTypeList
|
||||
}, 100)
|
||||
},
|
||||
handleDel: function (row) {
|
||||
this.$confirm(this.$t('mes.sys.confirmDeletionWithItem', { item: row.soNumber }), this.$t('common.prompt'), {
|
||||
confirmButtonText: this.$t('el.colorpicker.confirm'),
|
||||
cancelButtonText: this.$t('el.datepicker.cancel'),
|
||||
type: 'warning',
|
||||
})
|
||||
.then(function () {
|
||||
return remove({ handle: row.handle })
|
||||
})
|
||||
.then(() => {
|
||||
this.$message.success(this.$t('mes.deleteSuccess'))
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
refresh(params) {
|
||||
this.queryParams = Object.assign({}, this.queryParams, params)
|
||||
this.handleQuery()
|
||||
},
|
||||
showDialog(key) {
|
||||
this.$set(this, 'open', key)
|
||||
},
|
||||
selected(row, type) {
|
||||
this.queryParams[type] = row[type]
|
||||
},
|
||||
clearValue(key) {
|
||||
this.queryParams[key] = ''
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.current = 1
|
||||
@ -351,17 +447,8 @@ export default {
|
||||
resetQuery() {
|
||||
this.dateRange = []
|
||||
this.resetForm('queryForm')
|
||||
clear.call(this, this.$refs.searchTable)
|
||||
this.queryParams = copyJSON(initQueryParam)
|
||||
this.handleQuery()
|
||||
},
|
||||
transferTypeFormatter(row) {
|
||||
for (var i = 0; i < transferTypeList.length; i++) {
|
||||
if (transferTypeList[i].value === row.transferType) {
|
||||
return transferTypeList[i].label
|
||||
}
|
||||
}
|
||||
return row.transferType
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@ -10,12 +10,16 @@ export const iniCopy = {
|
||||
}
|
||||
|
||||
export const initForm = {
|
||||
...iniCopy,
|
||||
transferType: '1',
|
||||
transferRate: '',
|
||||
transferFunction: '',
|
||||
systemUnit: '',
|
||||
description: ''
|
||||
changeLabelForm: '',
|
||||
labelTempleName: '',
|
||||
labelCategoryName: ''
|
||||
}
|
||||
|
||||
export const initFieldSetForm = {
|
||||
soNumber: '',
|
||||
soLineId: '',
|
||||
labelCategoryName: '',
|
||||
fieldDescription: ''
|
||||
}
|
||||
|
||||
export const transferTypeList = [{
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
<el-option key="pattern" label="JSON路径" value="pattern"/>
|
||||
<el-option key="fixed" label="固定值" value="fixed"/>
|
||||
<el-option key="script" label="javaScript" value="script"/>
|
||||
<el-option key="zdyzj" label="自定义值集" value="zdyzj"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@ -398,7 +398,7 @@
|
||||
>
|
||||
</tooltip>
|
||||
</template>
|
||||
<div v-if="state === 'view' || state === 'edit' || state === 'createdJob'">
|
||||
<div v-if="state === 'view' || state === 'createdJob'">
|
||||
{{ form.item }}
|
||||
</div>
|
||||
<el-input
|
||||
@ -432,7 +432,7 @@
|
||||
>
|
||||
</tooltip>
|
||||
</template>
|
||||
<div v-if="state === 'view' || state === 'edit' || state === 'createdJob'">
|
||||
<div v-if="state === 'view' || state === 'createdJob'">
|
||||
{{ form.operation }}
|
||||
</div>
|
||||
<el-input
|
||||
@ -679,7 +679,7 @@
|
||||
<el-select
|
||||
v-model="scope.row.isRequired"
|
||||
placeholder=""
|
||||
:disabled="state === 'view'"
|
||||
:disabled="state === 'view' || state === 'createdJob'"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option key="Y" label="是" value="Y"></el-option>
|
||||
@ -693,7 +693,7 @@
|
||||
<el-select
|
||||
v-model="scope.row.photosMust"
|
||||
placeholder=""
|
||||
:disabled="state === 'view'"
|
||||
:disabled="state === 'view' || state === 'createdJob'"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option key="Y" label="是" value="Y"></el-option>
|
||||
@ -707,7 +707,7 @@
|
||||
<el-select
|
||||
v-model="scope.row.avgJudge"
|
||||
placeholder=""
|
||||
:disabled="state === 'view'"
|
||||
:disabled="state === 'view' || state === 'createdJob'"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option key="N" label="否" value="N"></el-option>
|
||||
|
||||
@ -369,7 +369,7 @@ export default {
|
||||
this.showTitle = this.title + ' - ' + this.$t('common.view')
|
||||
this.state = 'view'
|
||||
showLoading()
|
||||
await this.getObjAPI(row)
|
||||
await this.getObjAPI(row,null,'view')
|
||||
hideLoading()
|
||||
this.visible = true
|
||||
},
|
||||
@ -378,32 +378,37 @@ export default {
|
||||
this.showTitle = this.title + ' - ' + this.$t('common.new')
|
||||
this.state = 'add'
|
||||
showLoading()
|
||||
await this.getObjAPI(row, 'copy')
|
||||
await this.getObjAPI(row, 'copy','add')
|
||||
hideLoading()
|
||||
this.visible = true
|
||||
},
|
||||
// 编辑
|
||||
async handleUpdate(row) {
|
||||
let me = this
|
||||
this.showTitle = this.title + ' - ' + this.$t('common.edit')
|
||||
this.editInput = true
|
||||
showLoading()
|
||||
await this.getObjAPI(row)
|
||||
setTimeout(() => {
|
||||
this.state = this.form.createdJob ? 'createdJob' : 'edit'
|
||||
}, 300)
|
||||
await this.getObjAPI(row,null,'createdJobAndEdit')
|
||||
// setTimeout(() => {
|
||||
// this.state = me.form.createdJob ? 'createdJob' : 'edit'
|
||||
// }, 300)
|
||||
|
||||
hideLoading()
|
||||
this.visible = true
|
||||
},
|
||||
// 查 单笔 资料
|
||||
async getObjAPI(row, key) {
|
||||
async getObjAPI(row, key,type) {
|
||||
let me = this
|
||||
getObj(row.handle).then((res) => {
|
||||
this.form = res.data.data
|
||||
me.form = res.data.data
|
||||
if (key == 'copy') {
|
||||
this.form.handle = null
|
||||
this.form.qcPlan = null
|
||||
this.form.revision = null
|
||||
}
|
||||
if (type === 'createdJobAndEdit') {
|
||||
me.state = me.form.createdJob ? 'createdJob' : 'edit'
|
||||
}
|
||||
this.initCustomFields(row.handle, this.tableName)
|
||||
})
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user