|
@@ -17,7 +17,7 @@
|
|
|
@change="
|
|
|
pageInfo.curr = 1;
|
|
|
parmValue.page = 1;
|
|
|
- searchList();
|
|
|
+ stockName();
|
|
|
"
|
|
|
></el-cascader>
|
|
|
|
|
@@ -82,8 +82,14 @@
|
|
|
<el-col :span="24" class="card">
|
|
|
<el-card shadow="always">
|
|
|
<i :class="item.icon" class="icon"></i>
|
|
|
- <p>{{ item.num }}</p>
|
|
|
- <!-- <p>{{ item.label }}</p> -->
|
|
|
+ <!-- <p>{{ item.num }}</p> -->
|
|
|
+ <countTo
|
|
|
+ style="display: block"
|
|
|
+ :startVal="startVal"
|
|
|
+ :endVal="item.endVal"
|
|
|
+ :duration="3000"
|
|
|
+ ></countTo>
|
|
|
+ <p style="margin-top: 5px">{{ item.label }}</p>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -121,7 +127,7 @@
|
|
|
"
|
|
|
></el-tag>
|
|
|
</template> -->
|
|
|
- <template #operation="{ scope }">
|
|
|
+ <!-- <template #operation="{ scope }">
|
|
|
<el-tooltip
|
|
|
v-if="powers.some((item) => item == '020')"
|
|
|
effect="dark"
|
|
@@ -182,7 +188,7 @@
|
|
|
@click="statusConfirm(scope.row.id, scope.row.status)"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</ex-table>
|
|
|
<add-edit
|
|
|
:id="modelId"
|
|
@@ -210,10 +216,10 @@
|
|
|
import mixinPage from "@/mixins/elPaginationHandle";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
import ExTable from "@/components/ExTableNew.vue";
|
|
|
-import statusList from "@/assets/js/statusList";
|
|
|
+// import statusList from "@/assets/js/statusList";
|
|
|
// import asyncRequest from "@/apis/service/stock/stockWarning";
|
|
|
import asyncRequest from "@/mock/service/stock/survey";
|
|
|
-
|
|
|
+import countTo from "vue-count-to";
|
|
|
import addEdit from "./addEdit";
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
|
@@ -223,6 +229,7 @@ export default {
|
|
|
components: {
|
|
|
addEdit,
|
|
|
ExTable,
|
|
|
+ countTo,
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(["tablebtnSize", "searchSize", "size"]),
|
|
@@ -245,6 +252,7 @@ export default {
|
|
|
// { id: "0", label: "禁用" },
|
|
|
// { id: "1", label: "启用" },
|
|
|
// ],
|
|
|
+ startVal: 0, //动态效果显示卡片内的数字数量
|
|
|
statistics: [],
|
|
|
sitem: null,
|
|
|
// nowStock: 20, //当前库存
|
|
@@ -254,29 +262,33 @@ export default {
|
|
|
// roadStock: 10, //在途库存
|
|
|
stock: [],
|
|
|
stock_list: [
|
|
|
- //渲染表格用的
|
|
|
+ //渲染表格上方的卡片选项用的
|
|
|
{
|
|
|
id: "1",
|
|
|
icon: "el-icon-box",
|
|
|
label: "当前库存",
|
|
|
num: 0,
|
|
|
+ endVal: 0,
|
|
|
},
|
|
|
{
|
|
|
id: "2",
|
|
|
icon: "el-icon-download",
|
|
|
label: "待入库",
|
|
|
+ endVal: 0,
|
|
|
num: 0,
|
|
|
},
|
|
|
{
|
|
|
id: "3",
|
|
|
icon: "el-icon-upload2",
|
|
|
label: "待出库",
|
|
|
+ endVal: 0,
|
|
|
num: 0,
|
|
|
},
|
|
|
{
|
|
|
id: "4",
|
|
|
icon: "el-icon-shopping-cart-full",
|
|
|
label: "可用库存",
|
|
|
+ endVal: 0,
|
|
|
num: 0,
|
|
|
},
|
|
|
{
|
|
@@ -284,6 +296,7 @@ export default {
|
|
|
icon: "el-icon-truck",
|
|
|
label: "在途库存",
|
|
|
num: 0,
|
|
|
+ endVal: 0,
|
|
|
},
|
|
|
],
|
|
|
loading: true,
|
|
@@ -291,20 +304,20 @@ export default {
|
|
|
isDetail: false,
|
|
|
modelId: 0,
|
|
|
parmValue: {
|
|
|
- name: "", // 业务员名字
|
|
|
- username: "", // 账号
|
|
|
- status: "", //
|
|
|
- page: 1, // 页码
|
|
|
- size: 15, // 每页显示条数
|
|
|
+ //入参参数
|
|
|
+ // name: "", // 业务员名字
|
|
|
+ // username: "", // 账号
|
|
|
+ // status: "", //
|
|
|
+ // page: 1, // 页码
|
|
|
+ // size: 15, // 每页显示条数
|
|
|
},
|
|
|
- tableData: [],
|
|
|
+ tableData: [], //渲染表格数据
|
|
|
passwordModel: false,
|
|
|
passwordModelId: 0,
|
|
|
isPasswordDetail: false,
|
|
|
- // 表格 - 数据
|
|
|
- tableData: [],
|
|
|
- // 表格 - 参数
|
|
|
+ tableData: [], // 表格 - 数据
|
|
|
table: {
|
|
|
+ // 表格 - 参数
|
|
|
stripe: true,
|
|
|
border: true,
|
|
|
_defaultHeader_: ["setcol"],
|
|
@@ -315,170 +328,162 @@ export default {
|
|
|
curr: 1,
|
|
|
total: 0,
|
|
|
},
|
|
|
- // 表格 - 列参数
|
|
|
columns: [
|
|
|
+ // 表格 - 列参数
|
|
|
{
|
|
|
- prop: "nickname",
|
|
|
+ prop: "id",
|
|
|
label: "记录编号",
|
|
|
},
|
|
|
{
|
|
|
- prop: "role_name",
|
|
|
+ prop: "author",
|
|
|
label: "操作人",
|
|
|
},
|
|
|
{
|
|
|
- prop: "mobile",
|
|
|
+ prop: "reviewer",
|
|
|
label: "部门",
|
|
|
},
|
|
|
{
|
|
|
- prop: "email",
|
|
|
+ prop: "type",
|
|
|
label: "库存类型",
|
|
|
},
|
|
|
{
|
|
|
- prop: "status",
|
|
|
+ prop: "number",
|
|
|
label: "操作数量",
|
|
|
- _slot_: "status",
|
|
|
- width: "80px",
|
|
|
+ // _slot_: "status",
|
|
|
+ // width: "80px",
|
|
|
},
|
|
|
{
|
|
|
- prop: "addtime",
|
|
|
+ prop: "typeo",
|
|
|
label: "库存来源",
|
|
|
- sortable: true,
|
|
|
+ // sortable: true,
|
|
|
},
|
|
|
{
|
|
|
- prop: "addtime",
|
|
|
+ prop: "addTime",
|
|
|
label: "操作时间",
|
|
|
- sortable: true,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "",
|
|
|
- label: "操作",
|
|
|
- fixed: "right",
|
|
|
- _noset_: true,
|
|
|
- _slot_: "operation",
|
|
|
+ // sortable: true,
|
|
|
},
|
|
|
+ // {
|
|
|
+ // prop: "",
|
|
|
+ // label: "操作",
|
|
|
+ // fixed: "right",
|
|
|
+ // _noset_: true,
|
|
|
+ // _slot_: "operation",
|
|
|
+ // },
|
|
|
],
|
|
|
value: [],
|
|
|
- options: [
|
|
|
- {
|
|
|
- value: "",
|
|
|
- label: "A公司",
|
|
|
- children: [
|
|
|
- {
|
|
|
- value: "",
|
|
|
- label: "A公司仓库1",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "",
|
|
|
- label: "A公司仓库2",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- value: "",
|
|
|
- label: "B公司",
|
|
|
- children: [
|
|
|
- {
|
|
|
- value: "",
|
|
|
- label: "B公司仓库1",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "",
|
|
|
- label: "B公司仓库2",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- value: "",
|
|
|
- label: "C公司",
|
|
|
- children: [
|
|
|
- {
|
|
|
- value: "",
|
|
|
- label: "C公司仓库1",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "",
|
|
|
- label: "C公司仓库2",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
+ options: [], //用于渲染多级仓库的数据
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.searchList();
|
|
|
- this.stockList();
|
|
|
+ this.searchList(); //获取表格信息
|
|
|
+ this.stockList(); //获取卡片内库存数据信息
|
|
|
+ this.stockName(); //获取多级仓库列表信息
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
restSearch() {
|
|
|
- this.parmValue = {
|
|
|
- name: "", // 业务员名字
|
|
|
- username: "", // 账号
|
|
|
- status: "", //
|
|
|
- page: 1, // 页码
|
|
|
- size: 10, // 每页显示条数
|
|
|
- };
|
|
|
- this.searchList();
|
|
|
- // this.stock_list[0].num
|
|
|
+ //清空入参参数
|
|
|
+ // this.parmValue = {
|
|
|
+ // name: "", // 业务员名字
|
|
|
+ // username: "", // 账号
|
|
|
+ // status: "", //
|
|
|
+ // page: 1, // 页码
|
|
|
+ // size: 10, // 每页显示条数
|
|
|
+ // };
|
|
|
+ // this.searchList();
|
|
|
+ // // this.stock_list[0].num
|
|
|
},
|
|
|
|
|
|
openModal(id, isDetail, sitem) {
|
|
|
+ //打开弹窗
|
|
|
this.showModel = true;
|
|
|
this.modelId = id;
|
|
|
this.isDetail = isDetail;
|
|
|
this.sitem = sitem;
|
|
|
},
|
|
|
async deleteById(id, status) {
|
|
|
- await this.$confirm("确定要删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(async () => {
|
|
|
- const model = {
|
|
|
- id: id,
|
|
|
- status: status === "1" ? "0" : "1",
|
|
|
- };
|
|
|
- const res = await asyncRequest.status(model);
|
|
|
- if (res && res.code === 0) {
|
|
|
- this.$notify.success({
|
|
|
- title: "删除成功",
|
|
|
- message: "",
|
|
|
- });
|
|
|
- this.searchList();
|
|
|
- } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();
|
|
|
- } else {
|
|
|
- this.$message.warning(res.message);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- console.log("取消");
|
|
|
- });
|
|
|
+ //删除功能
|
|
|
+ // await this.$confirm("确定要删除?", {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // type: "warning",
|
|
|
+ // })
|
|
|
+ // .then(async () => {
|
|
|
+ // const model = {
|
|
|
+ // id: id,
|
|
|
+ // status: status === "1" ? "0" : "1",
|
|
|
+ // };
|
|
|
+ // const res = await asyncRequest.status(model);
|
|
|
+ // if (res && res.code === 0) {
|
|
|
+ // this.$notify.success({
|
|
|
+ // title: "删除成功",
|
|
|
+ // message: "",
|
|
|
+ // });
|
|
|
+ // this.searchList();
|
|
|
+ // } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ // await this.logout();
|
|
|
+ // } else {
|
|
|
+ // this.$message.warning(res.message);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // console.log("取消");
|
|
|
+ // });
|
|
|
},
|
|
|
async stockList() {
|
|
|
- console.log(this.stock_list);
|
|
|
+ //获取表格上方的卡片数据
|
|
|
+ // console.log(this.stock_list);
|
|
|
const res1 = await asyncRequest.statistics(this.parmValue);
|
|
|
- console.log(res1.data);
|
|
|
+ // console.log(res1.data);
|
|
|
const { value1, value2, value3, value4, value5 } = res1.data;
|
|
|
this.stock.push(value1, value2, value3, value4, value5);
|
|
|
- console.log(this.stock);
|
|
|
+ // this.endVal = value1;
|
|
|
+ // console.log(this.stock);
|
|
|
// console.log(this.stock_list[5].num);
|
|
|
- for (let i = 0; i <= this.stock_list.length; i++) {
|
|
|
- // = this.stock[i];
|
|
|
- console.log(this.stock_list[i].num);
|
|
|
+ for (let i = 0; i <= this.stock_list.length - 1; i++) {
|
|
|
+ // this.stock_list[i].num = this.stock[i];
|
|
|
+ this.stock_list[i].endVal = this.stock[i];
|
|
|
}
|
|
|
// console.log(this.stock_list);
|
|
|
},
|
|
|
+ async stockName() {
|
|
|
+ //获取多级仓库名称的方法
|
|
|
+ const res = await asyncRequest.listAll(this.parmValue);
|
|
|
+ // console.log(res.data);
|
|
|
+ // this.options = res.data;
|
|
|
+ // console.log(this.options);
|
|
|
+ let arr = res.data;
|
|
|
+ // console.log(arr);
|
|
|
+ arr.forEach((ele) => {
|
|
|
+ let item = {
|
|
|
+ value: ele.id,
|
|
|
+ label: ele.name,
|
|
|
+ children: [],
|
|
|
+ };
|
|
|
+ ele.child.forEach((elem) => {
|
|
|
+ let model = {
|
|
|
+ value: ele.id,
|
|
|
+ label: ele.name,
|
|
|
+ };
|
|
|
+ item.children.push(model);
|
|
|
+ });
|
|
|
+ this.options.push(item);
|
|
|
+ });
|
|
|
+ console.log(this.options);
|
|
|
+ // console.log(this.pageInfo.total);
|
|
|
+ },
|
|
|
async searchList() {
|
|
|
+ //获取表格数据
|
|
|
this.loading = true;
|
|
|
- const res = await asyncRequest.list(this.parmValue);
|
|
|
- // const res = await asyncRequest.log(this.parmValue);
|
|
|
- // console.log(res.data);
|
|
|
+ // const res = await asyncRequest.list(this.parmValue);
|
|
|
+ const res = await asyncRequest.log(this.parmValue);
|
|
|
+ // console.log(res);
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
- this.tableData = res.data;
|
|
|
- // console.log(this.tableData);
|
|
|
+ // this.tableData = res.data;
|
|
|
+ this.tableData = res.data.list;
|
|
|
this.pageInfo.total = Number(res.data.count);
|
|
|
+ // console.log(this.tableData);
|
|
|
+ // this.pageInfo.total = Number(res.data.count);
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
await this.logout();
|
|
|
} else {
|
|
@@ -489,35 +494,36 @@ export default {
|
|
|
},
|
|
|
|
|
|
async statusConfirm(id, status) {
|
|
|
- let str = status === "1" ? "禁用" : "启用";
|
|
|
- await this.$confirm("确定要改为" + str + "?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(async () => {
|
|
|
- this.loading = true;
|
|
|
- const model = {
|
|
|
- id: id,
|
|
|
- status: status === "1" ? "0" : "1",
|
|
|
- };
|
|
|
- const res = await asyncRequest.status(model);
|
|
|
- if (res && res.code === 0) {
|
|
|
- this.loading = false;
|
|
|
- this.$notify.success({
|
|
|
- title: "状态修改成功!",
|
|
|
- message: "",
|
|
|
- });
|
|
|
- await this.searchList();
|
|
|
- } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();
|
|
|
- } else {
|
|
|
- this.$message.warning(res.message);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- console.log("取消");
|
|
|
- });
|
|
|
+ //启用禁用状态
|
|
|
+ // let str = status === "1" ? "禁用" : "启用";
|
|
|
+ // await this.$confirm("确定要改为" + str + "?", {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // type: "warning",
|
|
|
+ // })
|
|
|
+ // .then(async () => {
|
|
|
+ // this.loading = true;
|
|
|
+ // const model = {
|
|
|
+ // id: id,
|
|
|
+ // status: status === "1" ? "0" : "1",
|
|
|
+ // };
|
|
|
+ // const res = await asyncRequest.status(model);
|
|
|
+ // if (res && res.code === 0) {
|
|
|
+ // this.loading = false;
|
|
|
+ // this.$notify.success({
|
|
|
+ // title: "状态修改成功!",
|
|
|
+ // message: "",
|
|
|
+ // });
|
|
|
+ // await this.searchList();
|
|
|
+ // } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ // await this.logout();
|
|
|
+ // } else {
|
|
|
+ // this.$message.warning(res.message);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // console.log("取消");
|
|
|
+ // });
|
|
|
},
|
|
|
},
|
|
|
};
|