Commit f3069ff7 by lixiaomin

修改页面

parent 83e237f5
......@@ -76,3 +76,12 @@ export function addProperty(data) {
});
}
// 新增出厂日志
export function addMachineLog(data) {
return request({
url: "/v1/add/machine/log",
method: "post",
data: data,
});
}
......@@ -152,3 +152,18 @@ export function getShopAreaTree() {
method: "get",
});
}
export function testFinish(shopId){
return request({
url: "/system/shop/test/finish/"+shopId,
method: "get",
});
}
export function testStart(shopId){
return request({
url: "/system/shop/test/start/"+shopId,
method: "get",
});
}
......@@ -80,7 +80,10 @@ export default {
handler(val) {
if (val) {
// 首先将值转为数组
const list = Array.isArray(JSON.parse(val)) ? JSON.parse(val) : this.value.split(",");
if(val.indexOf("[")!=-1){
val=JSON.parse(val);
}
const list = Array.isArray(val) ? val : this.value.split(",");
// 然后将数组转为对象数组
this.fileList = list.map((item) => {
if (typeof item === "string") {
......
......@@ -88,7 +88,8 @@ export default {
// 查询参数
queryParams: {
page: 1,
limit: 10,
limit: 10,
model_id:null
},
modelList:[]
};
......@@ -119,18 +120,21 @@ export default {
},
/** 搜索按钮操作 */
handleQuery() {
if(this.queryParams.model_id==""){
this.queryParams.model_id=null;
}
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.name=null;
this.queryParams.state=null;
this.queryParams.model_id=null;
this.queryParams.code="";
this.getList();
},
//日志
handleLogDialog(row){
this.$refs.machineDetailsLog.handleLogDialog(row.id);
this.$refs.machineDetailsLog.handleLogDialog(row);
},
//组件
handleComponentDialog(row){
......
......@@ -19,7 +19,7 @@
</div>
</el-dialog>
<el-dialog title="主动上报日志" :visible.sync="logContentDiaLog" width="500px" append-to-body >
<el-input type="textarea" :rows="10" placeholder="请输入上报日志内容" v-model="textarea1"/>
<el-input type="textarea" :rows="10" placeholder="请输入上报日志内容" v-model="message"/>
<div slot="footer" class="dialog-footer" >
<el-button type="primary" @click="submitLogContent" >确定</el-button>
<el-button @click="contentDialogCancel">取消</el-button>
......@@ -28,7 +28,7 @@
</div>
</template>
<script>
import {getMachineLog,getMachineComLog} from "@/api/machine/machineDetails";
import {getMachineLog,getMachineComLog,addMachineLog} from "@/api/machine/machineDetails";
export default {
data() {
return {
......@@ -39,7 +39,8 @@ export default {
machineId:null,
contentTag:true,
logContentDiaLog:false,
textarea1:'',
message:'',
machineCode:''
};
},
created() {
......@@ -58,9 +59,10 @@ export default {
},
methods: {
//弹出机器页面
handleLogDialog(val){
handleLogDialog(row){
this.activeName="first";
this.machineId=val;
this.machineId=row.id;
this.machineCode=row.code;
this.logDiaLog=true;
this.getMachineLog();
},
......@@ -72,7 +74,18 @@ export default {
},
//提交主动上报日志
submitLogContent(){
let obj={
"machine_id": this.machineId,
"machine_code": this.machineCode,
"message": this.message
}
addMachineLog(obj).then((response)=>{
if(response.code==0){
this.$modal.msgSuccess("主动上报内容成功!");
this.logContentDiaLog=false;
this.getMachineLog();
}
})
},
contentDialogCancel(){
this.logContentDiaLog=false;
......
......@@ -70,6 +70,7 @@
</el-table-column>
<el-table-column label="状态" align="center" prop="state">
<template slot-scope="scope">
<span v-if="scope.row.state == 0">测试中</span>
<span v-if="scope.row.state == 1">正常营业</span>
<span v-if="scope.row.state == 2">暂停营业</span>
<span v-if="scope.row.state == 3">已删除</span>
......@@ -77,16 +78,20 @@
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button v-show="scope.row.state !='3'" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
<el-button v-show="scope.row.state !=3" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:shop:remove']">删除</el-button>
<el-button size="mini" type="text" v-if="authBtn(['1'], scope.row.state)"
<el-button size="mini" type="text" v-if="authBtn([1], scope.row.state)"
@click="setShopState(scope.row, 2, 'setState')" v-hasPermi="['system:shop:suspended']">
暂停营业</el-button>
<el-button size="mini" type="text" v-if="authBtn(['2'], scope.row.state)"
<el-button size="mini" type="text" v-if="authBtn([2], scope.row.state)"
@click="setShopState(scope.row, 1, 'setState')" v-hasPermi="['system:shop:start']">开始营业</el-button>
<el-button size="mini" type="text" v-if="authBtn(['3'], scope.row.state)"
<el-button size="mini" type="text" v-if="authBtn([3], scope.row.state)"
@click="setShopState(scope.row, 1, 'setState')" v-hasPermi="['system:shop:restart']">恢复营业</el-button>
<el-button v-show="scope.row.isDefault=='0'" size="mini" type="text" @click="setShopState(scope.row)" v-hasPermi="['system:shop:default']">设为默认</el-button>
<el-button v-show="scope.row.isDefault==0" size="mini" type="text" @click="setShopState(scope.row)" v-hasPermi="['system:shop:default']">设为默认</el-button>
<el-button size="mini" type="text" v-if="authBtn([0], scope.row.state)"
@click="testFinish(scope.row)" v-hasPermi="['system:shop:testFinish']">测试完成</el-button>
<el-button size="mini" type="text" v-if="authBtn([2], scope.row.state)"
@click="testStart(scope.row)" v-hasPermi="['system:shop:testStart']">开始测试</el-button>
</template>
</el-table-column>
</el-table>
......@@ -97,12 +102,7 @@
</template>
<script>
import {
listShop,
delShop,
updateShop,
getShopCity
} from "@/api/system/shop";
import {listShop,delShop,updateShop,getShopCity,testFinish,testStart} from "@/api/system/shop";
import SetShop from './setShop';
import piovince from '@/utils/piovince'
export default {
......@@ -268,6 +268,22 @@ export default {
})
},
//测试完成
testFinish(row){
testFinish(row.id).then(res => {
if(res.code="200"){
this.getList();
}
})
},
//测试开始
testStart(row){
testStart(row.id).then(res => {
if(res.code="200"){
this.getList();
}
})
}
},
};
......
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