mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-20 01:45:53 +08:00
修改一些问题,删除无用文件,商品选择器回显
This commit is contained in:
@@ -24,11 +24,10 @@
|
||||
</Form>
|
||||
</Row>
|
||||
<Row class="operation padding-row">
|
||||
<Button @click="add" type="primary">添加</Button>
|
||||
<Button @click="delAll">批量删除</Button>
|
||||
</Row>
|
||||
<Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-selection-change="changeSelect">
|
||||
</Table>
|
||||
</Row>
|
||||
<Row type="flex" justify="end" class="page">
|
||||
@@ -38,32 +37,6 @@
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||
<FormItem label="账单号" prop="sn">
|
||||
<Input v-model="form.sn" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
<FormItem label="店铺名称" prop="sellerName">
|
||||
<Input v-model="form.sellerName" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
<FormItem label="结算开始时间" prop="startTime">
|
||||
<DatePicker v-model="form.startTime" valueType="yyyy-MM-dd HH:mm:ss" clearable style="width: 100%"></DatePicker>
|
||||
</FormItem>
|
||||
<FormItem label="结算结束时间" prop="endTime">
|
||||
<DatePicker type="date" v-model="form.endTime" clearable style="width: 100%"></DatePicker>
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="最终结算金额" prop="billPrice">
|
||||
<Input v-model="form.billPrice" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交
|
||||
</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -76,9 +49,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
@@ -90,17 +60,6 @@ export default {
|
||||
billStatus:"" //状态
|
||||
},
|
||||
selectDate: null, // 选择一个时间段
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
sn: "",
|
||||
sellerName: "",
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
billPrice: "",
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
@@ -201,28 +160,20 @@ export default {
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
changePage(v) {
|
||||
changePage(v) { // 改变页码
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
},
|
||||
changePageSize(v) {
|
||||
changePageSize(v) { // 改变页数
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() {
|
||||
handleSearch() { // 搜索
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
changeSelect(e) {
|
||||
changeSelect(e) { // 表格选中
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
@@ -235,8 +186,6 @@ export default {
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
|
||||
// this.searchForm
|
||||
|
||||
this.searchForm.startTime &&
|
||||
(this.searchForm.startTime = this.$options.filters.unixToDate(
|
||||
this.searchForm.startTime / 1000
|
||||
@@ -256,43 +205,7 @@ export default {
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.modalType === 0) {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.form.id;
|
||||
this.postRequest("/bill/insertOrUpdate", this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 编辑
|
||||
this.postRequest("/bill/insertOrUpdate", this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加";
|
||||
this.$refs.form.resetFields();
|
||||
delete this.form.id;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
detail(v) {
|
||||
detail(v) { // 账单详情
|
||||
let id = v.id;
|
||||
this.$router.push({
|
||||
name: "bill-detail",
|
||||
@@ -314,14 +227,10 @@ export default {
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
// 模拟请求成功
|
||||
//this.$Message.success("操作成功");
|
||||
//this.$Modal.remove();
|
||||
//this.getDataList();
|
||||
},
|
||||
});
|
||||
},
|
||||
delAll() {
|
||||
delAll() { // 多选删除数据
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要删除的数据");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user