Commit 646007b6 by duanguohui

优化

parent ec7084ce
...@@ -7606,6 +7606,11 @@ ...@@ -7606,6 +7606,11 @@
} }
} }
}, },
"moment": {
"version": "2.24.0",
"resolved": "https://registry.npm.taobao.org/moment/download/moment-2.24.0.tgz",
"integrity": "sha1-DQVdU/UFKqZTyfbraLtdEr9cK1s="
},
"move-concurrently": { "move-concurrently": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz", "resolved": "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz",
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"axios": "^0.18.0", "axios": "^0.18.0",
"core-js": "^2.6.5", "core-js": "^2.6.5",
"element-ui": "^2.9.1", "element-ui": "^2.9.1",
"moment": "^2.24.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.0.3", "vue-router": "^3.0.3",
"vuex": "^3.0.1" "vuex": "^3.0.1"
......
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
"herf": this.addForm.herf ? this.addForm.herf : '', "herf": this.addForm.herf ? this.addForm.herf : '',
"id": 0, "id": 0,
"name": this.addForm.name, "name": this.addForm.name,
"status": this.addForm.status, "status": this.addForm.status ? '1' : '2',
"url": this.addForm.url, "url": this.addForm.url,
"userName": JSON.parse(window.localStorage.getItem('userInfo')).data.userResponse.userName "userName": JSON.parse(window.localStorage.getItem('userInfo')).data.userResponse.userName
} }
......
...@@ -90,8 +90,8 @@ ...@@ -90,8 +90,8 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import moment from 'moment'
export default { export default {
name: 'cookDetail', name: 'cookDetail',
data () { data () {
...@@ -126,6 +126,8 @@ export default { ...@@ -126,6 +126,8 @@ export default {
} else { } else {
param.id = 0 param.id = 0
param.status ? param.status = 'Y' : param.status = 'N' param.status ? param.status = 'Y' : param.status = 'N'
param.starDate = moment(param.starDate).format('YYYY-MM-DD HH:MM:SS')
param.endDate = moment(param.endDate).format('YYYY-MM-DD HH:MM:SS')
this.$axios.post('/pccook/add/cook', param).then(()=>{ this.$axios.post('/pccook/add/cook', param).then(()=>{
this.$message.success('新增成功') this.$message.success('新增成功')
this.goBack() this.goBack()
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a href="javascript:;" @click="goEdit(scope.row.id, $event)" class="btn_edit">编辑</a> <a href="javascript:;" @click="goEdit(scope.row.id, $event)" class="btn_edit">编辑</a>
<a href="javascript:;" @click="goDelete" class="btn_delete">删除</a> <a href="javascript:;" @click="goDelete(scope.row.id, $event)" class="btn_delete">删除</a>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -119,14 +119,19 @@ export default { ...@@ -119,14 +119,19 @@ export default {
id: id id: id
}}) }})
}, },
goDelete (e) { goDelete (id, e) {
e.stopPropagation() e.stopPropagation()
this.$confirm('提示', '确认删除此条信息?', { this.$confirm('提示', '确认删除此条信息?', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$axios({
method: 'get',
url: '/pccook/delete/' + id,
}).then((res) => {
this.getList()
})
}).catch(() => { }).catch(() => {
}) })
......
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 sign in to comment