Browse Source

5.17

master
fengdong777 2 years ago
parent
commit
a2aa7d923a
  1. 11
      yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/api/Zhj/inquireStatistics/index.js
  2. 20
      yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/views/inquireStatistics/index.vue
  3. 118
      yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/views/parameterSet/footSet.vue

11
yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/api/Zhj/inquireStatistics/index.js

@ -66,4 +66,15 @@ export function selectStoreList(data) {
headers: {'Content-Type': 'application/json', headers: {'Content-Type': 'application/json',
} }
}) })
}
// 添加占比
export function save(data) {
return request({
url: '/dbCenter/proportion/save ',
data: data,
method: 'post',
headers: {
'Content-Type': 'application/json'
}
})
} }

20
yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/views/inquireStatistics/index.vue

@ -82,19 +82,22 @@
</el-table-column> </el-table-column>
<el-table-column prop="storeName" label="门店" align="center" width="150px"> <el-table-column prop="storeName" label="门店" align="center" width="150px">
</el-table-column> </el-table-column>
<el-table-column prop="dataDate" label="日期" sortable align="center" width="100px"> <el-table-column prop="dataDate" label="日期" sortable align="center" >
</el-table-column> </el-table-column>
<el-table-column prop="salesAmount" label="销售额" align="center" width="100px"> <el-table-column prop="salesAmount" label="销售额" align="center" >
</el-table-column> </el-table-column>
<el-table-column prop="oils" label="油类成本" align="center" width="150px" :formatter="to2"> <el-table-column prop="proportion" label="成本信息" align="center" :formatter="to2">
</el-table-column> <template slot-scope="scope">
<el-table-column prop="rice" label="米类成本" align="center" width="150px" :formatter="to2"> <div slot="reference" class="name-wrapper" v-for="(item,index) in scope.row.proportion" :key="index">
</el-table-column> <div slot="reference" v-for="(item,index) in item" :key="index">
<el-table-column prop="face" label="面类成本" align="center" width="150px" :formatter="to2"> {{ item }}
</div>
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="totalCount" label="合计成本金额" align="center" width="150px" :formatter="to2"> <el-table-column prop="totalCount" label="合计成本金额" align="center" width="150px" :formatter="to2">
</el-table-column> </el-table-column>
<el-table-column fixed="right" width="200px" label="明细信息" align="center"> <el-table-column label="明细信息" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="primary" type="primary"
@ -312,6 +315,7 @@ export default {
if (res.success) { if (res.success) {
this.queryParams.total = res.data.total this.queryParams.total = res.data.total
_this.tableData=res.data.records _this.tableData=res.data.records
console.log(res.data.records[0].proportion[0]);
} else { } else {
// resp.code // resp.code
_this.tableData = [] _this.tableData = []

118
yxt-supervise-dbcenter/yxt-supervise-dbcenter-ui/src/views/parameterSet/footSet.vue

@ -1,64 +1,110 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="listconadd" style="padding: 20px;"> <div class="listconadd" style="padding: 20px;">
<table class="e-table" > <el-table v-loading="tableLoading" :default-sort = "{prop: 'date', order: 'descending'}" :data="tableData" border style="width: 100%" >
<tr> <el-table-column label="序号" width="55px" type="index" align="center"></el-table-column>
<td>品牌</td> <el-table-column prop="enpName" label="厂家" align="center">
</el-table-column>
<el-table-column prop="name" label="品牌" align="center" >
</el-table-column>
<el-table-column prop="enpName" label="厂家" align="center">
</el-table-column>
<el-table-column fixed="right" width="200px" label="明细信息" align="center">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="purchase(scope.row)"
>
修改
</el-button>
<el-button
type="primary"
size="mini"
@click="addList(scope.row)"
>
添加
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 添加食品占比 -->
<el-dialog
:title="dialogTitle + '食品占比'"
:visible.sync="editDialog"
width="40%"
>
<table class="e-table" cellspacing="0">
<tr>
<td>品牌名称</td>
<td> <td>
<el-select v-model="tableData.brandName" placeholder="请选择"> <el-input
<el-option v-model="makeUp.brandName"
v-for="{item,i} in ListName" style="width: 300px"
:key="i" disabled
:label="item.name" ></el-input>
:value="item.name"
>
</el-option>
</el-select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>教师姓名</td> <td>占比名称</td>
<td> <td>
<el-input <el-input
v-model="makeUp.typeName"
style="width: 300px" style="width: 300px"
></el-input> ></el-input>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>教师工号</td> <td>占比百分比</td>
<td> <td>
<el-input <el-input
v-model="makeUp.proportion"
style="width: 300px" style="width: 300px"
></el-input> ></el-input>
</td> </td>
</tr> </tr>
</table> </table>
</div> <div style="margin-top: 20px; text-align: center">
<el-button type="primary" @click="save()">添加</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {listPage,selectBrandList} from '@/api/Zhj/inquireStatistics/index.js' import {selectBrandList,save} from '@/api/Zhj/inquireStatistics/index.js'
export default { export default {
data() { data() {
return { return {
tableLoading: false, tableLoading: false,
tableData: { dialogTitle: "",
sid:'', tableData: [],
editDialog:false,
makeUp:{
brandSid:'',
brandName:'', brandName:'',
typeName:'', typeName:'',
proportion:'' proportion:'',
}, },
ListName:[] ruleForm: {
time: '',
data:{
salesAmount:'',
purchase:'',
salesDishes:''
}
},
}; };
}, },
mounted() { mounted() {
selectBrandList().then((res)=>{ selectBrandList().then((res)=>{
this.ListName = res.data this.ListName = res.data
this.tableData=res.data
}) })
}, },
created() { created() {
this.getPageList()
}, },
methods: { methods: {
resetSearch() { resetSearch() {
@ -74,14 +120,38 @@ export default {
endTime: "", endTime: "",
}, },
}; };
this.getPageList();
},
getPageList() {
},
save(){
save(this.makeUp).then((res)=>{
})
}, },
addList(row){
this.dialogTitle = "销售";
this.editDialog = true;
console.log(row);
this.makeUp.brandName = row.name
this.makeUp.brandSid = row.sid
},
resetForm() {
this.ruleForm= {
time: '',
data:{
salesAmount:'',
purchase:'',
salesDishes:''
}
}
}
}, },
}; };
</script> </script>
<style scoped="scoped" > <style scoped="scoped" >
.my-tabs {
margin-top: 10px;
}
</style> </style>
Loading…
Cancel
Save