物料绑定基础

master
mhsnet 2 months ago
parent d04fe0af2b
commit 67ed7b35b2

@ -0,0 +1,194 @@
<template>
<el-dialog
title="物料信息"
:close-on-click-modal="false"
:visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center"
lock-scroll
append-to-body
width="1300px"
>
<el-row>
<el-col :span="24">
<el-row :style="{ margin: '15px 0px' }">
<el-col :span="8">
<el-row>
<el-col :span="5" :style="{ lineHeight: '30px' }">
母件编码
</el-col>
<el-col :span="14">
<el-input
placeholder="请输入内容"
v-model="queryParams.pieceId"
clearable
></el-input>
</el-col>
</el-row>
</el-col>
<el-col :span="8">
<el-row>
<el-col :span="5" :style="{ lineHeight: '30px' }">
母件名称
</el-col>
<el-col :span="14">
<el-input
placeholder="请输入内容"
v-model="queryParams.pieceName"
clearable
></el-input>
</el-col>
</el-row>
</el-col>
<el-col :span="8">
<el-button type="primary" icon="el-icon-search" @click="fnSch"
>查询</el-button
>
<el-button icon="el-icon-refresh-right" @click="fnResetSch"
>重置</el-button
>
</el-col>
</el-row>
</el-col>
<el-col :span="24">
<el-table
ref="multipleTable"
:data="dbList"
tooltip-effect="dark"
style="width: 100%"
@selection-change="fnSltChg"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column label="母件编码" width="120">
<template slot-scope="scope">{{ scope.row.pieceId }}</template>
</el-table-column>
<el-table-column label="母件名称" width="120">
<template slot-scope="scope">{{ scope.row.pieceName }}</template>
</el-table-column>
<el-table-column label="规格型号" width="120">
<template slot-scope="scope">{{ scope.row.models }}</template>
</el-table-column>
<el-table-column label="计量单位" width="120">
<template slot-scope="scope">{{ scope.row.unit }}</template>
</el-table-column>
<el-table-column label="版本代号" width="120">
<template slot-scope="scope">{{ scope.row.versionCode }}</template>
</el-table-column>
<el-table-column label="版本说明" width="120">
<template slot-scope="scope">{{
scope.row.versionIllustrate
}}</template>
</el-table-column>
<el-table-column label="版本日期" width="120">
<template slot-scope="scope">{{ scope.row.versionDate }}</template>
</el-table-column>
<el-table-column label="单据状态" width="120">
<template slot-scope="scope">{{
scope.row.documentStatus
}}</template>
</el-table-column>
<el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.creatorTime }}</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="24" :style="{ textAlign: 'right', margin: '15px 0px' }">
<el-pagination
@size-change="fnPageSizeChg"
@current-change="fnPageCurrentChg"
:current-page="pageCurrent"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="pageTotal"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
</el-col>
</el-row>
<div slot="footer">
<el-button @click="fnCancel"> </el-button>
<el-button type="primary" @click="fnOk"> </el-button>
</div>
</el-dialog>
</template>
<script>
import request from "@/utils/request";
export default {
data() {
return {
visible: false,
dbList: [],
sltdRows: [],
pageSize: 10,
pageCurrent: 1,
pageTotal: 0,
queryParams: {
pieceId: "",
pieceName: ""
}
};
},
methods: {
init() {
this.getList();
this.visible = true;
},
getList() {
this.listLoading = true;
let _query = {
dataType: 0,
keyword: "",
menuId: "591256890197938117",
moduleId: "591255830234402757",
sidx: "",
sort: "desc",
superQueryJson: "",
type: 1,
documentStatus: "1",
pieceId: this.queryParams.pieceId,
pieceName: this.queryParams.pieceName,
pageSize: this.pageSize,
currentPage: this.pageCurrent
};
request({
url: `/api/example/YysBillMaterial/getList`,
method: "post",
data: _query
}).then(res => {
var _list = res.data.list;
this.dbList = _list;
this.pageTotal = res.data.pagination.total;
});
},
fnSltChg(sltdRowsNow) {
this.sltdRows = sltdRowsNow;
},
fnPageSizeChg(pageSizeNow) {
this.pageSize = pageSizeNow;
this.pageCurrent = 1;
this.fnSch();
},
fnPageCurrentChg(pageCurrentNow) {
this.pageCurrent = pageCurrentNow;
this.fnSch();
},
fnSch() {
this.getList();
},
fnResetSch() {
this.queryParams.pieceId = "";
this.queryParams.pieceName = "";
this.fnSch();
},
fnCancel() {
this.visible = false;
},
fnOk() {
this.$emit('cbSltdChg', this.sltdRows)
this.fnCancel();
}
}
};
</script>
<style lang="scss" scoped></style>

