优化问题

This commit is contained in:
duan 2024-06-27 17:55:33 +08:00
parent ad74689313
commit 939702e998
10 changed files with 97 additions and 25 deletions

View File

@ -4,8 +4,10 @@ ENV = 'development'
# VUE_APP_BASE_API = 'http://192.168.2.17:8000'
# VUE_APP_BASE_API = 'http://192.168.2.42:8000'
# VUE_APP_BASE_API = 'http://192.168.2.133:8000'
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
# 测试
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
# 生产
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
# VUE_APP_BASE_API = 'http://192.168.2.96:8000'
VUE_APP_WS_API = 'ws://192.168.2.128:8000'

View File

@ -2,8 +2,10 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
# 测试
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
# 生产
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
# 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'wss://123.56.110.252

View File

@ -241,6 +241,16 @@ export function stockStateChange(params) {
}
});
}
// 警戒设置
export function stockStatewarnLine(params) {
return request({
url: `/api/stock/warnLine`,
method: "put",
data: {
...params
}
});
}
// 共享库存
export function stockStateChanges(params) {
return request({

View File

@ -81,7 +81,6 @@ export default {
methods: {
async getTableData() {
this.tableData.loading = true
console.log(this.query.createdAt, '调试111')
let arr = []
if (this.query.createdAt.length) {
arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']

View File

@ -1,7 +1,7 @@
<template>
<el-dialog title="详情" width="80%" :visible.sync="dialogVisible" @close="dialogVisible = false">
<div class="head-container">
<span>{{ tableData.detail.type == 'reject' ? '退货出库' : '供应商入库' }}</span>
<span>{{ tableData.detail.subType == '-1' ? '退货出库' : '供应商入库' }}</span>
</div>
<div class="head-container">
<el-table :data="tableData.detail.stockSnap" v-loading="tableData.loading" height="400px">
@ -10,7 +10,7 @@
<el-table-column label="原库存" prop="stockNumber"></el-table-column>
<el-table-column label="变动数量" prop="number">
<template v-slot="scope">
{{ scope.row.number }} {{ scope.row.unitName }}
<span v-if="tableData.detail.subType==-1">-</span> {{ scope.row.number }} {{ scope.row.unitName }}
</template>
</el-table-column>
</el-table>

View File

@ -5,7 +5,7 @@
<div class="row">
<el-input v-model="query.name" size="small" clearable placeholder="商品名称"
@keyup.enter.native="getTableData" />
<el-input v-model="query.num" placeholder="库存数量少于多少xx" />
<!-- <el-input v-model="query.num" placeholder="库存数量少于多少xx" /> -->
<div style="width: 300px;">
<el-select v-model="query.isStock" placeholder="库存开关" style="width: 100%;">
<el-option label="开" :value="1"></el-option>
@ -14,6 +14,7 @@
</div>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
<el-button @click="Uppop()">库存预警:{{ warnLine }}</el-button>
</div>
<div class="row">
<el-button icon="el-icon-download" :loading="downloadLoading" @click="protHandle">导出库存</el-button>
@ -34,14 +35,14 @@
<el-table-column label="商品信息" width="200px">
<template v-slot="scope">
<div class="shop_info">
<el-image :src="scope.row.img" class="cover" v-if="scope.row.iskaiguans!=1">
<el-image :src="scope.row.img" class="cover" v-if="scope.row.iskaiguans != 1">
<div class="img_error" slot="error">
<i class="icon el-icon-document-delete"></i>
</div>
</el-image>
<div class="info">
<span>{{ scope.row.name }}</span>
<div v-if="scope.row.iskaiguans!=1">
<div v-if="scope.row.iskaiguans != 1">
<el-tag type="primary">{{ scope.row.type }}</el-tag>
</div>
</div>
@ -49,15 +50,17 @@
</template>
</el-table-column>
<el-table-column label="规格" prop="number">
<template v-slot="scope" >
<div v-if="scope.row.iskaiguans ">
<template v-slot="scope">
<div v-if="scope.row.iskaiguans">
{{ scope.row.specSnap }}
</div>
</template>
</el-table-column>
<el-table-column label="库存" prop="number">
<template v-slot="scope">
{{ `${scope.row.stockNumber} ${scope.row.unitName}` }}
<el-table-column label="库存" prop="number" >
<template v-slot="scope" >
<span :class="[scope.row.stockNumber<=warnLine?'colorStyle':'']">
{{ `${scope.row.stockNumber} ${scope.row.unitName}` }}
</span>
</template>
</el-table-column>
@ -97,11 +100,23 @@
<el-dialog title="导入库存" :visible.sync="dialogVisible">
<UploadExcel :beforeUpload="excelSuccessUpload" />
</el-dialog>
<!-- 预存弹窗组件 -->
<el-dialog title="" :visible.sync="dialogTableVisible" width="350px">
<el-form>
<el-form-item label="库存预存设置" label-width="120px">
<el-input v-model="montey" type="number" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogTableVisible = false; montey = ''"> </el-button>
<el-button type="primary" @click="sumbit()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { stock, stockdownload, stockdoImport, stockStateChange, stockStateChanges, stocks } from '@/api/invoicing'
import { stock, stockdownload, stockdoImport, stockStatewarnLine, stockStateChanges, stocks } from '@/api/invoicing'
import settings from '@/settings'
import invoicingDetail from './components/invoicingDetail'
import UploadExcel from '@/components/UploadExcel/'
@ -114,6 +129,8 @@ export default {
data() {
return {
dialogVisible: false,
dialogTableVisible: false,
montey: "",
query: {
name: '',
isStock: '',
@ -121,6 +138,7 @@ export default {
},
downloadLoading: false,
uploadLoading: false,
warnLine:null, // 线
tableData: {
page: 0,
size: 10,
@ -135,6 +153,27 @@ export default {
this.getTableData()
},
methods: {
Uppop() {
this.dialogTableVisible = true
},
async sumbit() {
try {
const res = await stockStatewarnLine({
shopId: localStorage.getItem("shopId"),
warnLine: this.montey
})
this.$message({ type: 'success', message: '修改成功!' });
setTimeout(() => {
this.dialogTableVisible = false
this.montey = ''
this.getTableData()
}, 500);
} catch (error) {
console.log(error);
}
},
async load(tree, treeNode, resolve) {
const res = await stocks({
productId: tree.proId,
@ -243,6 +282,7 @@ export default {
}
});
this.warnLine = res.warnLine
this.tableData.list = res.content
} catch (error) {
@ -299,6 +339,10 @@ export default {
gap: 10px;
}
}
.colorStyle{
color: rgb(231, 42, 42);
font-weight: 700;
}
</style>
<style>
.cell {

View File

@ -3,7 +3,7 @@
<div class="head-container">
<div class="filter_wrap">
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" @change="getTableData">
end-placeholder="结束日期" value-format="yyyy-MM-dd" @change="getTableData">
</el-date-picker>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
@ -81,12 +81,19 @@ export default {
methods: {
async getTableData() {
this.tableData.loading = true
let arr = []
console.log(this.query,'tiaoshi1')
if (this.query.createdAt.length) {
arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
} else {
arr = []
}
try {
const res = await tbProductStockOperateList({
page: this.tableData.page,
size: this.tableData.size,
shopId: localStorage.getItem('shopId'),
createdAt: this.query.createdAt
createdAt: arr
})
this.tableData.loading = false
this.tableData.list = res.content

View File

@ -207,7 +207,7 @@ export default {
this.tableData.list.forEach(ele => {
zong += ele.costPrice * ele.number
})
this.queryForm.totalAmount = zong
this.queryForm.totalAmount = parseFloat(zong.toFixed(2))
},
//
submitHandle() {

View File

@ -58,7 +58,7 @@
</el-button>
</el-popconfirm>
<router-link :to="{ name: 'purchase_detail', query: { purveyorId: scope.row.id } }">
<el-button type="text" size="mini">查看详情</el-button>
<el-button type="text" size="mini">结款记录</el-button>
</router-link>
</template>
</el-table-column>

View File

@ -65,7 +65,7 @@
</div>
</div>
</div>
<div class="head-container">
<!-- <div class="head-container">
<div class="select_count_wrap">
<div class="select_count">
<i class="icon el-icon-warning"></i>
@ -75,7 +75,7 @@
</div>
<el-button>批量付款</el-button>
</div>
</div>
</div> -->
<div class="head-container">
<el-table :data="tableData.list" v-loading="tableData.loading" @select="selectHandle"
@select-all="selectHandle">
@ -92,7 +92,7 @@
</el-table-column>
<el-table-column label="应付金额" prop="totalAmount">
<template v-slot="scope">
{{ scope.row.totalAmount }}
<span v-if="scope.row.type != 'purveyor'">-</span> {{ scope.row.totalAmount }}
</template>
</el-table-column>
<el-table-column label="已付款金额" prop="totalAmount">
@ -104,7 +104,7 @@
</el-table-column>
<el-table-column label="待付款金额" prop="waitAmount">
<template v-slot="scope">
<span class="num" >{{ scope.row.waitAmount }}</span>
<span class="num"><span v-if="scope.row.type != 'purveyor'">-</span> {{ scope.row.waitAmount }}</span>
</template>
</el-table-column>
<el-table-column label="状态" prop="status">
@ -114,6 +114,7 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="付款方式" prop="payType"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="付款时间" prop="updatedAt">
<template v-slot="scope">
@ -138,9 +139,12 @@
<el-form-item label="付款金额" label-width="80px">
<el-input v-model="montey" type="number" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="付款方式" label-width="80px">
<el-input v-model="payType" type="text" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogTableVisible = false"> </el-button>
<el-button @click="dialogTableVisible = false; montey = '';payType=''"> </el-button>
<el-button type="primary" @click="sumbit()"> </el-button>
</div>
</el-dialog>
@ -206,6 +210,7 @@ export default {
}
],
montey: null,
payType:null,
selectCount: 0,
query: {
type: '',
@ -237,11 +242,14 @@ export default {
const res = await paidAmount({
id: this.idinfo,
paidAmount: this.montey,
payType:this.payType
})
this.$message({ type: 'success', message: '付款成功!' });
setTimeout(() => {
this.dialogTableVisible = false
this.montey = ''
this.payType = ''
this.getTableData()
}, 1500);