主数据修改、数据源、显示字段

This commit is contained in:
hyt 2024-06-14 15:43:44 +08:00
parent bec344f49d
commit 10454298c7
1 changed files with 169 additions and 158 deletions

View File

@ -71,7 +71,8 @@
placeholder="选择开始日期"
:disabled="!submitShow"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd">
value-format="yyyy-MM-dd"
>
</el-date-picker>
<el-date-picker
v-model="row.endDate"
@ -79,7 +80,8 @@
placeholder="选择结束日期"
:disabled="!submitShow"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd">
value-format="yyyy-MM-dd"
>
</el-date-picker>
</template>
</template>
@ -93,7 +95,8 @@
placeholder="年月"
:disabled="!submitShow"
format="yyyy 年 MM 月"
value-format="yyyy-MM">
value-format="yyyy-MM"
>
</el-date-picker>
</template>
</template>
@ -107,7 +110,8 @@
placeholder="年月日"
:disabled="!submitShow"
format="yyyy 年 MM 月 DD 日"
value-format="yyyy-MM-DD">
value-format="yyyy-MM-DD"
>
</el-date-picker>
</template>
</template>
@ -119,7 +123,8 @@
v-model="row.argValue"
type="datetime"
placeholder="年月日时间"
:disabled="!submitShow">
:disabled="!submitShow"
>
</el-date-picker>
</template>
</template>
@ -163,12 +168,13 @@
</template>
<script>
import baseRightDialog from "@/components/base/baseRightDialog";
import baseNewSelect from "./baseNewSelect.vue"
import baseForm from "@/components/base/baseNewForm";
import baseTable from "@/components/base/baseTable";
import configData from "./configData";
import { authApi } from "@/api/apis/auth";
import baseRightDialog from '@/components/base/baseRightDialog'
import baseNewSelect from './baseNewSelect.vue'
import baseForm from '@/components/base/baseNewForm'
import baseTable from '@/components/base/baseTable'
import configData from './configData'
import { authApi } from '@/api/apis/auth'
export default {
components: {
baseRightDialog,
@ -179,8 +185,8 @@ export default {
data() {
return {
dialogVisible: false,
dialogTitle: "",
dialogType: "",
dialogTitle: '',
dialogType: '',
formRow: configData.formRow,
basicsRules: configData.basicsRules,
vLoading: false,
@ -194,8 +200,8 @@ export default {
select_dist: {},
plugNameOptions: [],
tableColumn: configData.operationTableColumn,//
tableData:[],
};
tableData: []
}
},
mounted() {
this.initSelect()
@ -204,14 +210,14 @@ export default {
//
async initSelect() {
let res = await authApi(
"pluginService",
"plugins",
"queryPlugins",
"",
'pluginService',
'plugins',
'queryPlugins',
'',
{
"pluginType": "1"
'pluginType': '1'
}
);
)
if (res.status == 200) {
console.log(res.attribute)
res.attribute.forEach(item => {
@ -239,27 +245,27 @@ export default {
async searchInfo(plugId) {
let params = {
plugId
};
}
let res = await authApi(
"sysPlugArgService",
"integrationTaskService",
"getPlugArgByPlugId",
"",
'sysPlugArgService',
'integrationTaskService',
'getPlugArgByPlugId',
'',
params
);
)
console.log(res, 'res')
if (res.status == 200) {
//
let arr = []
res.attribute.forEach(item => {
arr.push({
startDate:"",
endDate:"",
remark:"",
argValue:"",
startDate: '',
endDate: '',
remark: '',
argValue: '',
argName: item.argName,
argCode: item.argCode,
argType:item.argType,
argType: item.argType
})
})
@ -268,71 +274,71 @@ export default {
},
openDialog(type, row) {
// this.queryProductClassfy();
this.formRow = configData.formRow;
this.submitShow = true;
this.formRow = configData.formRow
this.submitShow = true
this.isEdit = false
this.funData = []
//
if (type == "add") {
this.dialogTitle = "新增";
this.dialogType = "add";
if (type == 'add') {
this.dialogTitle = '新增'
this.dialogType = 'add'
}
//
if (type == "edit") {
if (type == 'edit') {
this.isEdit = true
this.dialogTitle = "编辑";
this.dialogType = "edit";
this.productGetById(row.id);
this.dialogTitle = '编辑'
this.dialogType = 'edit'
this.productGetById(row.id)
}
//
if (type == "show") {
if (type == 'show') {
this.funData = Object.assign([], [])
this.submitShow = false;
this.formRow = configData.formRowShow;
this.dialogTitle = "查看";
this.dialogType = "show";
this.productGetById(row.id);
this.submitShow = false
this.formRow = configData.formRowShow
this.dialogTitle = '查看'
this.dialogType = 'show'
this.productGetById(row.id)
}
this.dialogVisible = true;
this.dialogVisible = true
},
//
async productGetById(id) {
let params = {
id: id,
};
id: id
}
let res = await authApi(
"sysIntegratedForegroundTaskService",
"integrationTaskService",
"getIntegratedForegroundTask",
"",
'sysIntegratedForegroundTaskService',
'integrationTaskService',
'getIntegratedForegroundTask',
'',
params
);
if (res.status == "200") {
)
if (res.status == '200') {
this.$nextTick(() => {
this.$refs.basicsForm.incomingParameters(res.attribute);
this.$refs.basicsForm.incomingParameters(res.attribute)
this.tableVersionData = res.attribute.sysIntegratedForegroundTaskDetailEntityList
this.tableVersionData.forEach(item => {
if (item.argType == 2) {
//
this.$set(item,'startDate',item.argValue.split("/")[0])
this.$set(item,'endDate',item.argValue.split("/")[1])
this.$set(item, 'startDate', item.argValue.split('/')[0])
this.$set(item, 'endDate', item.argValue.split('/')[1])
}
})
this.tableData = res.attribute.sysIntegratedForegroundTaskParameterEntities
// let result = [];
// this.tableVersionData = Object.assign([], result);
});
})
}
},
addVersionDialog() {
let obj = {
argName:"",
argCode:"",
argType:"1",
remark:"",
};
this.tableVersionData.push(obj);
argName: '',
argCode: '',
argType: '1',
remark: ''
}
this.tableVersionData.push(obj)
},
//
onFunc(index, row) {
@ -340,102 +346,106 @@ export default {
this.$delConfirm().then(() => {
this.tableVersionData.forEach((item, itemIndex) => {
if (item.id === row.id) {
this.tableVersionData.splice(itemIndex, 1);
this.tableVersionData.splice(itemIndex, 1)
}
});
});
})
})
}
},
//
handleDialogClose() {
this.tableVersionData = Object.assign([], []);
this.$refs.basicsForm.resetFields();
this.dialogVisible = false;
this.tableVersionData = Object.assign([], [])
this.$refs.basicsForm.resetFields()
this.dialogVisible = false
},
//
handleConfirmClick() {
this.$refs.basicsForm.$refs["ruleForm"].validate((valid) => {
this.$refs.basicsForm.$refs['ruleForm'].validate((valid) => {
if (!valid) {
return;
return
} else {
let flag = this.tableVersionData.some((item, index) => {
// 2024-12-13/2024-12-14
if (item.argType == 2) {
//
let startDate = new Date(item.startDate); //
let endDate = new Date(item.endDate); //
if (item.startDate && item.endDate && item.endDate !== 'null' && item.startDate !== 'null') {
let startDate = new Date(item.startDate) //
let endDate = new Date(item.endDate) //
if (startDate > endDate) {
this.$vmNews(`${index + 1}行结束时间不能大于开始时间`)
return true
}
this.$set(item,'argValue',item.startDate + "/" +item.endDate)
this.$set(item, 'argValue', item.startDate + '/' + item.endDate)
} else {
this.$set(item, 'argValue', null)
}
}
})
if (flag) return
let params = {
...this.$refs.basicsForm.ruleForm,
sysIntegratedForegroundTaskDetailEntityList: this.tableVersionData,
};
if (this.dialogType == "add") {
this.openLoading("submit");
this.productSaveDto(params);
sysIntegratedForegroundTaskDetailEntityList: this.tableVersionData
}
if (this.dialogType == "edit") {
this.openLoading("submit");
this.productUpdateDto(params);
if (this.dialogType == 'add') {
this.openLoading('submit')
this.productSaveDto(params)
}
if (this.dialogType == 'edit') {
this.openLoading('submit')
this.productUpdateDto(params)
}
}
});
})
},
//
async productSaveDto(params) {
let res = await authApi(
"sysIntegratedForegroundTaskService",
"integrationTaskService",
"saveIntegratedForegroundTask",
"",
'sysIntegratedForegroundTaskService',
'integrationTaskService',
'saveIntegratedForegroundTask',
'',
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("新增成功", "success");
this.$emit("resetTable");
)
if (res.status == '200') {
this.handleDialogClose()
this.$vmNews('新增成功', 'success')
this.$emit('resetTable')
}
},
//
async productUpdateDto(params) {
let res = await authApi(
"sysIntegratedForegroundTaskService",
"integrationTaskService",
"updateIntegratedForegroundTask",
"",
'sysIntegratedForegroundTaskService',
'integrationTaskService',
'updateIntegratedForegroundTask',
'',
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("更新成功", "success");
this.$emit("resetTable");
)
if (res.status == '200') {
this.handleDialogClose()
this.$vmNews('更新成功', 'success')
this.$emit('resetTable')
}
},
//
async queryProductClassfy() {
let params = {
tab_name: "sys_product",
column_name: "classify",
};
let res = await authApi(
"generalServiceImpl",
"dictionaryshop",
"selectDictionaryshop",
"",
params
);
if (res.status == "200") {
this.formRow[1].elCol[0].options = res.attribute;
tab_name: 'sys_product',
column_name: 'classify'
}
let res = await authApi(
'generalServiceImpl',
'dictionaryshop',
'selectDictionaryshop',
'',
params
)
if (res.status == '200') {
this.formRow[1].elCol[0].options = res.attribute
}
}
}
}
},
},
};
</script>
<style scoped lang="scss">
@ -443,6 +453,7 @@ export default {
margin: 10px 0;
font-size: 16px;
}
.dialogList {
padding: 16px 0;
border-top: 1px solid #dcdfe6;