|
@@ -33,11 +33,20 @@
|
|
|
|
|
|
<!-- 筛选条件 -->
|
|
|
<div>
|
|
|
- <el-form label-width="70px" size="small" label-position="left">
|
|
|
+ <el-form
|
|
|
+ ref="screenForm"
|
|
|
+ :model="screenForm"
|
|
|
+ label-width="70px"
|
|
|
+ size="small"
|
|
|
+ label-position="left"
|
|
|
+ >
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
|
- <el-form-item label="条件" prop="account">
|
|
|
- <el-input placeholder="请输入筛选条件"></el-input>
|
|
|
+ <el-form-item label="条件" prop="customerName">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入筛选条件"
|
|
|
+ v-model="screenForm.customerName"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
@@ -55,20 +64,65 @@
|
|
|
<!-- 按钮 -->
|
|
|
<div class="btn-group clearfix">
|
|
|
<div class="fl">
|
|
|
- <el-button type="primary">新增</el-button>
|
|
|
- <el-button type="primary">编辑</el-button>
|
|
|
- <el-button type="primary">删除</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="
|
|
|
+ () => {
|
|
|
+ (showDialog = true), (type = 1);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="
|
|
|
+ () => {
|
|
|
+ (showDialog = true), (type = 2);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-popconfirm
|
|
|
+ confirm-button-text="好的"
|
|
|
+ cancel-button-text="不用了"
|
|
|
+ icon="el-icon-info"
|
|
|
+ icon-color="red"
|
|
|
+ title="内容确定删除吗?"
|
|
|
+ @onConfirm="hanleDeleteAll"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ slot="reference"
|
|
|
+ class="el-popover-left"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </el-popconfirm>
|
|
|
</div>
|
|
|
<div class="fr">
|
|
|
- <el-button type="primary">导入</el-button>
|
|
|
- <el-button type="primary">导出</el-button>
|
|
|
- <el-button type="primary">打印</el-button>
|
|
|
+ <el-upload
|
|
|
+ class="import-btn"
|
|
|
+ :action="baseURL + 'student/import'"
|
|
|
+ :http-request="handleImport"
|
|
|
+ :file-list="importFileList"
|
|
|
+ >
|
|
|
+ <el-button type="primary" size="small">导入</el-button>
|
|
|
+ </el-upload>
|
|
|
+ <el-button type="primary" size="small" @click="handleExport"
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" size="small" @click="hanlePrint"
|
|
|
+ >打印</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="mymain-container">
|
|
|
<!-- 列表 -->
|
|
|
<div class="table">
|
|
|
+ <!-- startprint -->
|
|
|
<el-table
|
|
|
v-loading="listLoading"
|
|
|
:data="dataList"
|
|
@@ -77,20 +131,21 @@
|
|
|
fit
|
|
|
highlight-current-row
|
|
|
stripe
|
|
|
+ @select-all="hanleSelectAll"
|
|
|
>
|
|
|
- <el-table-column type="selection" min-width="100" />
|
|
|
+ <el-table-column type="selection" align="center" min-width="100" />
|
|
|
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
label="经销商编码"
|
|
|
- prop="bianma"
|
|
|
+ prop="customerNumber"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
label="经销商名称"
|
|
|
- prop="dealerName"
|
|
|
+ prop="customerName"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
@@ -104,35 +159,35 @@
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
label="收费规则(每立方米)"
|
|
|
- prop="rule"
|
|
|
+ prop="toll"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
label="创建人"
|
|
|
- prop="createMan"
|
|
|
+ prop="createBy"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
label="创建时间"
|
|
|
- prop="createDate"
|
|
|
+ prop="createTime"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
label="更新人"
|
|
|
- prop="updateMan"
|
|
|
+ prop="updateBy"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
label="更新时间"
|
|
|
- prop="updateDate"
|
|
|
+ prop="updateTime"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
/>
|
|
@@ -142,12 +197,38 @@
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
- <el-button type="text" class="textColor" @click="editFn"
|
|
|
- >编辑</el-button
|
|
|
- >
|
|
|
- <el-button type="text" class="textColor">删除</el-button>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ class="textColor"
|
|
|
+ @click="hanleDetail(scope.row)"
|
|
|
+ >详情</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ class="textColor"
|
|
|
+ @click="editFn(scope.row.id, scope.row)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-popconfirm
|
|
|
+ confirm-button-text="好的"
|
|
|
+ cancel-button-text="不用了"
|
|
|
+ icon="el-icon-info"
|
|
|
+ icon-color="red"
|
|
|
+ title="内容确定删除吗?"
|
|
|
+ @onConfirm="hanleDelete(scope.row.id)"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ slot="reference"
|
|
|
+ type="text"
|
|
|
+ class="textColor el-popover-left"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <!-- endprint -->
|
|
|
</div>
|
|
|
<!-- 分页 -->
|
|
|
<div class="fr">
|
|
@@ -173,16 +254,25 @@
|
|
|
<el-form :model="dialogForm" label-width="100px" label-position="right">
|
|
|
<el-form-item label="经销商编码">
|
|
|
<el-select
|
|
|
- v-model="dialogForm.bianma"
|
|
|
+ v-model="dialogForm.customerNumber"
|
|
|
placeholder="请选择活动区域"
|
|
|
class="inputStyle"
|
|
|
+ v-el-select-loadmore="loadMore"
|
|
|
>
|
|
|
- <el-option label="区域一" value="shanghai"></el-option>
|
|
|
- <el-option label="区域二" value="beijing"></el-option>
|
|
|
+ <el-option
|
|
|
+ v-for="item in customerList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.number"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
<el-form-item label="经销商名称">
|
|
|
- <el-input v-model="dialogForm.name" class="inputStyle"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="dialogForm.customerName"
|
|
|
+ class="inputStyle"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="仓库存放" class="sty">
|
|
|
<el-input
|
|
@@ -190,77 +280,196 @@
|
|
|
class="inputStyle"
|
|
|
/>天内可免费受存储管理费用. 当超过
|
|
|
<el-input
|
|
|
- v-model="dialogForm.day"
|
|
|
+ v-model="dialogForm.freeDay"
|
|
|
class="inputStyle"
|
|
|
/>天后,按每立方米
|
|
|
- <el-input v-model="dialogForm.money" class="inputStyle" />
|
|
|
+ <el-input v-model="dialogForm.toll" class="inputStyle" />
|
|
|
元/天计算
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="showDialog = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="showDialog = false">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="hanleInfo">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import Mixin from "@/mixin/index";
|
|
|
+import { findElem, downloadFiles, handleImport } from "@/utils/util";
|
|
|
+
|
|
|
+import {
|
|
|
+ getListToll,
|
|
|
+ getDetail,
|
|
|
+ updateToll,
|
|
|
+ addToll,
|
|
|
+ deleteToll,
|
|
|
+ getCustomerList,
|
|
|
+} from "@/api/basic_data/warehouse";
|
|
|
export default {
|
|
|
+ mixins: [Mixin],
|
|
|
data() {
|
|
|
return {
|
|
|
+ sleectBox: {
|
|
|
+ currentPage: 1, // 当前页码
|
|
|
+ pageSize: 10, // 每页数量
|
|
|
+ listTotal: 0, // 列表总数
|
|
|
+ },
|
|
|
currentPage: 1, // 当前页码
|
|
|
pageSize: 10, // 每页数量
|
|
|
listTotal: 0, // 列表总数
|
|
|
+ importLoading: false, // 导入加载loading
|
|
|
+ importFileList: [], // 导入列表
|
|
|
dialogForm: {
|
|
|
- bianma: "",
|
|
|
- name: "",
|
|
|
- day: "",
|
|
|
- freeDay: "",
|
|
|
- money: "",
|
|
|
+ customerName: "",
|
|
|
+ customerNumber: "",
|
|
|
+ freeDay: 0,
|
|
|
+ toll: 0,
|
|
|
},
|
|
|
showDialog: false,
|
|
|
- dataList: [
|
|
|
- {
|
|
|
- num: "1",
|
|
|
- bianma: "1002",
|
|
|
- dealerName: "佛山市禅城区梁云冷气经营部",
|
|
|
- rule: "0.1",
|
|
|
- freeDay: "123",
|
|
|
- createMan: "张三",
|
|
|
- createDate: "2000/01/01",
|
|
|
- updateMan: "张三",
|
|
|
- updateDate: "2020/01/01",
|
|
|
- },
|
|
|
- {
|
|
|
- num: "1",
|
|
|
- bianma: "1002",
|
|
|
- dealerName: "佛山市禅城区梁云冷气经营部",
|
|
|
- rule: "0.1",
|
|
|
- freeDay: "123",
|
|
|
- createMan: "张三",
|
|
|
- createDate: "2000/01/01",
|
|
|
- updateMan: "张三",
|
|
|
- updateDate: "2020/01/01",
|
|
|
- },
|
|
|
- {
|
|
|
- num: "1",
|
|
|
- bianma: "1002",
|
|
|
- dealerName: "佛山市禅城区梁云冷气经营部",
|
|
|
- rule: "0.1",
|
|
|
- freeDay: "123",
|
|
|
- createMan: "张三",
|
|
|
- createDate: "2000/01/01",
|
|
|
- updateMan: "张三",
|
|
|
- updateDate: "2020/01/01",
|
|
|
- },
|
|
|
- ],
|
|
|
+ dataList: [],
|
|
|
+ screenForm: {
|
|
|
+ customerName: "",
|
|
|
+ freeDay: "",
|
|
|
+ toll: "",
|
|
|
+ },
|
|
|
+ type: null, // 1 新增 2 修改 null 详情
|
|
|
};
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ this.getCustomerList();
|
|
|
+ },
|
|
|
+ directives: {
|
|
|
+ "el-select-loadmore": {
|
|
|
+ bind(el, binding) {
|
|
|
+ // 获取element-ui定义好的scroll盒⼦
|
|
|
+ const SELECTWRAP_DOM = el.querySelector(
|
|
|
+ ".el-select-dropdown .el-select-dropdown__wrap"
|
|
|
+ );
|
|
|
+ SELECTWRAP_DOM.addEventListener("scroll", function () {
|
|
|
+ /**
|
|
|
+ * scrollHeight 获取元素内容⾼度(只读)
|
|
|
+ * scrollTop 获取或者设置元素的偏移值,常⽤于, 计算滚动条的位置, 当⼀个元素的容器没有产⽣垂直⽅向的滚动条, 那它的scrollTop的值默认为0.
|
|
|
+ * clientHeight 读取元素的可见⾼度(只读)
|
|
|
+ * 如果元素滚动到底, 下⾯等式返回true, 没有则返回false:
|
|
|
+ * ele.scrollHeight - ele.scrollTop === ele.clientHeight;
|
|
|
+ */
|
|
|
+ const condition =
|
|
|
+ this.scrollHeight - this.scrollTop <= this.clientHeight;
|
|
|
+ if (condition) {
|
|
|
+ console.log("到底", binding);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
- editFn() {
|
|
|
+ editFn(id, row) {
|
|
|
+ this.type = 2;
|
|
|
+ this.diaLogForm = {
|
|
|
+ id,
|
|
|
+ customerName: row.customerName,
|
|
|
+ customerNumber: row.customerNumber,
|
|
|
+ freeDay: row.freeDay,
|
|
|
+ toll: row.toll,
|
|
|
+ };
|
|
|
this.showDialog = true;
|
|
|
},
|
|
|
+ hanleInfo() {
|
|
|
+ if (this.type === 1) {
|
|
|
+ addToll(this.diaLogForm).then((res) => {
|
|
|
+ this.$successMsg("保存成功");
|
|
|
+ console.log(params, 123);
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else if (this.type === 2) {
|
|
|
+ const params = {
|
|
|
+ ...this.diaLogForm,
|
|
|
+ };
|
|
|
+ console.log(params, 123);
|
|
|
+ updateToll(params).then((res) => {
|
|
|
+ this.$successMsg("编辑成功");
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ this.diaLogForm.id = null;
|
|
|
+ }
|
|
|
+ this.showDialog = false;
|
|
|
+ },
|
|
|
+ getList() {
|
|
|
+ this.listLoading = true;
|
|
|
+ let params = {
|
|
|
+ pageNum: this.currentPage,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ customerName: this.screenForm.customerName,
|
|
|
+ freeDay: this.screenForm.freeDay,
|
|
|
+ toll: this.screenForm.toll,
|
|
|
+ };
|
|
|
+ getListToll(params).then((res) => {
|
|
|
+ this.dataList = res.data.records;
|
|
|
+ this.listTotal = res.data.total;
|
|
|
+ this.listLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ loadmore() {
|
|
|
+ this.sleectBox.currentPage++;
|
|
|
+ console.log(1233);
|
|
|
+ this.getCustomerList();
|
|
|
+ },
|
|
|
+ getCustomerList() {
|
|
|
+ let params = {
|
|
|
+ pageNum: this.sleectBox.currentPage,
|
|
|
+ pageSize: this.sleectBox.pageSize,
|
|
|
+ keyword: "",
|
|
|
+ };
|
|
|
+ getCustomerList(params).then((res) => {
|
|
|
+ this.customerList = res.data.records;
|
|
|
+ // this.listTotal = res.data.total;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ hanleDetail(detail) {
|
|
|
+ this.type = null;
|
|
|
+ this.showDialogForm = true;
|
|
|
+ this.diaLogForm = detail;
|
|
|
+ },
|
|
|
+
|
|
|
+ handleExport() {
|
|
|
+ let screenData = {
|
|
|
+ customerName: this.screenForm.customerName,
|
|
|
+ freeDay: this.screenForm.freeDay,
|
|
|
+ toll: this.screenForm.toll,
|
|
|
+ };
|
|
|
+ downloadFiles("/stock/exportToll", screenData);
|
|
|
+ },
|
|
|
+ // 删除数据
|
|
|
+ hanleDelete(id) {
|
|
|
+ deleteToll({ id }).then((res) => {
|
|
|
+ this.$successMsg("删除成功");
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 导入
|
|
|
+ async handleImport(param) {
|
|
|
+ this.importLoading = true;
|
|
|
+ const file = param.file;
|
|
|
+ console.log(file, 123);
|
|
|
+ const formData = new FormData();
|
|
|
+ formData.append("file", file);
|
|
|
+ let result = await handleImport("/stock/importToll", formData);
|
|
|
+ this.importLoading = false;
|
|
|
+ this.importFileList = [];
|
|
|
+ if (result.code == 200) {
|
|
|
+ this.$alert(result.message, "导入成功", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$alert(result.message, "导入失败", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -317,5 +526,5 @@ export default {
|
|
|
.main {
|
|
|
padding: 12px;
|
|
|
}
|
|
|
-</style>>
|
|
|
-
|
|
|
+</style>
|
|
|
+>
|