Commit f24e7fec by 前端

平板

1 parent db74d73e
import request from "./request"
const path = "dj.api.smartcarlife.inspection.badge.management."
// 获取练习列表
export function getList(data) {
data.method = `${path}page`
return request(data)
}
// 获取车辆品牌
export function getBrandList(data = {}) {
data.method = 'merchants.api.merchantCommon.getCarbrandTree'
return request(data)
}
// 新增
export function addOrUpdate(data) {
data.method = `${path}addOrUpdate`
return request(data)
}
// 导出
export function exportTable(data) {
data.method = `${path}page.export`
return request(data)
}
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-09-03 10:10:08
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-12-20 16:56:27
* @FilePath: \dj-car-life-system\src\api\tablet.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import request from "./request"
const path = "dj.api.smartcarlife.inspection.badge.management."
// 获取练习列表
export function getList(data) {
data.method = `${path}page`
return request(data)
}
// 获取车辆品牌
export function getBrandList(data = {}) {
data.method = "merchants.api.merchantCommon.getCarbrandTree"
return request(data)
}
// 新增
export function addOrUpdate(data) {
data.method = `${path}addOrUpdate`
return request(data)
}
// 查询平板资产修改记录
export function findAllRecord(data) {
data.method = `dj.api.smartcarlife.inspection.badge.management.findAllRecord`
return request(data)
}
<template>
<el-dialog
title="新增信息"
:visible.sync="dialogVisible"
width="50%"
:before-close="handleClose"
>
<el-dialog title="新增信息" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
<div class="dialog-body">
<el-timeline>
<el-timeline-item timestamp="2018/4/12" placement="top" v-for="(line,index) in lineList">
<el-timeline v-if="lineList.length">
<el-timeline-item :timestamp="line.disDate" placement="top" v-for="(line, index) in lineList" :key="index"">
<div class="card-box">
<div class="card-item" v-for="(card,cardIndex) in line.cardList"">
<div class="card-content">运营{{ card }}</div>
<div class="card-content">原保管人:</div>
<div class="card-content">
现保管人:&nbsp;&nbsp;&nbsp;&nbsp;派发时间:
</div>
<div class="card-content">备注:</div>
<div class="card-btn">
变更
</div>
<div class="card-item" v-for="(card, cardIndex) in line.list"" :key="cardIndex">
<div class=" card-content">运营{{ card.createdBy }}</div>
<div class="card-content">原保管人:{{ card.oldCustodian }}</div>
<div class="card-content">
现保管人:{{ card.newCustodian }}<span>派发时间:{{ line.disDate }}</span>
</div>
<div class="card-content">备注:{{ card.remark }}</div>
<div class="card-btn">
{{index == lineList.length-1&& cardIndex == line.list.length -1 ? '新增' : '变更'}}
</div>
</div>
</el-timeline-item>
</el-timeline>
</div>
</el-timeline-item>
</el-timeline>
<div class="empty-box" v-else>
<img src="@/assets/empty.png">
<div class="empty-text">暂无记录</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
<el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="handleClose">确 定</el-button>
</span>
</el-dialog>
</template>
<script type="text/ecmascript-6">
import { Util } from "@/common/util"
import { findAllRecord } from "@api/tablet"
export default {
name: 'Timeline',
props: {
dialogVisible: {
type: Boolean,
default: true
}
},
recordId: [Number, String]
},
data () {
data() {
return {
lineList: [{
time: '2020-10-02',
cardList: [1,2,3]
},{
cardList: [1, 2, 3]
}, {
time: '2020-10-02',
cardList: [1,2,3]
cardList: [1, 2, 3]
}]
}
},
mounted () {
watch: {
dialogVisible(val) {
if (val) {
this.findAllRecord()
}
}
},
mounted() {
},
methods: {
findAllRecord() {
findAllRecord({ id: this.recordId }).then((res) => {
const groupedByDisDate = res.reduce((acc, current) => {
current.disDate = Util.dateFormate(current.disDate, "YYYY-MM-DD")
if (!acc[current.disDate]) {
acc[current.disDate] = [];
}
acc[current.disDate].push(current);
return acc;
}, {});
const result = Object.values(groupedByDisDate);
console.log(result);
const resultWithListField = Object.keys(groupedByDisDate).map(disDate => ({
disDate: disDate,
list: groupedByDisDate[disDate]
}));
this.lineList = resultWithListField
})
},
handleClose() {
this.$emit('close')
}
}
}
</script>
<style scoped lang="scss">
.dialog-body {
height: calc(100vh - 400px);
max-height: calc(100vh - 400px);
overflow-y: auto;
.card-box {
.card-item {
width: 90%;
width: 90%;
padding: 12px;
opacity: 1;
border: 1px solid #e5e5e5;
background: #ffffff6b;
margin-bottom: 8px;
position: relative;
.card-btn {
background: #e7eefe;
line-height: 20px;
text-align: center;
position: absolute;
width: 40px;
height: 20px;
border-radius: 2px;
opacity: 1;
background: #e7eefe;
color: #185efe;
font-size: 12px;
right: 0px;
top: 0px;
height: 20px;
border-radius: 2px;
opacity: 1;
background: #e7eefe;
color: #185efe;
font-size: 12px;
right: 0px;
top: 0px;
}
.card-content {
color: #666666;
font-size: 12px;
line-height: 26px;
span {
margin-left: 20px;
}
}
}
}
}
.empty-box {
text-align: center;
img {
width: 64px;
height: 40px;
margin-top: 100px;
}
.empty-text {
color: #666666;
}
}
</style>
......@@ -54,7 +54,10 @@
>
<div slot="auth-button" slot-scope="scope">
<auth-button :data="scope.scope" :show-btn-ids="['9121103']" />
<el-button type="text" style="margin-left: 10px" @click="showTime"
<el-button
type="text"
style="margin-left: 10px"
@click="showTime(scope.scope)"
>变更记录</el-button
>
</div>
......@@ -82,11 +85,13 @@
<el-form-item label="保管人:" prop="custodian">
<el-input v-model="dialogForm.custodian" maxlength="20"></el-input>
</el-form-item>
<el-form-item label="派发日期:" prop="custodian">
<el-form-item label="派发日期:" prop="disDate">
<el-date-picker
v-model="dialogForm.value1"
v-model="dialogForm.disDate"
type="date"
placeholder="选择日期"
format="yyyy/MM/dd"
value-format="yyyy/MM/dd"
>
</el-date-picker>
</el-form-item>
......@@ -136,9 +141,9 @@
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="备注:" prop="custodian">
<el-form-item label="备注:">
<el-input
v-model="dialogForm.custodian"
v-model="dialogForm.remark"
type="textarea"
:rows="3"
maxlength="200"
......@@ -150,7 +155,11 @@
<el-button type="primary" @click="handleSubmit">确 定</el-button>
</span>
</el-dialog>
<Timeline :dialogVisible="timeVisible" @close="closeDialog"></Timeline>
<Timeline
:dialogVisible="timeVisible"
:recordId="recordId"
@close="closeDialog"
></Timeline>
</d2-container>
</template>
......@@ -196,6 +205,7 @@ export default {
}
return {
timeVisible: false,
recordId: "",
searchForm: {
businessScene: ["1"]
},
......@@ -346,7 +356,7 @@ export default {
},
{
label: "APP编号",
prop: "appCode",
prop: "appVersion",
width: "200px"
},
{
......@@ -387,8 +397,13 @@ export default {
},
{
label: "派发日期",
prop: "supervision",
width: "160px"
prop: "disDate",
width: "160px",
formatter: (cellValue) => {
return cellValue.disDate
? Util.dateFormate(cellValue.disDate, "YYYY-MM-DD")
: "-"
}
},
{
label: "最近使用时间",
......@@ -443,6 +458,13 @@ export default {
{ required: true, message: "请输入设备编号", trigger: "blur" },
{ validator: numberOrEng, trigger: "blur" }
],
disDate: [
{
required: true,
message: "请选择disDate",
trigger: "change"
}
],
appCode: [
{ required: true, message: "请输入APP编号", trigger: "blur" },
{ validator: numberOrEng, trigger: "blur" }
......@@ -467,8 +489,9 @@ export default {
closeDialog() {
this.timeVisible = false
},
showTime() {
showTime(row) {
this.timeVisible = true
this.recordId = row.id
},
handleSearch() {
this.$refs.tabletTable.refreshTable(true, true)
......@@ -491,15 +514,20 @@ export default {
custodianPhone,
supervision,
brandId,
disDate,
remark,
directSalesFlag
} = scope
// if (businessScene) scope.business = businessScene.split(',')
this.dialogForm = {
id,
badgeCode,
appCode,
disDate: Util.dateFormate(disDate, "YYYY/MM/DD"),
business: businessScene ? businessScene.split(",") : [],
custodian,
remark,
custodianPhone,
supervision,
brandId: brandId ? Number(brandId) : null,
......@@ -538,7 +566,7 @@ export default {
(item) => item.id == this.dialogForm.brandId
).label
}
console.log(params)
params.disDate = params.disDate
delete params.business
this.$refs.dialogForm.validate((valid) => {
if (valid) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!