耗材主副单位联动

This commit is contained in:
duan 2024-11-04 11:27:44 +08:00
parent da693c2fa2
commit 51f3a382c8
5 changed files with 106 additions and 70 deletions

View File

@ -6,20 +6,19 @@
</el-tabs> --> </el-tabs> -->
<div class="head-container"> <div class="head-container">
<el-form :model="query" inline label-position="left"> <el-form :model="query" inline label-position="left">
<el-radio-group v-model="timeValue" @change="timeChange"> <el-radio-group v-model="timeValue" @change="timeChange">
<el-radio-button label="">全部</el-radio-button> <el-radio-button label="">全部</el-radio-button>
<el-radio-button label="0">今天</el-radio-button> <el-radio-button label="0">今天</el-radio-button>
<el-radio-button label="-1">昨天</el-radio-button> <el-radio-button label="-1">昨天</el-radio-button>
<el-radio-button label="-7">最近7天</el-radio-button> <el-radio-button label="-7">最近7天</el-radio-button>
<el-radio-button label="-30">最近30天</el-radio-button> <el-radio-button label="-30">最近30天</el-radio-button>
<el-radio-button label="week">本周</el-radio-button> <el-radio-button label="week">本周</el-radio-button>
<el-radio-button label="month">本月</el-radio-button> <el-radio-button label="month">本月</el-radio-button>
<el-radio-button label="custom">自定义</el-radio-button> <el-radio-button label="custom">自定义</el-radio-button>
</el-radio-group> </el-radio-group>
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="" start-placeholder="开始日期" <el-date-picker v-model="query.createdAt" type="daterange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss">
> </el-date-picker>
</el-date-picker>
<el-form-item> <el-form-item>
<el-button type="primary" @click="getTableData">查询</el-button> <el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button> <el-button @click="resetHandle">重置</el-button>
@ -39,19 +38,17 @@
<div class="info"> <div class="info">
<div class="m"> <div class="m">
<template v-if="item.isAmount == 1"></template> <template v-if="item.isAmount == 1"></template>
{{ item.payAmount }} {{ item.payAmount }}
</div> </div>
<div class="t">{{ item.payType }}</div> <div class="t">{{ item.payType }}</div>
</div> </div>
</div> </div>
</div> </div>
</div> --> </div> -->
<div class="head-container"> <div class="head-container">
<el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 1"> <el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 1">
<el-table-column <el-table-column type="index" width="50">
type="index"
width="50">
</el-table-column> </el-table-column>
<!-- <el-table-column label="序号" prop="id"></el-table-column> --> <!-- <el-table-column label="序号" prop="id"></el-table-column> -->
<!-- <el-table-column label="区域id" prop="areaId"></el-table-column> --> <!-- <el-table-column label="区域id" prop="areaId"></el-table-column> -->
@ -96,7 +93,7 @@
</template> </template>
<script> <script>
import { summaryTable,summaryTableDownload } from '@/api/table' import { summaryTable, summaryTableDownload } from '@/api/table'
import dayjs from "dayjs"; import dayjs from "dayjs";
import { downloadFile } from "@/utils/index"; import { downloadFile } from "@/utils/index";
@ -135,14 +132,16 @@ export default {
}, },
methods: { methods: {
//table id //table id
toTableOrderList(data){ toTableOrderList(data) {
console.log(data) // console.log(data)
let date = [this.query.createdAt[0], this.query.createdAt[1]]
this.$router.push({ this.$router.push({
path:'/order_manage/order_list', path: '/order_manage/order_list',
query:{ query: {
tableName: data.tableName tableName: data.tableName,
date: date
} }
}) })
}, },
// Excel // Excel
async downloadHandle() { async downloadHandle() {
@ -180,10 +179,10 @@ export default {
this.tableData.loading = true; this.tableData.loading = true;
try { try {
const res = await summaryTable({ const res = await summaryTable({
page: this.tableData.page+1, page: this.tableData.page + 1,
size: this.tableData.size, size: this.tableData.size,
startTime:this.query.createdAt[0], startTime: this.query.createdAt[0],
endTime:this.query.createdAt[1] endTime: this.query.createdAt[1]
}); });
this.tableData.loading = false; this.tableData.loading = false;
this.tableData.data = res; this.tableData.data = res;
@ -271,12 +270,13 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.cursor-pointer{ .cursor-pointer {
cursor: pointer; cursor: pointer;
color: #1890ff; color: #1890ff;
transition: all 0.3s; transition: all 0.3s;
} }
.cursor-pointer:hover{
.cursor-pointer:hover {
opacity: .7; opacity: .7;
} }

View File

@ -487,8 +487,10 @@
<div class="unitStyle unitWidth"> <div class="unitStyle unitWidth">
<div>主单位</div> <div>主单位</div>
<div>{{ unitItem ? unitItem.conUnit : '' }}</div> <div>{{ unitItem ? unitItem.conUnit : '' }}</div>
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;" @click="switchzhufu = 1">
<!-- <div style="width: 9px;height: 9px;background-color: #D9D9D9;border-radius: 50%;margin:0 6px;"></div> --> <div style="width: 9px;height: 9px;border-radius: 50%;margin:0 6px;"
:style="{ background: switchzhufu == 1 ? 'green' : '#D9D9D9' }"></div>
<div>订货单位</div>
</div> </div>
</div> </div>
<div class="unitStyleBottom unitWidth" @click="switchs = 1" v-if="switchs == 2"> <div class="unitStyleBottom unitWidth" @click="switchs = 1" v-if="switchs == 2">
@ -496,14 +498,17 @@
</div> </div>
<div class="unitStyle unitWidth " style="margin-top: 20px;" v-else> <div class="unitStyle unitWidth " style="margin-top: 20px;" v-else>
<div>副单位</div> <div>副单位</div>
<div><input style="width: 70px;height: 28px;;border: 1px solid #dddfe6;" type="text" v-model="unitItem.conUnitTwo" @input="conUnitTwoinput"> </div> <div><input style="width: 70px;height: 28px;;border: 1px solid #dddfe6;" type="text"
v-model="unitItem.conUnitTwo" @input="conUnitTwoinput">
</div>
<div style="display: flex;align-items: center;justify-content: space-between;"> <div style="display: flex;align-items: center;justify-content: space-between;">
<!-- <div style="width: 9px;height: 9px;background-color: #D9D9D9;border-radius: 50%;margin:0 6px;"></div> --> <div style="width: 9px;height: 9px;border-radius: 50%;margin:0 6px;"
<!-- <div>订货单位</div> --> :style="{ background: switchzhufu == 2 ? 'green' : '#D9D9D9' }" @click="switchzhufu = 2"></div>
<div @click="switchzhufu = 2">订货单位</div>
<input type="text" disabled placeholder="1"> <input type="text" disabled placeholder="1">
<div>{{ unitItem.conUnitTwo }}=</div> <div>{{ unitItem.conUnitTwo }}=</div>
<input v-model="unitItem.conUnitTwoConvert" style="width: 80px;" type="number"> <input v-model="unitItem.conUnitTwoConvert" style="width: 80px;" type="number">
{{unitItem.conUnit }} {{ unitItem.conUnit }}
<span style="color: red;margin-left: 8px;cursor: pointer;" @click="deleteEvent">删除</span> <span style="color: red;margin-left: 8px;cursor: pointer;" @click="deleteEvent">删除</span>
</div> </div>
</div> </div>
@ -634,11 +639,13 @@ import { hasPermission } from '@/utils/limits.js'
export default { export default {
components: { AddConsTakin, UploadExcel, consRecordDetail }, components: { AddConsTakin, UploadExcel, consRecordDetail },
name:'information', name: 'information',
data() { data() {
return { return {
tongji: {},// tongji: {},//
dayjs, dayjs,
//
switchzhufu: "1",
query: { query: {
conTypeId: "", conTypeId: "",
conTypeName: "", conTypeName: "",
@ -815,7 +822,11 @@ export default {
}) })
}, },
async submitUnit() { async submitUnit() {
console.log(this.switchzhufu, '体哦啊是1')
const res = await unittbConsInfo([{ const res = await unittbConsInfo([{
defaultUnit: this.switchzhufu == 1 ? this.unitItem.conUnit : this.unitItem.conUnitTwo,
conUnitTwoConvert: this.unitItem.conUnitTwoConvert * 1, conUnitTwoConvert: this.unitItem.conUnitTwoConvert * 1,
conUnitTwo: this.unitItem.conUnitTwo, conUnitTwo: this.unitItem.conUnitTwo,
id: this.unitItem.id id: this.unitItem.id
@ -879,9 +890,9 @@ export default {
return 'red' return 'red'
} }
}, },
conUnitTwoinput(d){ conUnitTwoinput(d) {
// console.log(d.target.value,'1') // console.log(d.target.value,'1')
this.unitItem.conUnitTwo=d.target.value this.unitItem.conUnitTwo = d.target.value
}, },
// //
async showChange(e, row) { async showChange(e, row) {

View File

@ -43,6 +43,7 @@
<el-option :label="item.purveyorName" :value="item.id" v-for="item in purveyorList" <el-option :label="item.purveyorName" :value="item.id" v-for="item in purveyorList"
:key="item.id"></el-option> :key="item.id"></el-option>
</el-select> </el-select>
{{ queryForm.waitAmount }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -84,10 +85,6 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="欠款金额">
<el-input v-model="queryForm.waitAmount" disabled style="width: 220px;"></el-input>
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="queryForm.remark" placeholder="请输入备注" style="width: 220px;"></el-input> <el-input v-model="queryForm.remark" placeholder="请输入备注" style="width: 220px;"></el-input>
</el-form-item> </el-form-item>
@ -123,13 +120,14 @@
<template v-slot="scope"> <template v-slot="scope">
<el-input-number v-model="scope.row.price" :min="0" controls-position="right" <el-input-number v-model="scope.row.price" :min="0" controls-position="right"
@change="consCountTotal($event, scope.row, 'price')"></el-input-number> @change="consCountTotal($event, scope.row, 'price')"></el-input-number>
<div class="tips">原价{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div> <div class="tips" style="font-size: 16px;">原价{{ scope.row.costPrice }}/{{ scope.row.conUnit }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单位"> <el-table-column label="单位">
<template v-slot="scope"> <template v-slot="scope">
<el-select @change="consCountTotal($event, scope.row, 'unit')" v-model="scope.row.unit" <el-select @change="consCountTotal($event, scope.row, 'unit')" v-model="scope.row.unit"
:placeholder="scope.row.conUnit"> :placeholder="scope.row.defaultUnit ? scope.row.defaultUnit : scope.row.conUnit">
<el-option :label="scope.row.conUnit" :value="scope.row.conUnit"> </el-option> <el-option :label="scope.row.conUnit" :value="scope.row.conUnit"> </el-option>
<el-option :label="scope.row.conUnitTwo" :value="scope.row.conUnitTwo" <el-option :label="scope.row.conUnitTwo" :value="scope.row.conUnitTwo"
v-if="scope.row.conUnitTwo"> </el-option> v-if="scope.row.conUnitTwo"> </el-option>
@ -142,7 +140,16 @@
<el-input-number v-model="scope.row.stockNumber" :min="0" :step="1" step-strictly <el-input-number v-model="scope.row.stockNumber" :min="0" :step="1" step-strictly
controls-position="right" controls-position="right"
@change="consCountTotal($event, scope.row, 'stockNumber')"></el-input-number> @change="consCountTotal($event, scope.row, 'stockNumber')"></el-input-number>
<div class="tips">入库前{{ scope.row.number }}{{ scope.row.conUnit }} <div class="tips" style="font-size: 16px;">入库前
{{ !scope.row.unit ?
(scope.row.defaultUnit ?
scope.row.defaultUnit== scope.row.conUnitTwo?
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number:scope.row.number)
: scope.row.unit== scope.row.conUnitTwo?
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number}}
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
scope.row.conUnit) : scope.row.unit }}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -188,7 +195,8 @@
<el-input-number v-model="scope.row.number" :min="0" :step="1" step-strictly <el-input-number v-model="scope.row.number" :min="0" :step="1" step-strictly
controls-position="right" controls-position="right"
@change="modifyPrice($event, scope.row, 'number', 'totalAmount')"></el-input-number> @change="modifyPrice($event, scope.row, 'number', 'totalAmount')"></el-input-number>
<div class="tips">入库前{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div> <div class="tips" style="font-size: 16px;">入库前{{ scope.row.stockNumber }}{{ scope.row.unitName
}}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="小计"> <el-table-column label="小计">
@ -240,7 +248,7 @@ import { tbConsInfoGet, tbProductlist } from "@/api/invoicing";
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn, stockInOut } from '@/api/invoicing' import { tbShopPurveyorGet, tbProductStockOperateOutAndOn, stockInOut } from '@/api/invoicing'
import { formatDecimal } from '@/utils' import { formatDecimal } from '@/utils'
export default { export default {
name:'operation_in', name: 'operation_in',
components: { components: {
shopList, shopList,
ConsumableList ConsumableList
@ -380,7 +388,11 @@ export default {
}) })
} else { } else {
this.tableData.list.forEach(ele => { this.tableData.list.forEach(ele => {
zong += ele.price * ele.stockNumber let p = 1
if (ele.unit && ele.conUnitTwo == ele.unit) {
p = ele.conUnitTwoConvert
}
zong += ele.price * ele.stockNumber * p
}) })
} }
this.queryForm.totalAmount = formatDecimal(zong) this.queryForm.totalAmount = formatDecimal(zong)
@ -404,7 +416,6 @@ export default {
}, },
// //
tabChange(value, type) { tabChange(value, type) {
console.log(value, type)
this.shopTypesActive = type == 'in' ? 0 : 1 this.shopTypesActive = type == 'in' ? 0 : 1
this.inTabValue = value this.inTabValue = value
this.resetHandle() this.resetHandle()
@ -413,7 +424,7 @@ export default {
}, },
// //
changeTypeEnum(index) { changeTypeEnum(index) {
let filterd= this.purveyorList.filter(ele=>ele.id == index) let filterd = this.purveyorList.filter(ele => ele.id == index)
this.queryForm.waitAmount = filterd[0].waitAmount this.queryForm.waitAmount = filterd[0].waitAmount
this.inTabs.forEach((i) => { this.inTabs.forEach((i) => {
@ -445,7 +456,6 @@ export default {
}, 10) }, 10)
} else { } else {
row[key1] = cvalue row[key1] = cvalue
let zong = 0 let zong = 0
this.tableData.list.forEach(ele => { this.tableData.list.forEach(ele => {
let p = 1 let p = 1

View File

@ -43,6 +43,7 @@
<el-option :label="item.purveyorName" :value="item.id" v-for="item in purveyorList" <el-option :label="item.purveyorName" :value="item.id" v-for="item in purveyorList"
:key="item.id"></el-option> :key="item.id"></el-option>
</el-select> </el-select>
{{ queryForm.waitAmount }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -83,11 +84,6 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8">
<el-form-item label="欠款金额">
<el-input v-model="queryForm.waitAmount" disabled style="width: 220px;"></el-input>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="queryForm.remark" placeholder="请输入备注" style="width: 220px;"></el-input> <el-input v-model="queryForm.remark" placeholder="请输入备注" style="width: 220px;"></el-input>
@ -122,7 +118,7 @@
<template v-slot="scope"> <template v-slot="scope">
<el-input-number v-model="scope.row.price" :min="0" controls-position="right" <el-input-number v-model="scope.row.price" :min="0" controls-position="right"
@change="consCountTotal($event, scope.row, 'price')"></el-input-number> @change="consCountTotal($event, scope.row, 'price')"></el-input-number>
<div class="tips">原价{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div> <div class="tips" style="font-size: 16px;">原价{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单位"> <el-table-column label="单位">
@ -141,7 +137,21 @@
<el-input-number v-model="scope.row.stockNumber" :min="0" :step="1" step-strictly <el-input-number v-model="scope.row.stockNumber" :min="0" :step="1" step-strictly
controls-position="right" controls-position="right"
@change="consCountTotal($event, scope.row, 'stockNumber')"></el-input-number> @change="consCountTotal($event, scope.row, 'stockNumber')"></el-input-number>
<div class="tips">出库前{{ scope.row.number }}{{ scope.row.conUnit }}</div> <!-- <div class="tips" style="font-size: 16px;">出库前{{ scope.row.number }}{{ scope.row.conUnit }}</div> -->
<div class="tips" style="font-size: 16px;">出库前
{{ !scope.row.unit ?
(scope.row.defaultUnit ?
scope.row.defaultUnit== scope.row.conUnitTwo?
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number:scope.row.number)
: scope.row.unit== scope.row.conUnitTwo?
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number}}
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
scope.row.conUnit) : scope.row.unit }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="小计"> <el-table-column label="小计">
@ -184,7 +194,7 @@
<template v-slot="scope"> <template v-slot="scope">
<el-input-number v-model="scope.row.number" :min="0" controls-position="right" <el-input-number v-model="scope.row.number" :min="0" controls-position="right"
@change="modifyPrice($event, scope.row, 'number', 'totalAmount')"></el-input-number> @change="modifyPrice($event, scope.row, 'number', 'totalAmount')"></el-input-number>
<div class="tips">出库前{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div> <div class="tips" style="font-size: 16px;">出库前{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="小计"> <el-table-column label="小计">
@ -385,7 +395,11 @@ export default {
}) })
} else { } else {
this.tableData.list.forEach(ele => { this.tableData.list.forEach(ele => {
zong += ele.price * ele.stockNumber let p = 1
if (ele.unit && ele.conUnitTwo == ele.unit) {
p = ele.conUnitTwoConvert
}
zong += ele.price * ele.stockNumber * p
}) })
} }
this.queryForm.totalAmount = formatDecimal(zong) this.queryForm.totalAmount = formatDecimal(zong)

View File

@ -230,6 +230,7 @@ export default {
mounted() { mounted() {
if (this.$route.query.tableName) { if (this.$route.query.tableName) {
this.query.tableName = this.$route.query.tableName this.query.tableName = this.$route.query.tableName
this.query.createdAt = this.$route.query.date
} }
if (this.$route.query.orderNo) { if (this.$route.query.orderNo) {
this.query.orderNo = this.$route.query.orderNo this.query.orderNo = this.$route.query.orderNo