|
@@ -0,0 +1,220 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <el-form ref="form" :model="form">
|
|
|
|
|
+ <ele-pro-table
|
|
|
|
|
+ ref="table"
|
|
|
|
|
+ :needPage="false"
|
|
|
|
|
+ :columns="columns"
|
|
|
|
|
+ :datasource="form.datasource"
|
|
|
|
|
+ class="time-form"
|
|
|
|
|
+ max-height="300"
|
|
|
|
|
+ :toolkit="[]"
|
|
|
|
|
+ >
|
|
|
|
|
+ <!-- 表头工具栏 -->
|
|
|
|
|
+ <template v-slot:toolbar>
|
|
|
|
|
+ <div class="headbox">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ class="ele-btn-icon"
|
|
|
|
|
+ @click="handlAdd"
|
|
|
|
|
+ v-if="type!='view'"
|
|
|
|
|
+ >
|
|
|
|
|
+ 新增
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="pricebox">
|
|
|
|
|
+ <span class="amount">总计:{{ allPrice }}元</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ </ele-pro-table>
|
|
|
|
|
+
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+</template>
|
|
|
|
|
+<script>
|
|
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
+ export default {
|
|
|
|
|
+ mixins: [dictMixins],
|
|
|
|
|
+ props: {
|
|
|
|
|
+ type:{
|
|
|
|
|
+ default:''
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ const defaultForm = {
|
|
|
|
|
+ measuringUnit: '立方'
|
|
|
|
|
+ };
|
|
|
|
|
+ return {
|
|
|
|
|
+ allPrice: 0,
|
|
|
|
|
+ defaultForm,
|
|
|
|
|
+ form: {
|
|
|
|
|
+ datasource: []
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ columns() {
|
|
|
|
|
+ return [
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 45,
|
|
|
|
|
+ type: 'index',
|
|
|
|
|
+ columnKey: 'index',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ fixed: 'left'
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'categoryLevelPathName',
|
|
|
|
|
+ label: '类型',
|
|
|
|
|
+ slot: 'categoryLevelPathName',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 200,
|
|
|
|
|
+ prop: 'totalCount',
|
|
|
|
|
+ label: '数量',
|
|
|
|
|
+ slot: 'totalCount',
|
|
|
|
|
+ headerSlot: 'headerTotalCount',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 160,
|
|
|
|
|
+ prop: 'sendTotelCount',
|
|
|
|
|
+ label: '发货数量',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ show:this.type=='view'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 160,
|
|
|
|
|
+ prop: 'returnTotelCount',
|
|
|
|
|
+ label: '退货数量',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ show:this.type=='view'
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // width: 200,
|
|
|
|
|
+ // prop: 'totalCount',
|
|
|
|
|
+ // label: '受托数量',
|
|
|
|
|
+ // slot: 'totalCount',
|
|
|
|
|
+ // headerSlot: 'headerTotalCount',
|
|
|
|
|
+ // align: 'center'
|
|
|
|
|
+ // },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 150,
|
|
|
|
|
+ prop: 'measuringUnit',
|
|
|
|
|
+ label: '单位',
|
|
|
|
|
+ slot: 'measuringUnit',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 200,
|
|
|
|
|
+ prop: 'singlePrice',
|
|
|
|
|
+ label: '单价',
|
|
|
|
|
+ slot: 'singlePrice',
|
|
|
|
|
+ headerSlot: 'headerSinglePrice',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 180,
|
|
|
|
|
+ prop: 'totalPrice',
|
|
|
|
|
+ label: '合计',
|
|
|
|
|
+ slot: 'totalPrice',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'action',
|
|
|
|
|
+ label: '操作',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ resizable: false,
|
|
|
|
|
+ slot: 'action',
|
|
|
|
|
+ fixed: 'right',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ }
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ // 返回列表数据
|
|
|
|
|
+ getTableValue() {
|
|
|
|
|
+ let comitDatasource = this.form.datasource;
|
|
|
|
|
+ if (comitDatasource.length === 0) return [];
|
|
|
|
|
+
|
|
|
|
|
+ return comitDatasource;
|
|
|
|
|
+ },
|
|
|
|
|
+ getPrice() {
|
|
|
|
|
+ return [this.allPrice, this.allPrice];
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ //修改回显
|
|
|
|
|
+ async putTableValue(productList) {
|
|
|
|
|
+ if (productList) {
|
|
|
|
|
+ this.form.datasource = productList;
|
|
|
|
|
+ this.$refs.table.reload();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+</script>
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
+ .headbox {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+
|
|
|
|
|
+ .amount {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ padding-right: 30px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .time-form .el-form-item {
|
|
|
|
|
+ margin-bottom: 0 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep .period {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+
|
|
|
|
|
+ .borderleftnone {
|
|
|
|
|
+ .el-input--medium .el-input__inner {
|
|
|
|
|
+ border-top-right-radius: 0;
|
|
|
|
|
+ border-bottom-right-radius: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .borderrightnone {
|
|
|
|
|
+ .el-input--medium .el-input__inner {
|
|
|
|
|
+ border-top-left-radius: 0;
|
|
|
|
|
+ border-bottom-left-radius: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep .time-form tbody > tr:hover > td {
|
|
|
|
|
+ background-color: transparent !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep .time-form .el-table tr {
|
|
|
|
|
+ background-color: #ffffff;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .pricebox {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|