|
|
|
@ -1,122 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<el-dialog :title="!dataForm.id ? '新建' :'编辑'"
|
|
|
|
|
:close-on-click-modal="false" append-to-body
|
|
|
|
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
|
|
|
|
width="600px">
|
|
|
|
|
<template>
|
|
|
|
|
<el-dialog :title="!dataForm.id ? '新建' : '编辑'" :close-on-click-modal="false" append-to-body :visible.sync="visible"
|
|
|
|
|
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="600px">
|
|
|
|
|
<el-row :gutter="15" class="">
|
|
|
|
|
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" >
|
|
|
|
|
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
|
|
|
|
|
label-position="right">
|
|
|
|
|
<template v-if="!loading">
|
|
|
|
|
<!-- 具体表单 -->
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="母件编码" prop="pieceId" >
|
|
|
|
|
<JnpfInput v-model="dataForm.pieceId" @change="changeData('pieceId',-1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="母件编码" prop="pieceId">
|
|
|
|
|
<JnpfInput v-model="dataForm.pieceId" @change="changeData('pieceId', -1)" placeholder="请输入"
|
|
|
|
|
clearable :style='{ "width": "100%" }'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="母件名称" prop="pieceName" >
|
|
|
|
|
<JnpfInput v-model="dataForm.pieceName" @change="changeData('pieceName',-1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="母件名称" prop="pieceName">
|
|
|
|
|
<JnpfInput v-model="dataForm.pieceName" @change="changeData('pieceName', -1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{ "width": "100%" }'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="规格型号" prop="models" >
|
|
|
|
|
<JnpfInput v-model="dataForm.models" @change="changeData('models',-1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="规格型号" prop="models">
|
|
|
|
|
<JnpfInput v-model="dataForm.models" @change="changeData('models', -1)" placeholder="请输入"
|
|
|
|
|
clearable :style='{ "width": "100%" }'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="计量单位" prop="unit" >
|
|
|
|
|
<JnpfInput v-model="dataForm.unit" @change="changeData('unit',-1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="计量单位" prop="unit">
|
|
|
|
|
<JnpfInput v-model="dataForm.unit" @change="changeData('unit', -1)" placeholder="请输入"
|
|
|
|
|
clearable :style='{ "width": "100%" }'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="版本代号" prop="versionCode" >
|
|
|
|
|
<JnpfInput v-model="dataForm.versionCode" @change="changeData('versionCode',-1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="版本代号" prop="versionCode">
|
|
|
|
|
<JnpfInput v-model="dataForm.versionCode" @change="changeData('versionCode', -1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{ "width": "100%" }'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="版本说明" prop="versionIllustrate" >
|
|
|
|
|
<JnpfInput v-model="dataForm.versionIllustrate" @change="changeData('versionIllustrate',-1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="版本说明" prop="versionIllustrate">
|
|
|
|
|
<JnpfInput v-model="dataForm.versionIllustrate" @change="changeData('versionIllustrate', -1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{ "width": "100%" }'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="版本日期" prop="versionDate" >
|
|
|
|
|
<JnpfInput v-model="dataForm.versionDate" @change="changeData('versionDate',-1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="版本日期" prop="versionDate">
|
|
|
|
|
<JnpfDatePicker v-model="dataForm.versionDate" @change="changeData('versionDate', -1)"
|
|
|
|
|
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
|
|
|
|
|
placeholder="请选择" clearable :style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
|
|
|
|
|
</JnpfDatePicker>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="创建时间" prop="creatorTime" >
|
|
|
|
|
<JnpfInput v-model="dataForm.creatorTime" @change="changeData('creatorTime',-1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="创建时间" prop="creatorTime">
|
|
|
|
|
<JnpfDatePicker v-model="dataForm.creatorTime" @change="changeData('creatorTime', -1)"
|
|
|
|
|
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
|
|
|
|
|
placeholder="请选择" clearable :style='{ "width": "100%" }' type="datetime"
|
|
|
|
|
format="yyyy-MM-dd HH:mm:ss">
|
|
|
|
|
</JnpfDatePicker>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="单据状态" prop="documentStatus" >
|
|
|
|
|
<JnpfInput v-model="dataForm.documentStatus" @change="changeData('documentStatus',-1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="单据状态" prop="documentStatus">
|
|
|
|
|
<JnpfSelect v-model="dataForm.documentStatus" @change="changeData('documentStatus', -1)"
|
|
|
|
|
placeholder="请选择" clearable :style='{ "width": "100%" }' :options="documentStatusOptions"
|
|
|
|
|
:props="documentStatusProps">
|
|
|
|
|
</JnpfSelect>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- 表单结束 -->
|
|
|
|
|
</template>
|
|
|
|
|
</el-form>
|
|
|
|
|
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
|
|
|
|
|
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/>
|
|
|
|
|
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
|
|
|
|
|
@select="addForSelect" @close="selectDialogVisible = false" />
|
|
|
|
|
</el-row>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<div class="upAndDown-button" v-if="dataForm.id">
|
|
|
|
|
<el-button @click="prev" :disabled='prevDis'>
|
|
|
|
|
{{'上一条'}}
|
|
|
|
|
{{ '上一条' }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button @click="next" :disabled='nextDis'>
|
|
|
|
|
{{'下一条'}}
|
|
|
|
|
{{ '下一条' }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
|
|
|
|
|
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-button>
|
|
|
|
|
{{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-button>
|
|
|
|
|
<el-button @click="visible = false"> 取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> 确 定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import request from '@/utils/request'
|
|
|
|
|
import {mapGetters} from "vuex";
|
|
|
|
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
|
|
|
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
|
|
|
|
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
|
|
|
|
|
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
|
|
|
|
|
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
|
|
|
|
|
import { thousandsFormat } from "@/components/Generator/utils/index"
|
|
|
|
|
export default {
|
|
|
|
|
components: { },
|
|
|
|
|
import request from '@/utils/request'
|
|
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
|
|
|
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
|
|
|
|
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
|
|
|
|
|
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
|
|
|
|
|
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
|
|
|
|
|
import { thousandsFormat } from "@/components/Generator/utils/index"
|
|
|
|
|
export default {
|
|
|
|
|
components: {},
|
|
|
|
|
props: [],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
@ -130,48 +123,50 @@
|
|
|
|
|
loading: false,
|
|
|
|
|
btnLoading: false,
|
|
|
|
|
formRef: 'formRef',
|
|
|
|
|
setting:{},
|
|
|
|
|
setting: {},
|
|
|
|
|
eventType: '',
|
|
|
|
|
userBoxVisible:false,
|
|
|
|
|
userBoxVisible: false,
|
|
|
|
|
selectDialogVisible: false,
|
|
|
|
|
currTableConf:{},
|
|
|
|
|
dataValueAll:{},
|
|
|
|
|
addTableConf:{
|
|
|
|
|
currTableConf: {},
|
|
|
|
|
dataValueAll: {},
|
|
|
|
|
addTableConf: {
|
|
|
|
|
},
|
|
|
|
|
//可选范围默认值
|
|
|
|
|
ableAll:{
|
|
|
|
|
ableAll: {
|
|
|
|
|
},
|
|
|
|
|
tableRows:{
|
|
|
|
|
tableRows: {
|
|
|
|
|
},
|
|
|
|
|
Vmodel:"",
|
|
|
|
|
currVmodel:"",
|
|
|
|
|
Vmodel: "",
|
|
|
|
|
currVmodel: "",
|
|
|
|
|
dataForm: {
|
|
|
|
|
pieceId : undefined,
|
|
|
|
|
pieceName : undefined,
|
|
|
|
|
models : undefined,
|
|
|
|
|
unit : undefined,
|
|
|
|
|
versionCode : undefined,
|
|
|
|
|
versionIllustrate : undefined,
|
|
|
|
|
versionDate : undefined,
|
|
|
|
|
creatorTime : undefined,
|
|
|
|
|
documentStatus : undefined,
|
|
|
|
|
pieceId: undefined,
|
|
|
|
|
pieceName: undefined,
|
|
|
|
|
models: undefined,
|
|
|
|
|
unit: undefined,
|
|
|
|
|
versionCode: undefined,
|
|
|
|
|
versionIllustrate: undefined,
|
|
|
|
|
versionDate: undefined,
|
|
|
|
|
creatorTime: undefined,
|
|
|
|
|
documentStatus: "2",
|
|
|
|
|
},
|
|
|
|
|
tableRequiredData: {},
|
|
|
|
|
dataRule:
|
|
|
|
|
{
|
|
|
|
|
},
|
|
|
|
|
childIndex:-1,
|
|
|
|
|
isEdit:false,
|
|
|
|
|
documentStatusOptions: [{ "fullName": "已审核", "id": "1" }, { "fullName": "未审核", "id": "2" }],
|
|
|
|
|
documentStatusProps: { "label": "fullName", "value": "id" },
|
|
|
|
|
childIndex: -1,
|
|
|
|
|
isEdit: false,
|
|
|
|
|
interfaceRes: {
|
|
|
|
|
pieceId:[] ,
|
|
|
|
|
pieceName:[] ,
|
|
|
|
|
models:[] ,
|
|
|
|
|
unit:[] ,
|
|
|
|
|
versionCode:[] ,
|
|
|
|
|
versionIllustrate:[] ,
|
|
|
|
|
versionDate:[] ,
|
|
|
|
|
creatorTime:[] ,
|
|
|
|
|
documentStatus:[] ,
|
|
|
|
|
pieceId: [],
|
|
|
|
|
pieceName: [],
|
|
|
|
|
models: [],
|
|
|
|
|
unit: [],
|
|
|
|
|
versionCode: [],
|
|
|
|
|
versionIllustrate: [],
|
|
|
|
|
versionDate: [],
|
|
|
|
|
creatorTime: [],
|
|
|
|
|
documentStatus: [],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -184,7 +179,7 @@
|
|
|
|
|
this.initDefaultData()
|
|
|
|
|
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
|
|
|
|
},
|
|
|
|
|
mounted() {},
|
|
|
|
|
mounted() { },
|
|
|
|
|
methods: {
|
|
|
|
|
prev() {
|
|
|
|
|
this.index--
|
|
|
|
@ -214,7 +209,7 @@
|
|
|
|
|
},
|
|
|
|
|
getInfo(id) {
|
|
|
|
|
request({
|
|
|
|
|
url: '/api/example/YysBillMaterial/'+ id,
|
|
|
|
|
url: '/api/example/YysBillMaterial/' + id,
|
|
|
|
|
method: 'get'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.dataInfo(res.data)
|
|
|
|
@ -238,7 +233,7 @@
|
|
|
|
|
for (let i = 0; i < faceReList.length; i++) {
|
|
|
|
|
if (faceReList[i].relationField == model) {
|
|
|
|
|
let options = 'get' + key + 'Options';
|
|
|
|
|
if(this[options]){
|
|
|
|
|
if (this[options]) {
|
|
|
|
|
this[options]()
|
|
|
|
|
}
|
|
|
|
|
this.changeData(key, index)
|
|
|
|
@ -247,8 +242,8 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
changeDataFormData(type, data, model,index,defaultValue) {
|
|
|
|
|
if(!this.isEdit) {
|
|
|
|
|
changeDataFormData(type, data, model, index, defaultValue) {
|
|
|
|
|
if (!this.isEdit) {
|
|
|
|
|
if (type == 2) {
|
|
|
|
|
for (let i = 0; i < this.dataForm[data].length; i++) {
|
|
|
|
|
if (index == -1) {
|
|
|
|
@ -262,12 +257,12 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
dataAll(){
|
|
|
|
|
dataAll() {
|
|
|
|
|
},
|
|
|
|
|
clearData(){
|
|
|
|
|
clearData() {
|
|
|
|
|
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
|
|
|
|
},
|
|
|
|
|
init(id,isDetail,allList) {
|
|
|
|
|
init(id, isDetail, allList) {
|
|
|
|
|
this.prevDis = false
|
|
|
|
|
this.nextDis = false
|
|
|
|
|
this.allList = allList || []
|
|
|
|
@ -286,16 +281,16 @@
|
|
|
|
|
this.dataForm.id = id || 0;
|
|
|
|
|
this.visible = true;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
if(this.dataForm.id){
|
|
|
|
|
if (this.dataForm.id) {
|
|
|
|
|
this.loading = true
|
|
|
|
|
request({
|
|
|
|
|
url: '/api/example/YysBillMaterial/'+this.dataForm.id,
|
|
|
|
|
url: '/api/example/YysBillMaterial/' + this.dataForm.id,
|
|
|
|
|
method: 'get'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.dataInfo(res.data)
|
|
|
|
|
this.loading = false
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
this.clearData()
|
|
|
|
|
this.initDefaultData()
|
|
|
|
|
}
|
|
|
|
@ -316,7 +311,7 @@
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
request() {
|
|
|
|
|
let _data =this.dataList()
|
|
|
|
|
let _data = this.dataList()
|
|
|
|
|
if (this.dataFormSubmitType == 2) {
|
|
|
|
|
this.continueBtnLoading = true
|
|
|
|
|
} else {
|
|
|
|
@ -346,13 +341,13 @@
|
|
|
|
|
this.$emit('refresh', true)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}).catch(()=>{
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.btnLoading = false
|
|
|
|
|
this.continueBtnLoading = false
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
request({
|
|
|
|
|
url: '/api/example/YysBillMaterial/'+this.dataForm.id,
|
|
|
|
|
url: '/api/example/YysBillMaterial/' + this.dataForm.id,
|
|
|
|
|
method: 'PUT',
|
|
|
|
|
data: _data
|
|
|
|
|
}).then((res) => {
|
|
|
|
@ -367,15 +362,15 @@
|
|
|
|
|
this.$emit('refresh', true)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}).catch(()=>{
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.btnLoading = false
|
|
|
|
|
this.continueBtnLoading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
openSelectDialog(key) {
|
|
|
|
|
this.currTableConf=this.addTableConf[key]
|
|
|
|
|
this.currVmodel=key
|
|
|
|
|
this.currTableConf = this.addTableConf[key]
|
|
|
|
|
this.currVmodel = key
|
|
|
|
|
this.selectDialogVisible = true
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.selectDialog.init()
|
|
|
|
@ -384,8 +379,8 @@
|
|
|
|
|
addForSelect(data) {
|
|
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
|
|
let t = data[i]
|
|
|
|
|
if(this['get'+this.currVmodel]){
|
|
|
|
|
this['get'+this.currVmodel](t)
|
|
|
|
|
if (this['get' + this.currVmodel]) {
|
|
|
|
|
this['get' + this.currVmodel](t)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -452,18 +447,18 @@
|
|
|
|
|
}
|
|
|
|
|
return timeDataValue;
|
|
|
|
|
},
|
|
|
|
|
dataList(){
|
|
|
|
|
dataList() {
|
|
|
|
|
var _data = this.dataForm;
|
|
|
|
|
return _data;
|
|
|
|
|
},
|
|
|
|
|
dataInfo(dataAll){
|
|
|
|
|
let _dataAll =dataAll
|
|
|
|
|
dataInfo(dataAll) {
|
|
|
|
|
let _dataAll = dataAll
|
|
|
|
|
this.dataForm = _dataAll
|
|
|
|
|
this.isEdit = true
|
|
|
|
|
this.dataAll()
|
|
|
|
|
this.childIndex=-1
|
|
|
|
|
this.childIndex = -1
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|