耗材主副单位联动
This commit is contained in:
parent
da693c2fa2
commit
51f3a382c8
|
|
@ -17,8 +17,7 @@
|
||||||
<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>
|
||||||
|
|
@ -49,9 +48,7 @@
|
||||||
<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> -->
|
||||||
|
|
@ -136,11 +133,13 @@ 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
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -276,6 +275,7 @@ export default {
|
||||||
color: #1890ff;
|
color: #1890ff;
|
||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cursor-pointer:hover {
|
.cursor-pointer:hover {
|
||||||
opacity: .7;
|
opacity: .7;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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,10 +498,13 @@
|
||||||
</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">
|
||||||
|
|
@ -639,6 +644,8 @@ export default {
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -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="小计">
|
||||||
|
|
@ -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()
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue