耗材主副单位联动
This commit is contained in:
parent
da693c2fa2
commit
51f3a382c8
|
|
@ -6,20 +6,19 @@
|
|||
</el-tabs> -->
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline label-position="left">
|
||||
<el-radio-group v-model="timeValue" @change="timeChange">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button label="0">今天</el-radio-button>
|
||||
<el-radio-button label="-1">昨天</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="week">本周</el-radio-button>
|
||||
<el-radio-button label="month">本月</el-radio-button>
|
||||
<el-radio-button label="custom">自定义</el-radio-button>
|
||||
</el-radio-group>
|
||||
<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"
|
||||
>
|
||||
</el-date-picker>
|
||||
<el-radio-group v-model="timeValue" @change="timeChange">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button label="0">今天</el-radio-button>
|
||||
<el-radio-button label="-1">昨天</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="week">本周</el-radio-button>
|
||||
<el-radio-button label="month">本月</el-radio-button>
|
||||
<el-radio-button label="custom">自定义</el-radio-button>
|
||||
</el-radio-group>
|
||||
<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">
|
||||
</el-date-picker>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
|
|
@ -39,19 +38,17 @@
|
|||
<div class="info">
|
||||
<div class="m">
|
||||
<template v-if="item.isAmount == 1">¥</template>
|
||||
{{ item.payAmount }}
|
||||
</div>
|
||||
<div class="t">{{ item.payType }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
{{ item.payAmount }}
|
||||
</div>
|
||||
<div class="t">{{ item.payType }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 1">
|
||||
|
||||
<el-table-column
|
||||
type="index"
|
||||
width="50">
|
||||
|
||||
<el-table-column type="index" width="50">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="序号" prop="id"></el-table-column> -->
|
||||
<!-- <el-table-column label="区域id" prop="areaId"></el-table-column> -->
|
||||
|
|
@ -67,7 +64,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单金额" prop="orderAmount"></el-table-column>
|
||||
|
||||
|
||||
</el-table>
|
||||
<!-- <el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 2">
|
||||
<el-table-column label="商品名称" prop="productName"></el-table-column>
|
||||
|
|
@ -96,7 +93,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { summaryTable,summaryTableDownload } from '@/api/table'
|
||||
import { summaryTable, summaryTableDownload } from '@/api/table'
|
||||
import dayjs from "dayjs";
|
||||
import { downloadFile } from "@/utils/index";
|
||||
|
||||
|
|
@ -135,14 +132,16 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
//携带table id跳转到订单列表页面
|
||||
toTableOrderList(data){
|
||||
console.log(data)
|
||||
toTableOrderList(data) {
|
||||
// console.log(data)
|
||||
let date = [this.query.createdAt[0], this.query.createdAt[1]]
|
||||
this.$router.push({
|
||||
path:'/order_manage/order_list',
|
||||
query:{
|
||||
tableName: data.tableName
|
||||
path: '/order_manage/order_list',
|
||||
query: {
|
||||
tableName: data.tableName,
|
||||
date: date
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 导出Excel
|
||||
async downloadHandle() {
|
||||
|
|
@ -180,10 +179,10 @@ export default {
|
|||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await summaryTable({
|
||||
page: this.tableData.page+1,
|
||||
size: this.tableData.size,
|
||||
startTime:this.query.createdAt[0],
|
||||
endTime:this.query.createdAt[1]
|
||||
page: this.tableData.page + 1,
|
||||
size: this.tableData.size,
|
||||
startTime: this.query.createdAt[0],
|
||||
endTime: this.query.createdAt[1]
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res;
|
||||
|
|
@ -271,12 +270,13 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.cursor-pointer{
|
||||
.cursor-pointer {
|
||||
cursor: pointer;
|
||||
color: #1890ff;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.cursor-pointer:hover{
|
||||
|
||||
.cursor-pointer:hover {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -487,8 +487,10 @@
|
|||
<div class="unitStyle unitWidth">
|
||||
<div>主单位</div>
|
||||
<div>{{ unitItem ? unitItem.conUnit : '' }}</div>
|
||||
<div style="display: flex;align-items: center;">
|
||||
<!-- <div style="width: 9px;height: 9px;background-color: #D9D9D9;border-radius: 50%;margin:0 6px;"></div> -->
|
||||
<div style="display: flex;align-items: center;" @click="switchzhufu = 1">
|
||||
<div style="width: 9px;height: 9px;border-radius: 50%;margin:0 6px;"
|
||||
:style="{ background: switchzhufu == 1 ? 'green' : '#D9D9D9' }"></div>
|
||||
<div>订货单位</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="unitStyleBottom unitWidth" @click="switchs = 1" v-if="switchs == 2">
|
||||
|
|
@ -496,14 +498,17 @@
|
|||
</div>
|
||||
<div class="unitStyle unitWidth " style="margin-top: 20px;" v-else>
|
||||
<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="width: 9px;height: 9px;background-color: #D9D9D9;border-radius: 50%;margin:0 6px;"></div> -->
|
||||
<!-- <div>订货单位</div> -->
|
||||
<div style="width: 9px;height: 9px;border-radius: 50%;margin:0 6px;"
|
||||
:style="{ background: switchzhufu == 2 ? 'green' : '#D9D9D9' }" @click="switchzhufu = 2"></div>
|
||||
<div @click="switchzhufu = 2">订货单位</div>
|
||||
<input type="text" disabled placeholder="1">
|
||||
<div>{{ unitItem.conUnitTwo }}=</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -634,11 +639,13 @@ import { hasPermission } from '@/utils/limits.js'
|
|||
|
||||
export default {
|
||||
components: { AddConsTakin, UploadExcel, consRecordDetail },
|
||||
name:'information',
|
||||
name: 'information',
|
||||
data() {
|
||||
return {
|
||||
tongji: {},//统计
|
||||
dayjs,
|
||||
// 切换主副单位
|
||||
switchzhufu: "1",
|
||||
query: {
|
||||
conTypeId: "",
|
||||
conTypeName: "",
|
||||
|
|
@ -815,7 +822,11 @@ export default {
|
|||
})
|
||||
},
|
||||
async submitUnit() {
|
||||
|
||||
console.log(this.switchzhufu, '体哦啊是1')
|
||||
|
||||
const res = await unittbConsInfo([{
|
||||
defaultUnit: this.switchzhufu == 1 ? this.unitItem.conUnit : this.unitItem.conUnitTwo,
|
||||
conUnitTwoConvert: this.unitItem.conUnitTwoConvert * 1,
|
||||
conUnitTwo: this.unitItem.conUnitTwo,
|
||||
id: this.unitItem.id
|
||||
|
|
@ -879,9 +890,9 @@ export default {
|
|||
return 'red'
|
||||
}
|
||||
},
|
||||
conUnitTwoinput(d){
|
||||
conUnitTwoinput(d) {
|
||||
// console.log(d.target.value,'调试1')
|
||||
this.unitItem.conUnitTwo=d.target.value
|
||||
this.unitItem.conUnitTwo = d.target.value
|
||||
},
|
||||
// 状态切换
|
||||
async showChange(e, row) {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
<el-option :label="item.purveyorName" :value="item.id" v-for="item in purveyorList"
|
||||
:key="item.id"></el-option>
|
||||
</el-select>
|
||||
{{ queryForm.waitAmount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
|
@ -84,10 +85,6 @@
|
|||
</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-form-item label="备注">
|
||||
<el-input v-model="queryForm.remark" placeholder="请输入备注" style="width: 220px;"></el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -123,13 +120,14 @@
|
|||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.price" :min="0" controls-position="right"
|
||||
@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>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位">
|
||||
<template v-slot="scope">
|
||||
<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.conUnitTwo" :value="scope.row.conUnitTwo"
|
||||
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
|
||||
controls-position="right"
|
||||
@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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -188,7 +195,8 @@
|
|||
<el-input-number v-model="scope.row.number" :min="0" :step="1" step-strictly
|
||||
controls-position="right"
|
||||
@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>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计">
|
||||
|
|
@ -240,7 +248,7 @@ import { tbConsInfoGet, tbProductlist } from "@/api/invoicing";
|
|||
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn, stockInOut } from '@/api/invoicing'
|
||||
import { formatDecimal } from '@/utils'
|
||||
export default {
|
||||
name:'operation_in',
|
||||
name: 'operation_in',
|
||||
components: {
|
||||
shopList,
|
||||
ConsumableList
|
||||
|
|
@ -380,7 +388,11 @@ export default {
|
|||
})
|
||||
} else {
|
||||
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)
|
||||
|
|
@ -404,7 +416,6 @@ export default {
|
|||
},
|
||||
// 切换入库内容
|
||||
tabChange(value, type) {
|
||||
console.log(value, type)
|
||||
this.shopTypesActive = type == 'in' ? 0 : 1
|
||||
this.inTabValue = value
|
||||
this.resetHandle()
|
||||
|
|
@ -413,7 +424,7 @@ export default {
|
|||
},
|
||||
// 切换类型
|
||||
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.inTabs.forEach((i) => {
|
||||
|
|
@ -445,7 +456,6 @@ export default {
|
|||
}, 10)
|
||||
} else {
|
||||
row[key1] = cvalue
|
||||
|
||||
let zong = 0
|
||||
this.tableData.list.forEach(ele => {
|
||||
let p = 1
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
<el-option :label="item.purveyorName" :value="item.id" v-for="item in purveyorList"
|
||||
:key="item.id"></el-option>
|
||||
</el-select>
|
||||
{{ queryForm.waitAmount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
|
@ -83,11 +84,6 @@
|
|||
</el-col>
|
||||
</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-form-item label="备注">
|
||||
<el-input v-model="queryForm.remark" placeholder="请输入备注" style="width: 220px;"></el-input>
|
||||
|
|
@ -122,7 +118,7 @@
|
|||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.price" :min="0" controls-position="right"
|
||||
@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>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位">
|
||||
|
|
@ -141,7 +137,21 @@
|
|||
<el-input-number v-model="scope.row.stockNumber" :min="0" :step="1" step-strictly
|
||||
controls-position="right"
|
||||
@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>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计">
|
||||
|
|
@ -184,7 +194,7 @@
|
|||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.number" :min="0" controls-position="right"
|
||||
@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>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计">
|
||||
|
|
@ -385,7 +395,11 @@ export default {
|
|||
})
|
||||
} else {
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -230,6 +230,7 @@ export default {
|
|||
mounted() {
|
||||
if (this.$route.query.tableName) {
|
||||
this.query.tableName = this.$route.query.tableName
|
||||
this.query.createdAt = this.$route.query.date
|
||||
}
|
||||
if (this.$route.query.orderNo) {
|
||||
this.query.orderNo = this.$route.query.orderNo
|
||||
|
|
|
|||
Loading…
Reference in New Issue