Commit c7269591 by 史敦盼

批次计划管理

1 parent 04d13d76
...@@ -607,5 +607,14 @@ export function saveExamine(params) { ...@@ -607,5 +607,14 @@ export function saveExamine(params) {
} }
// 概设架构遵从检查, 保存 // 概设架构遵从检查, 保存
export function queryReviewArchiFollowCheckRightSuggestionDetails(params) { export function queryReviewArchiFollowCheckRightSuggestionDetails(params) {
return post('/network/app-archi-control-requirements/qReview', params); return post('/network/app-archi-control-requirements/qReview', params)
}
// 新增批次计划
export function addBatchPlan(params) {
return post('/network/bat-plan-info/ad', params)
}
// 修改批次计划
export function editBatchPlan(params) {
return post('/network/bat-plan-info/upd', params)
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-12 14:55:59 * @Date: 2024-03-12 14:55:59
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-03-15 09:43:02 * @LastEditTime: 2024-03-18 14:41:17
--> -->
<!-- /** <!-- /**
* 搜索栏公共组件 * 搜索栏公共组件
...@@ -78,7 +78,6 @@ export default { ...@@ -78,7 +78,6 @@ export default {
formData: {}, formData: {},
} }
}, },
computed: { computed: {
newKeys() { newKeys() {
return this.formOptions.map((v) => { return this.formOptions.map((v) => {
...@@ -108,9 +107,10 @@ export default { ...@@ -108,9 +107,10 @@ export default {
}, },
// 获取表单数据 // 获取表单数据
getData() { getData() {
this.onValidate(() => { return this.formData
this.$emit('getData', this.formData) // this.onValidate(() => {
}) // this.$emit('getData', this.formData)
// })
}, },
// 导出 // 导出
onExport() { onExport() {
...@@ -139,7 +139,6 @@ export default { ...@@ -139,7 +139,6 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.form-box { .form-box {
// display: flex;
margin-top: 10px; margin-top: 10px;
.btn-box { .btn-box {
display: flex; display: flex;
...@@ -149,21 +148,13 @@ export default { ...@@ -149,21 +148,13 @@ export default {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
/deep/ .el-form-item__label { /deep/ .el-form-item__label {
margin-bottom: 10px;
flex-shrink: 0; flex-shrink: 0;
color: #000; color: #000;
} }
.el-form-item {
margin-bottom: 0;
// display: flex;
&.is-error {
margin-bottom: 25px;
}
}
// el-input宽度 // el-input宽度
/deep/ .form-item { /deep/ .form-item {
.el-input { .el-input {
width: 220px !important; width: 100% !important;
} }
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-11 14:53:40 * @Date: 2024-03-11 14:53:40
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-03-14 09:46:17 * @LastEditTime: 2024-03-18 11:02:04
--> -->
<!-- 示例 <!-- 示例
columns: [{ label: '头像', prop: 'avatar', align: 'center', __slotName: 'avatar',callback: (row, title) => { columns: [{ label: '头像', prop: 'avatar', align: 'center', __slotName: 'avatar',callback: (row, title) => {
...@@ -208,7 +208,6 @@ export default { ...@@ -208,7 +208,6 @@ export default {
}, },
methods: { methods: {
handleToText(item, state) { handleToText(item, state) {
console.log(item, state)
const obj = item.options.find((v) => v.value === state) || {} const obj = item.options.find((v) => v.value === state) || {}
return obj['label'] return obj['label']
}, },
......
...@@ -12,7 +12,33 @@ initDirective(Vue) ...@@ -12,7 +12,33 @@ initDirective(Vue)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(ElementUI) Vue.use(ElementUI)
Date.prototype.format = function (fmt) {
if (!fmt) {
fmt = 'yyyy-MM-dd hh:mm:ss'
}
var o = {
'M+': this.getMonth() + 1, // 月份
'd+': this.getDate(), // 日
'h+': this.getHours(), // 小时
'm+': this.getMinutes(), // 分
's+': this.getSeconds(), // 秒
'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
S: this.getMilliseconds(), // 毫秒
}
if (/(y+)/.test(fmt))
fmt = fmt.replace(
RegExp.$1,
(this.getFullYear() + '').substr(4 - RegExp.$1.length),
)
for (let k in o) {
if (new RegExp('(' + k + ')').test(fmt))
fmt = fmt.replace(
RegExp.$1,
RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length),
)
}
return fmt
}
new Vue({ new Vue({
router, router,
store, store,
......
...@@ -4,17 +4,19 @@ ...@@ -4,17 +4,19 @@
:visible.sync="showDialog" :visible.sync="showDialog"
:close-on-click-modal="false" :close-on-click-modal="false"
width="60%" width="60%"
@close="handleClose"
@open="handleOpen"
> >
<div> <div>
<Form <Form
@getData="getFormData" ref="addForm"
:form-options="formOptions" :form-options="formOptions"
label-width="120px" label-width="120px"
></Form> ></Form>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="showDialog = false" size="mini">取 消</el-button> <el-button @click="showDialog = false" size="mini">取 消</el-button>
<el-button type="primary" @click="handleImport" size="mini" <el-button type="primary" @click="handleSubmit" size="mini"
>提 交</el-button >提 交</el-button
> >
</span></el-dialog </span></el-dialog
...@@ -23,6 +25,8 @@ ...@@ -23,6 +25,8 @@
<script> <script>
import Form from '@/components/Form.vue' import Form from '@/components/Form.vue'
import { addBatchPlan, editBatchPlan } from '@/api'
export default { export default {
props: { props: {
title: { title: {
...@@ -33,6 +37,10 @@ export default { ...@@ -33,6 +37,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
rowData: {
type: Object,
default: () => {},
},
}, },
data() { data() {
return {} return {}
...@@ -48,11 +56,11 @@ export default { ...@@ -48,11 +56,11 @@ export default {
prop: 'batName', // 字段名 prop: 'batName', // 字段名
element: 'el-input', // 指定elementui组件 element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性 placeholder: '请输入内容', // elementui组件属性
rules: [], rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
}, },
{ {
label: '创建人', // label文字 label: '创建人', // label文字
prop: 'batName', // 字段名 prop: 'createMan', // 字段名
element: 'el-input', // 指定elementui组件 element: 'el-input', // 指定elementui组件
initValue: '', // 字段初始值 initValue: '', // 字段初始值
placeholder: '请输入内容', // elementui组件属性 placeholder: '请输入内容', // elementui组件属性
...@@ -60,20 +68,20 @@ export default { ...@@ -60,20 +68,20 @@ export default {
}, },
{ {
label: '创建时间', // label文字 label: '创建时间', // label文字
prop: 'planReviewDate', // 字段名 prop: 'createTime', // 字段名
type: 'date', type: 'date',
valueFormat: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd',
element: 'el-date-picker', // 指定elementui组件 element: 'el-date-picker', // 指定elementui组件
initValue: '', // 字段初始值 initValue: new Date().format('yyyy-MM-dd'), // 字段初始值
placeholder: '请选择', // elementui组件属性 placeholder: '请选择', // elementui组件属性
}, },
{ {
label: '年度', // label文字 label: '年度', // label文字
prop: 'planReviewDate', // 字段名 prop: 'year', // 字段名
type: 'year', type: 'year',
valueFormat: 'yyyy', valueFormat: 'yyyy',
element: 'el-date-picker', // 指定elementui组件 element: 'el-date-picker', // 指定elementui组件
initValue: '', // 字段初始值 initValue: new Date().format('yyyy'), // 字段初始值
placeholder: '请选择', // elementui组件属性 placeholder: '请选择', // elementui组件属性
}, },
{ {
...@@ -87,10 +95,12 @@ export default { ...@@ -87,10 +95,12 @@ export default {
}, },
{ {
label: '备注', // label文字 label: '备注', // label文字
prop: 'planReviewDate', // 字段名 prop: 'remark', // 字段名
type: 'textarea', type: 'textarea',
element: 'el-input', // 指定elementui组件 element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性 placeholder: '请输入内容', // elementui组件属性
span: 24,
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
}, },
] ]
}, },
...@@ -102,10 +112,58 @@ export default { ...@@ -102,10 +112,58 @@ export default {
this.$emit('update:visible', value) this.$emit('update:visible', value)
}, },
}, },
isEdit() {
if (this.title === '修改批次计划') {
return true
} else {
return false
}
},
}, },
mounted() {}, mounted() {},
methods: { methods: {
getFormData(formData) {}, handleSubmit() {
this.$refs['addForm'].onValidate(() => {
const loading = this.$loading({
lock: true,
text: '保存中',
spinner: 'el-icon-loading',
})
const formInfo = this.$refs['addForm'].getData()
const typeApi = this.isEdit ? editBatchPlan : addBatchPlan
const params = {
...this.rowData,
...formInfo,
state: 1,
}
typeApi(params).then((res) => {
if (res.code === 200) {
loading.close()
this.$message.success('保存成功')
this.showDialog = false
this.handleClose()
this.$emit('querySearch')
}
})
})
},
handleClose() {
this.$refs['addForm'].onReset()
},
handleOpen() {
if (Object.keys(this.rowData).length) {
this.formOptions.forEach((v) => {
v.initValue = this.rowData[v.prop]
})
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
})
} else {
this.$nextTick(() => {
this.handleClose()
})
}
},
}, },
} }
</script> </script>
......
...@@ -30,7 +30,12 @@ ...@@ -30,7 +30,12 @@
</list-page> </list-page>
<!-- 新增弹窗 --> <!-- 新增弹窗 -->
<Add :visible.sync="visible" title="新增批次计划"></Add> <Add
@querySearch="querySearch"
:visible.sync="visible"
:row-data="rowData"
:title="dialogTitle"
></Add>
</div> </div>
</template> </template>
...@@ -40,7 +45,7 @@ import SearchForm from '@/components/SearchForm.vue' ...@@ -40,7 +45,7 @@ import SearchForm from '@/components/SearchForm.vue'
import TableConfig from '@/components/TableConfig.vue' import TableConfig from '@/components/TableConfig.vue'
import Add from './Add.vue' import Add from './Add.vue'
import { getDianXingAnLiSelectData } from '@/api/index.js' import { getDianXingAnLiSelectData, editBatchPlan } from '@/api/index.js'
import { batchPlanManagement } from '@/api/interface' import { batchPlanManagement } from '@/api/interface'
import { approvalStatusOptions } from '@/utils/dictionary' import { approvalStatusOptions } from '@/utils/dictionary'
export default { export default {
...@@ -60,6 +65,8 @@ export default { ...@@ -60,6 +65,8 @@ export default {
queryParam: {}, queryParam: {},
}, },
visible: false, visible: false,
rowData: {},
dialogTitle: '',
} }
}, },
computed: { computed: {
...@@ -138,14 +145,13 @@ export default { ...@@ -138,14 +145,13 @@ export default {
}, },
], ],
callback: (row, title) => { callback: (row, title) => {
this.fnToDetailsTab('1') this.fnOperation(row, title)
}, },
}, },
] ]
}, },
}, },
created() { created() {
console.log('batchPlanManagement', batchPlanManagement)
const params = { const params = {
key: 'build_type', key: 'build_type',
} }
...@@ -168,6 +174,53 @@ export default { ...@@ -168,6 +174,53 @@ export default {
this.$refs.searchTable.queryData() this.$refs.searchTable.queryData()
}, },
fnAdd() { fnAdd() {
this.dialogTitle = '新增批次计划'
this.visible = true
this.rowData = {}
},
/**
* @description: 操作按钮
* @param {Object} row 当前操作行数据
* @param {String} title 当前操作按钮名称
* @author: pan
*/
fnOperation(row, title) {
switch (title) {
case '修改':
this.fnEdit(row)
break
case '删除':
this.fnDel(row)
break
default:
break
}
},
fnDel(row) {
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
const params = {
...row,
delFlag: 1,
}
editBatchPlan(params).then((res) => {
if (res.code === 200) {
this.$message.success('删除成功')
this.$refs.searchTable.queryData()
} else {
this.$message.error('删除失败')
}
})
})
.catch(() => {})
},
fnEdit(row) {
this.dialogTitle = '修改批次计划'
this.rowData = row
this.visible = true this.visible = true
}, },
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!