Commit ffe23bbc by zhuzhequan

版本管理

parent afaf5631
import axios from '../axios' import axios from '../axios'
export function erpProductionAssistantManage(data) { export function erpProductionAssistantManage(data) {
return axios.post('/erpProductionAssistantManage/uploadToLocal', data, { return axios.post('/erpAppManage/uploadToLocal', data, {
headers: { headers: {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
} }
...@@ -9,9 +9,9 @@ export function erpProductionAssistantManage(data) { ...@@ -9,9 +9,9 @@ export function erpProductionAssistantManage(data) {
} }
export function erpProductionAssistantManageListPage(data) { export function erpProductionAssistantManageListPage(data) {
return axios.post('/erpProductionAssistantManage/list_page', data) return axios.post('/erpAppManage/list_page', data)
} }
export function deleteErpProductionAssistantManage(data) { export function deleteErpProductionAssistantManage(data) {
return axios.get('/erpProductionAssistantManage/delete?ids=' + data) return axios.get('/erpAppManage/delete?ids=' + data)
} }
...@@ -4,7 +4,9 @@ import router from './router' ...@@ -4,7 +4,9 @@ import router from './router'
import store from './store' import store from './store'
import './plugins/myui' import './plugins/myui'
import element from '@/common/components/element-ui.js' import element from '@/common/components/element-ui.js'
import vxeTable from '@/common/components/vxeTable.js' import vxeTable from 'vxe-table'
import 'xe-utils'
import 'vxe-table/lib/index.css'
import './common/style/index.scss' import './common/style/index.scss'
import './assets/css/common.css' import './assets/css/common.css'
import Directives from './utils/directives' import Directives from './utils/directives'
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</el-pagination> </el-pagination>
</div> </div>
<el-dialog <el-dialog
title="新增" :title="editForm.id?'编辑':'新增'"
:visible.sync='dialogVisible' :visible.sync='dialogVisible'
:close-on-click-modal='false' :close-on-click-modal='false'
:before-close='beforeClose' :before-close='beforeClose'
...@@ -64,28 +64,37 @@ ...@@ -64,28 +64,37 @@
<el-form-item prop="version" label="版本号"> <el-form-item prop="version" label="版本号">
<el-input class="item_width" v-model="editForm.version" placeholder="请输入版本号"></el-input> <el-input class="item_width" v-model="editForm.version" placeholder="请输入版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="forcedUpdate" label="是否强制更新"> <div class="el-row" style="width: 100%;">
<el-form-item class="el-col-11" prop="forcedUpdate" label="是否强制更新">
<el-radio-group class="item_width" v-model="editForm.forcedUpdate"> <el-radio-group class="item_width" v-model="editForm.forcedUpdate">
<el-radio :label="0"></el-radio> <el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio> <el-radio :label="1"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item class="el-col-11" prop="fullUpdate" label="是否全量更新">
<el-radio-group class="item_width" v-model="editForm.fullUpdate">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</div>
<!-- 上传多个app文件 --> <!-- 上传多个app文件 -->
<el-form-item label="上传文件"> <el-form-item required class="el-col-24" label="上传文件">
<!-- accept=".apk,.ipa" --> <!-- accept=".apk,.ipa" -->
<el-upload <el-upload
action action
:http-request="handleCustom" :http-request="handleCustom"
:limit="1"
:multiple="false"
:on-change="handleChange" :on-change="handleChange"
:on-remove="handleRemove" :on-remove="handleRemove"
:file-list="fileList" :file-list="fileList"
list-type="text" list-type="text"
> >
<div class="upload-file"> <el-button type="primary">
<el-button class="el-upload"> 上传文件
<i class="el-icon-plus"></i>
</el-button> </el-button>
</div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -107,12 +116,16 @@ ...@@ -107,12 +116,16 @@
</template> </template>
<script> <script>
import tableView from '@/common/components/base/tableView.vue' import tableView from '@/common/components/base/tableView.vue'
import { erpProductionAssistantManage, erpProductionAssistantManageListPage, deleteErpProductionAssistantManage } from '../../common/api/production/assistantManage' import {
erpProductionAssistantManage,
erpProductionAssistantManageListPage,
deleteErpProductionAssistantManage
} from '../../common/api/production/assistantManage'
export default { export default {
name: 'saasMenu', name: 'saasMenu',
components: { components: {
tableView, tableView
}, },
data() { data() {
return { return {
...@@ -124,13 +137,19 @@ export default { ...@@ -124,13 +137,19 @@ export default {
title: '', title: '',
content: '', content: '',
forcedUpdate: 0, forcedUpdate: 0,
fullUpdate: 1
// businessType: 'production_assistant' // businessType: 'production_assistant'
}, },
fileList: [], fileList: [],
rules: { rules: {
// 自定义版本号的校验规则 // 自定义版本号的校验规则
version: [ version: [
{ required: true, message: '请输入版本号', trigger: 'blur' }, {
required: true,
message: '请输入版本号',
trigger: 'blur'
},
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (!/^\d+\.\d+\.\d+$/.test(value)) { if (!/^\d+\.\d+\.\d+$/.test(value)) {
...@@ -139,19 +158,34 @@ export default { ...@@ -139,19 +158,34 @@ export default {
callback() callback()
} }
}, },
trigger: 'blur', trigger: 'blur'
}, }
], ],
title: [ title: [
{ required: true, message: '请输入更新标题', trigger: 'blur' }, {
required: true,
message: '请输入更新标题',
trigger: 'blur'
}
], ],
content: [ thirdWarehouseType: [
{ required: true, message: '请输入更新内容', trigger: 'blur' }, {
required: true,
message: '请选择更新类型',
trigger: 'change'
}
], ],
content: [
{
required: true,
message: '请输入更新内容',
trigger: 'blur'
}
]
}, },
total: 1, total: 1,
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10
} }
}, },
computed: { computed: {
...@@ -160,7 +194,7 @@ export default { ...@@ -160,7 +194,7 @@ export default {
{ {
label: '更新标题', label: '更新标题',
key: 'title', key: 'title',
width: '', width: ''
}, },
{ {
label: '版本号', label: '版本号',
...@@ -170,7 +204,7 @@ export default { ...@@ -170,7 +204,7 @@ export default {
{ {
label: '更新内容', label: '更新内容',
key: 'content', key: 'content',
width: '', width: ''
}, },
{ {
label: ' 是否强制更新', label: ' 是否强制更新',
...@@ -191,23 +225,22 @@ export default { ...@@ -191,23 +225,22 @@ export default {
{ {
label: '操作', label: '操作',
key: '', key: '',
width: '80', width: '120',
// align: 'left', // align: 'left',
render: item => ( render: item => (
<div> <div>
<el-button <span title="删除" class="icon-view ">
size='mini' <i
type='text' style="color:#F56C6C"
class="edit" class="el-icon-delete"
onClick={() => this.remove(item)} onClick={() => this.remove(item)}
> ></i>
删除 </span>
</el-button>
</div> </div>
), )
}, }
] ]
}, }
}, },
created() { created() {
this.getProductionAssistantList() this.getProductionAssistantList()
...@@ -216,9 +249,13 @@ export default { ...@@ -216,9 +249,13 @@ export default {
async getProductionAssistantList() { async getProductionAssistantList() {
this.loading = true this.loading = true
try { try {
const { data: erpProductionAssistantManageRes, code } = await erpProductionAssistantManageListPage({ const {
data: erpProductionAssistantManageRes,
code
} = await erpProductionAssistantManageListPage({
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize, businessType: 'production_assistant',
pageSize: this.pageSize
}) })
if (code === 200) { if (code === 200) {
console.log('erpProductionAssistantManageRes:>>', erpProductionAssistantManageRes) console.log('erpProductionAssistantManageRes:>>', erpProductionAssistantManageRes)
...@@ -236,7 +273,7 @@ export default { ...@@ -236,7 +273,7 @@ export default {
if (deleteProductionRes.code === 200) { if (deleteProductionRes.code === 200) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功!', message: '删除成功!'
}) })
setTimeout(() => { setTimeout(() => {
this.getProductionAssistantList() this.getProductionAssistantList()
...@@ -282,20 +319,23 @@ export default { ...@@ -282,20 +319,23 @@ export default {
if (this.fileList?.length === 0) { if (this.fileList?.length === 0) {
return this.$message({ return this.$message({
type: 'warning', type: 'warning',
message: '请上传文件!', message: '请上传文件!'
}) })
} }
const productionAssistantParams = this.formFile(this.fileList, { ...this.editForm, businessType: 'production_assistant' }) const productionAssistantParams = this.formFile(this.fileList, {
...this.editForm,
businessType: 'production_assistant'
})
try { try {
const res = await erpProductionAssistantManage(productionAssistantParams) const res = await erpProductionAssistantManage(productionAssistantParams)
console.log('提交表单:>>> ', res, '\nproductionAssistantParams:>>', productionAssistantParams) console.log('提交表单:>>> ', res, '\nproductionAssistantParams:>>', productionAssistantParams)
if (res.code === 200) { if (res.code === 200) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '保存成功!', message: '保存成功!'
}) })
this.resetForm() this.resetForm()
this.getProductionAssistantList() await this.getProductionAssistantList()
this.dialogVisible = false this.dialogVisible = false
} }
} catch (error) { } catch (error) {
...@@ -312,16 +352,16 @@ export default { ...@@ -312,16 +352,16 @@ export default {
this.$confirm('是否删除该数据', '提示', { this.$confirm('是否删除该数据', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
}).then(() => { }).then(() => {
this.deleteProductionAssistant(id) this.deleteProductionAssistant(id)
}) })
}, },
handleCustom(file) { handleCustom(file) {
this.$message({ // this.$message({
type: 'success', // type: 'success',
message: '上传成功!', // message: '上传成功!'
}) // })
}, },
handleChange(file, fileList) { handleChange(file, fileList) {
this.fileList = fileList this.fileList = fileList
...@@ -334,6 +374,11 @@ export default { ...@@ -334,6 +374,11 @@ export default {
} }
return isLt2M return isLt2M
}, },
update(row) {
this.editForm = row
this.dialogVisible = true
console.log(row)
},
handleRemove(file, fileList) { handleRemove(file, fileList) {
this.fileList = fileList this.fileList = fileList
}, },
...@@ -344,8 +389,8 @@ export default { ...@@ -344,8 +389,8 @@ export default {
onCurrentChange(currentPage) { onCurrentChange(currentPage) {
this.currentPage = currentPage this.currentPage = currentPage
this.getProductionAssistantList() this.getProductionAssistantList()
}, }
}, }
} }
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
...@@ -355,13 +400,16 @@ export default { ...@@ -355,13 +400,16 @@ export default {
flex-direction: column; flex-direction: column;
padding: 10px 20px 0; padding: 10px 20px 0;
overflow: hidden; overflow: hidden;
.item_width { .item_width {
width: 220px; width: 220px;
} }
.title_width { .title_width {
display: flex; display: flex;
} }
} }
.table-wrap { .table-wrap {
background: #fff; background: #fff;
flex: 1; flex: 1;
...@@ -371,11 +419,13 @@ export default { ...@@ -371,11 +419,13 @@ export default {
.system-menu:deep() .el-form-item__content { .system-menu:deep() .el-form-item__content {
flex: 1; flex: 1;
} }
.radioGroup { .radioGroup {
.el-radio { .el-radio {
margin-right: 15px !important; margin-right: 15px !important;
} }
} }
.edit { .edit {
color: #fff; /* 字体颜色 */ color: #fff; /* 字体颜色 */
background-color: #409EFF; /* 背景颜色 */ background-color: #409EFF; /* 背景颜色 */
...@@ -395,6 +445,7 @@ export default { ...@@ -395,6 +445,7 @@ export default {
background-color: #fff; background-color: #fff;
border: 1px dashed #d9d9d9; border: 1px dashed #d9d9d9;
} }
:deep() .el-button { :deep() .el-button {
font-size: 28px; font-size: 28px;
color: #8c939d; color: #8c939d;
......
...@@ -861,7 +861,7 @@ export default { ...@@ -861,7 +861,7 @@ export default {
}, },
data() { data() {
const userInfo = localStorage.getItem('user') const userInfo = localStorage.getItem('user')
var validatePass2 = (rule, value, callback) => { const validatePass2 = (rule, value, callback) => {
const start = new Date(value) const start = new Date(value)
if (!value) { if (!value) {
callback(new Error('请选择预计完成时间')) callback(new Error('请选择预计完成时间'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment