|
|
@@ -0,0 +1,112 @@
|
|
|
+<template>
|
|
|
+ <div style="display:inline">
|
|
|
+ <el-button type="text" size="small" @click="showDialog">编辑</el-button>
|
|
|
+ <el-dialog title="添加" :visible.sync="dialogFormVisible" width="600px">
|
|
|
+ <el-form label-width="100px" :model="form" ref="ruleForm" label-position ="left">
|
|
|
+ <el-form-item label="设备码" prop="fecid">
|
|
|
+ <el-input size="small" v-model="form.fecid" autocomplete="off" placeholder="设备码" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="入口" prop="flocation">
|
|
|
+ <el-input size="small" v-model="form.flocation" type="text" autocomplete="off" placeholder="入口" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备备注" prop="fnotes">
|
|
|
+ <el-input size="small" v-model="form.fnotes" type="text" autocomplete="off" placeholder="设备备注" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="所属活动" prop="tactivityid">
|
|
|
+ <el-select size="small" v-model="form.tactivityid" style="width:100%">
|
|
|
+ <el-option v-for="item in list" :key="item.index" :value="item.tactivityid" :label="item.ftitle"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogFormVisible = false" size="small">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="add('ruleForm')" size="small">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ props:['row'],
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ input:'',
|
|
|
+ dialogFormVisible:false,
|
|
|
+ form:{
|
|
|
+ },
|
|
|
+ list:[]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ showDialog () {
|
|
|
+ this.dialogFormVisible = true
|
|
|
+ this.form = Object.assign({},this.form,this.row)
|
|
|
+ },
|
|
|
+ add () {
|
|
|
+ this.$api.requested({
|
|
|
+ "classname": "enterprise.activity.scanning",
|
|
|
+ "method": "insertormodify_scanning",
|
|
|
+ "content":this.form
|
|
|
+ }).then(res=>{
|
|
|
+ if (res.code === 1) {
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.$notify({
|
|
|
+ title: '成功',
|
|
|
+ message: '修改成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.form = {}
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ } else {
|
|
|
+ this.$notify({
|
|
|
+ title: '失败',
|
|
|
+ message: res.data,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ activitylistData () {
|
|
|
+ this.$api.requested({
|
|
|
+ "classname": "enterprise.activity.activity",
|
|
|
+ "method": "query_activityList",
|
|
|
+ "content": {
|
|
|
+ "getdatafromdbanyway": true,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 100,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ this.list = res.data
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.activitylistData()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+<style>
|
|
|
+input[type=number] {
|
|
|
+ -moz-appearance:textfield;
|
|
|
+}
|
|
|
+input[type=number]::-webkit-inner-spin-button,
|
|
|
+input[type=number]::-webkit-outer-spin-button {
|
|
|
+ -webkit-appearance: none;
|
|
|
+ margin: 0;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style scoped>
|
|
|
+.flex{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ padding: 15px 20px;
|
|
|
+ background: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|