@ -1,68 +1,152 @@
<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-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="deviceCode">
<JnpfInput v-model="dataForm.deviceCode" @change="changeData('deviceCode', -1)"
placeholder="请输入设备编号" clearable :style='{ "width": "100%" }'>
<JnpfInput
v-model="dataForm.deviceCode"
@change="changeData('deviceCode', -1)"
placeholder="请输入设备编号"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="设备名称" prop="deviceName">
<JnpfInput v-model="dataForm.deviceName" @change="changeData('deviceName', -1)"
placeholder="请输入设备名称" clearable :style='{ "width": "100%" }'>
<JnpfInput
v-model="dataForm.deviceName"
@change="changeData('deviceName', -1)"
placeholder="请输入设备名称"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="所属部门" prop="deviceDept">
<JnpfDepSelect v-model="dataForm.deviceDept" @change="changeData('deviceDept', -1)"
placeholder="请选择所属部门" selectType="all" :ableIds="ableAll.deviceDeptableIds" clearable
:style='{ "width": "100%" }'>
<JnpfDepSelect
v-model="dataForm.deviceDept"
@change="changeData('deviceDept', -1)"
placeholder="请选择所属部门"
selectType="all"
:ableIds="ableAll.deviceDeptableIds"
clearable
:style="{ width: '100%' }"
>
</JnpfDepSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="设备类型" prop="deivceType">
<JnpfSelect v-model="dataForm.deivceType" @change="changeData('deivceType', -1)"
placeholder="请选择" clearable :style='{ "width": "100%" }' :options="deivceTypeOptions"
:props="deivceTypeProps">
<JnpfSelect
v-model="dataForm.deivceType"
@change="changeData('deivceType', -1)"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
:options="deivceTypeOptions"
:props="deivceTypeProps"
>
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="启用状态" prop="enabledStatus">
<JnpfSelect v-model="dataForm.enabledStatus" @change="changeData('enabledStatus', -1)"
placeholder="请选择" clearable :style='{ "width": "100%" }' :options="enabledStatusOptions"
:props="enabledStatusProps">
<JnpfSelect
v-model="dataForm.enabledStatus"
@change="changeData('enabledStatus', -1)"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
:options="enabledStatusOptions"
:props="enabledStatusProps"
>
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="8小时产量" prop="eightOutput">
<JnpfInput v-model="dataForm.eightOutput" @change="changeData('eightOutput', -1)"
placeholder="请输入8小时产量" clearable :style='{ "width": "100%" }'>
<JnpfInput
v-model="dataForm.eightOutput"
@change="changeData('eightOutput', -1)"
placeholder="请输入8小时产量"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="12小时产量" prop="twelveOutput">
<JnpfInput v-model="dataForm.twelveOutput" @change="changeData('twelveOutput', -1)"
placeholder="请输入12小时产量" clearable :style='{ "width": "100%" }'>
<JnpfInput
v-model="dataForm.twelveOutput"
@change="changeData('twelveOutput', -1)"
placeholder="请输入12小时产量"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>绑定物料列表</h2>
</div>
<el-table :data="dataForm.data" size="mini">
<el-table-column label="设备编码">
<template slot-scope="scope">
{{ scope.row.deviceCode }}
</template>
</el-table-column>
<el-table-column label="母件编码">
<template slot-scope="scope">
{{ scope.row.materialId }}
</template>
</el-table-column>
<el-table-column label="母件名称">
<template slot-scope="scope">
{{ scope.row.materialName }}
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="fnMaterialListDialog()">
<el-button type="text" icon="el-icon-plus">物料绑定</el-button>
</div>
</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">
@ -76,23 +160,37 @@
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
{{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-button> -->
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading">
</el-button
>
</span>
<MaterialListDialog
ref="materialListDialog"
@cbSltdChg="fnSltdMaterialChg"
/>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
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"
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";
import MaterialListDialog from "@/views/yys/yysdevice/MaterialListDialog";
export default {
components: {},
components: {
MaterialListDialog
},
props: [],
data() {
return {
@ -105,20 +203,17 @@ export default {
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
formRef: "formRef",
setting: {},
eventType: '',
eventType: "",
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {
},
addTableConf: {},
//
ableAll: {
},
tableRows: {
},
ableAll: {},
tableRows: {},
Vmodel: "",
currVmodel: "",
dataForm: {
@ -129,36 +224,43 @@ export default {
twelveOutput: undefined,
deivceType: undefined,
enabledStatus: "1",
data: []
},
tableRequiredData: {},
dataRule:
{
dataRule: {
deviceCode: [
{
required: true,
message: '请输入设备编号',
trigger: 'blur'
},
message: "请输入设备编号",
trigger: "blur"
}
],
deviceName: [
{
required: true,
message: '请输入设备名称',
trigger: 'blur'
},
message: "请输入设备名称",
trigger: "blur"
}
],
deviceDept: [
{
required: true,
message: '请选择所属部门',
trigger: 'change'
message: "请选择所属部门",
trigger: "change"
}
]
},
deivceTypeOptions: [
{ fullName: "生产线", id: "1" },
{ fullName: "包装线", id: "2" },
{ fullName: "其它", id: "3" }
],
},
deivceTypeOptions: [{ "fullName": "生产线", "id": "1" }, { "fullName": "包装线", "id": "2" }, { "fullName": "其它", "id": "3" }],
deivceTypeProps: { "label": "fullName", "value": "id" },
enabledStatusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "未启用", "id": "2" }],
enabledStatusProps: { "label": "fullName", "value": "id" },
deivceTypeProps: { label: "fullName", value: "id" },
enabledStatusOptions: [
{ fullName: "启用", id: "1" },
{ fullName: "未启用", id: "2" }
],
enabledStatusProps: { label: "fullName", value: "id" },
childIndex: -1,
isEdit: false,
interfaceRes: {
@ -168,62 +270,90 @@ export default {
eightOutput: [],
twelveOutput: [],
deivceType: [],
enabledStatus: [],
},
enabledStatus: []
}
};
},
computed: {
...mapGetters(['userInfo'])
...mapGetters(["userInfo"])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
this.dataAll();
this.initDefaultData();
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm));
},
mounted() {},
methods: {
fnMaterialListDialog() {
this.$nextTick(() => {
this.$refs.materialListDialog.init();
});
},
fnSltdMaterialChg(nowRows) {
let _nowRows = nowRows.map(o1 => {
let _row = {
deviceCode: this.dataForm.deviceCode,
materialId: o1.pieceId,
materialName: o1.pieceName
};
return _row;
});
let _dataForm = { ...this.dataForm };
_dataForm.data = _nowRows;
this.dataForm = _dataForm;
},
choice(stationId) {
this.recycleSaffDeviceBoxVisible = true;
let excludeIdList = [];
for (let i = 0; i < this.dataForm.recycleStaffDeviceList.length; i++) {
excludeIdList.push(this.dataForm.recycleStaffDeviceList[i].deviceCode);
}
this.$nextTick(() => {
this.$refs.deviceBox.init(excludeIdList, stationId);
});
},
prev() {
this.index--
this.index--;
if (this.index === 0) {
this.prevDis = true
this.prevDis = true;
}
this.nextDis = false
this.nextDis = false;
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
this.getInfo(element.id);
}
}
},
next() {
this.index++
this.index++;
if (this.index === this.allList.length - 1) {
this.nextDis = true
this.nextDis = true;
}
this.prevDis = false
this.prevDis = false;
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
this.getInfo(element.id);
}
}
},
getInfo(id) {
request({
url: '/api/example/YysDevice/' + id,
method: 'get'
url: "/api/example/YysDevice/" + id,
method: "get"
}).then(res => {
this.dataInfo(res.data)
this.dataInfo(res.data);
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
this.visible = false;
this.$emit("refreshDataList", true);
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
this.isEdit = false;
this.childIndex = index;
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
@ -231,14 +361,14 @@ export default {
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
let faceReList = this.interfaceRes[key];
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
let options = "get" + key + "Options";
if (this[options]) {
this[options]()
this[options]();
}
this.changeData(key, index)
this.changeData(key, index);
}
}
}
@ -249,202 +379,204 @@ export default {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
this.dataForm[data][i][model] = defaultValue;
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
this.dataForm[data][i][model] = defaultValue;
}
}
} else {
this.dataForm[data] = defaultValue
this.dataForm[data] = defaultValue;
}
}
},
dataAll() {
},
dataAll() {},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll));
},
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
this.prevDis = false;
this.nextDis = false;
this.allList = allList || [];
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
this.index = this.allList.findIndex(item => item.id === id);
if (this.index == 0) {
this.prevDis = true
this.prevDis = true;
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
this.nextDis = true;
}
} else {
this.prevDis = true
this.nextDis = true
this.prevDis = true;
this.nextDis = true;
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
this.loading = true;
request({
url: '/api/example/YysDevice/' + this.dataForm.id,
method: 'get'
url: "/api/example/YysDevice/" + this.dataForm.id,
method: "get"
}).then(res => {
this.dataInfo(res.data)
this.loading = false
this.dataInfo(res.data);
this.loading = false;
});
} else {
this.clearData()
this.initDefaultData()
this.clearData();
this.initDefaultData();
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
this.$store.commit("generator/UPDATE_RELATION_DATA", {});
},
//
initDefaultData() {
},
initDefaultData() {},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
this.dataFormSubmitType = type ? type : 0;
this.$refs["formRef"].validate(valid => {
if (valid) {
this.request()
this.request();
}
})
});
},
request() {
let _data = this.dataList()
let _data = this.dataList();
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
this.continueBtnLoading = true;
} else {
this.btnLoading = true
this.btnLoading = true;
}
if (!this.dataForm.id) {
request({
url: '/api/example/YysDevice',
method: 'post',
url: "/api/example/YysDevice",
method: "post",
data: _data
}).then((res) => {
})
.then(res => {
this.$message({
message: res.msg,
type: 'success',
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
this.clearData();
this.initDefaultData();
});
this.continueBtnLoading = false;
return;
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
}
});
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
} else {
request({
url: '/api/example/YysDevice/' + this.dataForm.id,
method: 'PUT',
url: "/api/example/YysDevice/" + this.dataForm.id,
method: "PUT",
data: _data
}).then((res) => {
})
.then(res => {
this.$message({
message: res.msg,
type: 'success',
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
if (this.dataFormSubmitType == 2)
return (this.continueBtnLoading = false);
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
}
});
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.currTableConf = this.addTableConf[key];
this.currVmodel = key;
this.selectDialogVisible = true;
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
this.$refs.selectDialog.init();
});
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
let t = data[i];
if (this["get" + this.currVmodel]) {
this["get" + this.currVmodel](t);
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
let timeValue = Number(timeValueData);
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
timeDataValue = timeValue;
} else if (timeType == 2) {
timeDataValue = dataValue
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
timeDataValue = new Date().getTime();
} else if (timeType == 4) {
let previousDate = '';
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
previousDate = getBeforeData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime();
}
} else if (timeType == 5) {
let previousDate = '';
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
previousDate = getLaterData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
timeDataValue = getLaterTime(timeTarget, timeValue).getTime();
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
let format = formatType == "HH:mm" ? "HH:mm:00" : formatType;
let timeDataValue = null;
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
timeDataValue = timeValue || "00:00:00";
if (timeDataValue.split(":").length == 3) {
timeDataValue = timeDataValue;
} else {
timeDataValue = timeDataValue + ':00'
timeDataValue = timeDataValue + ":00";
}
} else if (timeType == 2) {
timeDataValue = dataValue
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
timeDataValue = this.jnpf.toDate(new Date(), format);
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
let previousDate = "";
previousDate = getBeforeTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
let previousDate = "";
previousDate = getLaterTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
}
}
return timeDataValue;
@ -454,13 +586,12 @@ export default {
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex = -1
},
},
let _dataAll = dataAll;
this.dataForm = _dataAll;
this.isEdit = true;
this.dataAll();
this.childIndex = -1;
}
}
};
</script>

Loading…
Cancel
Save