From 7ace4829b023490ec4dccd04004294692d17d08d Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 07 五月 2024 18:11:46 +0800
Subject: [PATCH] 产量登记表模块 台产量,个人产量等限制保留2为小数
---
src/views/productManage/productRegisterForm/index.vue | 114 +++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 95 insertions(+), 19 deletions(-)
diff --git a/src/views/productManage/productRegisterForm/index.vue b/src/views/productManage/productRegisterForm/index.vue
index 1770ad9..d92f382 100644
--- a/src/views/productManage/productRegisterForm/index.vue
+++ b/src/views/productManage/productRegisterForm/index.vue
@@ -13,9 +13,8 @@
<template slot="tableButton">
<el-table-column label="鎿嶄綔" width="180">
<template slot-scope="scope">
- <el-button @click="viewClick(scope.row)" type="text" size="small">鏌ョ湅</el-button>
<el-button @click="editClick(scope.row)" type="text" size="small">缂栬緫</el-button>
- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button>
+ <el-button @click="delClick(scope.row)" type="text" size="small">鍒犻櫎</el-button>
</template>
</el-table-column>
</template>
@@ -30,6 +29,7 @@
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+import { getYieldRegisterList,deleteYieldRegister } from "@/api/productManage/productRegisterForm.js"
export default {
name: "productRegisterForm",
props: {},
@@ -40,26 +40,28 @@
return {
loading: false,
tableList: {},
+ keyword: '',
tableColumn: [
- { label: "缂栧彿", prop: "name", min: 100, default: true },
- { label: "鐢熶骇鏃堕棿", prop: "member_name" },
- { label: "杞︾粍", prop: "client_level" },
- { label: "瑙勬牸", prop: "next_visit_time", min: 90 },
- { label: "杞﹂棿", prop: "detail_address", min: 200 },
- { label: "搴勫彛", prop: "client_status" },
- { label: "鍥炴暟", prop: "contact_name", isContactClick: true },
- { label: "杞︾粍鎬讳骇閲�", prop: "contact_phone" }
+ { label: "缂栧彿", prop: "number", min: 100, default: true },
+ { label: "鐢熶骇鏃堕棿", prop: "createTime", min: 110, },
+ { label: "杞︾粍", prop: "groupNumber" },
+ { label: "瑙勬牸", prop: "spec", min: 90 },
+ { label: "杞﹂棿", prop: "workshopName", min: 200 },
+ { label: "搴勫彛", prop: "marketName" },
+ { label: "鍥炴暟", prop: "circle",},
+ { label: "杞︾粍鎬讳骇閲�", prop: "total" }
],
showCol: ["缂栧彿", "鐢熶骇鏃堕棿", "杞︾粍", "瑙勬牸", "杞﹂棿", "搴勫彛", "鍥炴暟", "杞︾粍鎬讳骇閲�"]
}
},
created() {
this.setTable()
+ this.getData(this.keyword)
},
methods: {
setTable() {
this.tableList = {
- selectIndex: true,
+ selectIndex: false,
tableInfomation: [],
allcol: [],
showcol: this.showCol,
@@ -85,24 +87,84 @@
this.showcol = val
this.tableList.tableColumn = this.setColumnVisible(val)
},
+ // 璇锋眰鏁版嵁
+ async getData() {
+ this.loading = true
+ await getYieldRegisterList({
+ keyword: this.keyword,
+ page: this.pagerOptions.currPage,
+ pageSize: this.pagerOptions.pageSize
+ })
+ .then((res) => {
+ console.log(res)
+ if (res.code === 200) {
+ if (res.data && res.data.length > 0) {
+ // const list = res.data.map((item) => {
+ // return {
+ // ...item,
+ // client_name: item.client.name,
+ // contact_name: item.contact.name,
+ // client_status: item.client_status.name,
+ // phone: item.contact.phone,
+ // member_name: item.member.username,
+ // contact_information_name: item.contact_information.name
+ // }
+ // })
+ this.tableList.tableInfomation = res.data || []
+ this.pagerOptions.totalCount = res.count
+ } else {
+ this.tableList.tableInfomation = []
+ }
+ } else {
+ this.tableList.tableInfomation = []
+ }
+ this.loading = false
+ })
+ .catch((err) => {
+ console.log(err)
+ this.tableList.tableInfomation = []
+ this.loading = false
+ })
+ },
// 鎼滅储
onFilterSearch(searchText) {
- console.log(searchText)
+ this.keyword = searchText ?? ""
+ this.pagerOptions.currPage = 1
+ this.getData()
},
// 鏂板
- addBtnClick() {},
- // 鏌ョ湅
- viewClick(row) {
- console.log(row)
+ addBtnClick() {
+ this.$router.push({ name: "addProductRegisterPage" })
},
// 缂栬緫
editClick(row) {
- console.log(row)
+ this.$router.push({
+ name:'addProductRegisterPage',
+ query:{
+ id:row.ID,
+ number:row.number,
+ }
+ });
},
// 鍒犻櫎
delClick(row) {
- console.log(row)
- }
+ this.$confirm("璇风‘璁ゆ槸鍚﹀垹闄わ紝鍒犻櫎鎿嶄綔涓嶅彲鎾ら攢?", "璀﹀憡", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ })
+ .then(() => {
+ deleteYieldRegister({ number: row.number }).then((response) => {
+ if (response.code === 200) {
+ this.$message.success("鍒犻櫎鎴愬姛")
+ this.getData()
+ } else {
+ this.$message.warning("鍒犻櫎澶辫触")
+ }
+ })
+ })
+ .catch(() => {})
+ },
}
}
</script>
@@ -110,6 +172,7 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.productRegisterForm-container {
+ height: 100%;
.filter-card {
margin: 20px 30px;
height: 80px;
@@ -123,6 +186,19 @@
margin: 0 30px;
background-color: #fff;
padding: 10px 15px;
+ height: calc(100% - 160px);
+ border-radius: 12px;
}
+ .list-view {
+ height: calc(100% - 60px);
+ overflow: hidden;
+ }
+ .btn-pager {
+ display: flex;
+ margin-top: 10px;
+ .page {
+ margin-left: auto;
+ }
+ }
}
</style>
--
Gitblit v1.8.0