From 051145654d6b1b5556c70f91ca29384a35aa5f7d Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期四, 16 十一月 2023 13:46:38 +0800
Subject: [PATCH] 公共组件选择产品改为下拉可搜索框、库存调整、补货、上架规则、重订货规则修改
---
src/views/operate/allot/index.vue | 228 +++++++++++++++++++++++++++++++--------------------------
1 files changed, 124 insertions(+), 104 deletions(-)
diff --git a/src/views/operate/allot/index.vue b/src/views/operate/allot/index.vue
index 042e54b..4156d63 100644
--- a/src/views/operate/allot/index.vue
+++ b/src/views/operate/allot/index.vue
@@ -3,7 +3,7 @@
<div class="top">
<SearchCommonView
:add-title="'鏂板缓'"
- :placeholder="'璇疯緭鍏ュ崟鍙�'"
+ :placeholder="'璇疯緭鍏ュ崟鍙�/鏉ユ簮鍗曟嵁'"
:amount-view="false"
@addCommonClick="addBtnClick"
@searchClick="getList"
@@ -11,25 +11,40 @@
</div>
<div class="list-view">
<div class="table">
- <TableCommonView
- ref="tableListRef"
- :table-list="tableList"
- @selTableCol="selTableCol"
- @tableRowClick="tableRowClick"
- ></TableCommonView>
+ <TableCommonView ref="tableListRef" :table-list="tableList" @selTableCol="selTableCol">
+ <template slot="tableButton">
+ <el-table-column label="鎿嶄綔" width="100">
+ <template slot-scope="scope">
+ <el-button @click="tableRowClick(scope.row, '鏌ョ湅')" type="text" size="small">鏌ョ湅</el-button>
+ <el-button
+ v-if="scope.row.status !== 4"
+ @click="tableRowClick(scope.row, '缂栬緫')"
+ type="text"
+ size="small"
+ >缂栬緫</el-button
+ >
+ </template>
+ </el-table-column>
+ </template>
+ </TableCommonView>
</div>
<div class="btn-pager">
<PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
</div>
</div>
<!-- 鏂板缓/缂栬緫 -->
- <AddOverviewDialog v-if="editConfig.visible" :work-type="'鍐呴儴璋冩嫧'" :edit-common-config="editConfig" />
+ <AddOverviewDialog
+ v-if="editConfig.visible"
+ :show-operation-type="true"
+ :work-type="3"
+ :edit-common-config="editConfig"
+ />
</div>
</template>
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
-import { getProductList } from "@/api/product/product"
+import { getAllList } from "@/api/overview/overview"
// import DetailProduct from "@/views/productManage/product/DetailProduct"
import AddOverviewDialog from "@/views/overview/AddOverviewDialog"
@@ -42,18 +57,14 @@
data() {
return {
tableList: {},
- showcol: ["浠�", "鑷�", "鑱旂郴浜�", "鏃ユ湡", "鏉ユ簮鍗曟嵁", "鍏徃", "鐘舵��"],
+ showcol: ["璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鑱旂郴浜�", "鏃ユ湡", "鏉ユ簮鍗曟嵁", "鍏徃", "鐘舵��"],
searchOptions: [],
- commonDetail: {
- visible: false,
- title: "鏂板缓",
- infomation: {}
- },
editConfig: {
visible: false,
title: "鏂板缓",
infomation: {}
- }
+ },
+ keyword: ""
}
},
created() {
@@ -64,7 +75,8 @@
setTable() {
this.tableList = {
tableInfomation: [],
- selectBox: true,
+ selectBox: false,
+ selectIndex: true,
showcol: this.showcol,
allcol: [],
tableColumn: this.setTableColumn(this.showcol)
@@ -82,121 +94,123 @@
let tableColumn = [
{
label: "鍗曞彿",
- prop: "id",
+ prop: "number",
isShowColumn: true,
default: true
},
{
- label: "浠�",
- prop: "deviceName",
- isShowColumn: showcol.includes("浠�"),
+ label: "璋冨嚭浣嶇疆",
+ prop: "from",
+ isShowColumn: showcol.includes("璋冨嚭浣嶇疆"),
default: false
},
{
- label: "鑷�",
- prop: "id",
- isShowColumn: showcol.includes("鑷�"),
+ label: "璋冨叆浣嶇疆",
+ prop: "to",
+ isShowColumn: showcol.includes("璋冨叆浣嶇疆"),
default: false
},
{
label: "鑱旂郴浜�",
- prop: "deviceId",
+ prop: "companyName",
isShowColumn: showcol.includes("鑱旂郴浜�"),
default: false
},
{
label: "璐熻矗浜�",
- prop: "shopName",
+ prop: "contacterName",
isShowColumn: showcol.includes("璐熻矗浜�"),
default: false
},
{
label: "鏃ユ湡",
- prop: "preTime",
+ prop: "operationDate",
isShowColumn: showcol.includes("鏃ユ湡"),
default: false,
date: true
},
- {
- label: "浜у搧鍙敤鎬�",
- prop: "status",
- isShowColumn: showcol.includes("浜у搧鍙敤鎬�"),
- width: 100,
- default: false
- },
- {
- label: "鎴鏃ユ湡",
- prop: "faultTime",
- isShowColumn: showcol.includes("鎴鏃ユ湡"),
- default: false
- },
- {
- label: "瀹為檯鏃ユ湡",
- prop: "shopName",
- isShowColumn: showcol.includes("瀹為檯鏃ユ湡"),
- default: false
- },
+ // {
+ // label: "浜у搧鍙敤鎬�",
+ // prop: "status",
+ // isShowColumn: showcol.includes("浜у搧鍙敤鎬�"),
+ // width: 100,
+ // default: false
+ // },
+ // {
+ // label: "鎴鏃ユ湡",
+ // prop: "faultTime",
+ // isShowColumn: showcol.includes("鎴鏃ユ湡"),
+ // default: false
+ // },
+ // {
+ // label: "瀹為檯鏃ユ湡",
+ // prop: "shopName",
+ // isShowColumn: showcol.includes("瀹為檯鏃ユ湡"),
+ // default: false
+ // },
{
label: "鏉ユ簮鍗曟嵁",
- prop: "faultLevel",
+ prop: "sourceNumber",
isShowColumn: showcol.includes("鏉ユ簮鍗曟嵁"),
default: false
},
+ // {
+ // label: "娆犲崟",
+ // prop: "status",
+ // isShowColumn: showcol.includes("娆犲崟"),
+ // default: false
+ // },
+ // {
+ // label: "杩借釜鍙傝��",
+ // prop: "status",
+ // isShowColumn: showcol.includes("杩借釜鍙傝��"),
+ // default: false
+ // },
+ // {
+ // label: "鎵胯繍鍟�",
+ // prop: "status",
+ // isShowColumn: showcol.includes("鎵胯繍鍟�"),
+ // default: false
+ // },
+ // {
+ // label: "鐩殑鍦�",
+ // prop: "status",
+ // isShowColumn: showcol.includes("鐩殑鍦�"),
+ // default: false
+ // },
+ // {
+ // label: "閲嶉噺",
+ // prop: "status",
+ // isShowColumn: showcol.includes("閲嶉噺"),
+ // default: false
+ // },
+ // {
+ // label: "鐗╂祦閲嶉噺",
+ // prop: "status",
+ // isShowColumn: showcol.includes("鐗╂祦閲嶉噺"),
+ // default: false
+ // },
{
- label: "娆犲崟",
- prop: "status",
- isShowColumn: showcol.includes("娆犲崟"),
- default: false
- },
- {
- label: "杩借釜鍙傝��",
- prop: "status",
- isShowColumn: showcol.includes("杩借釜鍙傝��"),
- default: false
- },
- {
- label: "鎵胯繍鍟�",
- prop: "status",
- isShowColumn: showcol.includes("鎵胯繍鍟�"),
- default: false
- },
- {
- label: "鐩殑鍦�",
- prop: "status",
- isShowColumn: showcol.includes("鐩殑鍦�"),
- default: false
- },
- {
- label: "閲嶉噺",
- prop: "status",
- isShowColumn: showcol.includes("閲嶉噺"),
- default: false
- },
- {
- label: "鐗╂祦閲嶉噺",
- prop: "status",
- isShowColumn: showcol.includes("鐗╂祦閲嶉噺"),
- default: false
- },
- {
- label: "鎿嶄綔绫诲瀷",
- prop: "faultTime",
+ label: "鍏ュ簱绫诲瀷",
+ prop: "operationTypeName",
isShowColumn: showcol.includes("鎿嶄綔绫诲瀷"),
default: false
},
- {
- label: "鍏徃",
- prop: "faultTime",
- isShowColumn: showcol.includes("鍏徃"),
- default: false
- },
+ // {
+ // label: "鍏徃",
+ // prop: "faultTime",
+ // isShowColumn: showcol.includes("鍏徃"),
+ // default: false
+ // },
{
label: "鐘舵��",
prop: "status",
width: 120,
isShowColumn: showcol.includes("鐘舵��"),
default: false,
- status: true
+ status: true,
+ isCallMethod: true,
+ getCallMethod: this.getStatus
}
]
return tableColumn
@@ -206,41 +220,47 @@
this.tableList.tableColumn = this.setTableColumn(val)
},
// 璇锋眰鏁版嵁
- async getData(val, content) {
- await getProductList({
- [val]: content,
+ async getData() {
+ await getAllList({
+ number: this.keyword,
page: this.pagerOptions.currPage,
pageSize: this.pagerOptions.pageSize
}).then((res) => {
- if (res.data.code === 200) {
- const list = res.data.data.list.map((item) => {
+ if (res.code === 200) {
+ const list = res.data.map((item) => {
return {
...item,
- supplierNumber: item.supplier.number,
- status: "灏辩华",
- preTime: "2023-09-04 11:20:00"
+ from: item.fromLocation.name,
+ to: item.toLocation.name
}
})
this.tableList.tableInfomation = list || []
- this.pagerOptions.totalCount = res.data.data.total
+ this.pagerOptions.totalCount = res.total
}
})
},
// 鎼滅储
getList(val) {
console.log(val)
+ this.keyword = val
+ this.pagerOptions.currPage = 1
+ this.getData()
},
- // 琛岀偣鍑�
- tableRowClick(row) {
+ // 鏌ョ湅 缂栬緫
+ tableRowClick(row, val) {
console.log(row)
this.editConfig.visible = true
- this.editConfig.title = "缂栬緫"
+ this.editConfig.title = val
this.editConfig.infomation = { ...row }
},
// 鏂板缓
addBtnClick() {
this.editConfig.visible = true
this.editConfig.title = "鏂板缓"
+ },
+ // 鐘舵��
+ getStatus(val) {
+ return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : "瀹屾垚"
}
}
}
--
Gitblit v1.8.0