|
|
@@ -12,133 +12,57 @@
|
|
|
>
|
|
|
<el-card shadow="never">
|
|
|
<div>
|
|
|
- <el-form label-width="90px" :inline="true">
|
|
|
- <el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="客户名称"
|
|
|
+ <el-form label-width="90px" :inline="true" ref="form" :rules="rules" labelWidth="120px" :model="searchForm">
|
|
|
+ <el-form-item
|
|
|
+ label="客户名称"
|
|
|
+ prop="customerName"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="searchForm.customerName"
|
|
|
+ @click.native="handParent"
|
|
|
+ placeholder="请选择"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ :label="type == 2 ? '购买方名称' : '销售方名称'"
|
|
|
+ prop="initiatorId"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="searchForm.initiatorId"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="getEnterprise()"
|
|
|
>
|
|
|
- <el-select
|
|
|
- clearable
|
|
|
- v-model="customerName"
|
|
|
- placeholder="请选择"
|
|
|
- :filterable="true"
|
|
|
+ <el-option
|
|
|
+ v-for="item in enterprisePage"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
>
|
|
|
- <el-option
|
|
|
- label="1"
|
|
|
- value="1"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
- <el-form-item>
|
|
|
- <el-dropdown
|
|
|
- ref="dropdownref"
|
|
|
- trigger="click"
|
|
|
- :hide-on-click="false"
|
|
|
- v-model="dropdownVisible"
|
|
|
- @keydown.enter.native.stop="search"
|
|
|
+ <el-form-item
|
|
|
+ label="交易方式"
|
|
|
+ prop="transactionMode"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="searchForm.transactionMode"
|
|
|
+ placeholder="请选择"
|
|
|
+ disabled
|
|
|
>
|
|
|
- <div v-if="seekList.length > formLength">
|
|
|
- <span class="el-dropdown-link">
|
|
|
- 更多选项<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
- </span>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <div class="padding">
|
|
|
- <el-form label-position="left">
|
|
|
- <el-form-item
|
|
|
- v-for="(item, i) in deboListRow"
|
|
|
- :key="i"
|
|
|
- :inline="true"
|
|
|
- label-position="left"
|
|
|
- >
|
|
|
- <el-form-item
|
|
|
- :label-width="
|
|
|
- item.labelWidth ? item.labelWidth : '90' + 'px'
|
|
|
- "
|
|
|
- :inline="true"
|
|
|
- :label="item.label"
|
|
|
- >
|
|
|
- <div v-if="item.type == 'input'">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="defaultWhere[item.value]"
|
|
|
- :placeholder="item.placeholder || '请输入内容'"
|
|
|
- :style="{
|
|
|
- width: item.width ? item.width + 'px' : '220px'
|
|
|
- }"
|
|
|
- @keydown.enter.native="() => search()"
|
|
|
- @keyup.enter.native="() => search()"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div v-if="item.type == 'select'">
|
|
|
- <el-select
|
|
|
- clearable
|
|
|
- v-model="defaultWhere[item.value]"
|
|
|
- :multiple="item.multiple ? item.multiple : false"
|
|
|
- :filterable="item.filterable ? item.filterable : true"
|
|
|
- :placeholder="item.placeholder || '请输入内容'"
|
|
|
- :style="{
|
|
|
- width: item.width ? item.width + 'px' : '220px'
|
|
|
- }"
|
|
|
- @visible-change="change"
|
|
|
- @change="handerChange"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(op, i) in item.planList"
|
|
|
- :label="op.label"
|
|
|
- :value="op.value"
|
|
|
- :key="i"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div v-if="item.type == 'date'">
|
|
|
- <el-date-picker
|
|
|
- v-model="defaultWhere[item.value]"
|
|
|
- @blur="change"
|
|
|
- :type="item.dateType || 'daterange'"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- :style="{
|
|
|
- width: item.width ? item.width + 'px' : '220px'
|
|
|
- }"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- </div>
|
|
|
- <div v-if="item.type == 'DictSelection'">
|
|
|
- <DictSelection
|
|
|
- v-model="defaultWhere[item.value]"
|
|
|
- :placeholder="item.placeholder || '请选择内容'"
|
|
|
- :multiple="item.multiple ? item.multiple : false"
|
|
|
- :style="{
|
|
|
- width: item.width ? item.width + 'px' : '220px'
|
|
|
- }"
|
|
|
- :dictName="item.dictName"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div v-if="item.type == 'picker'">
|
|
|
- <el-date-picker
|
|
|
- v-model="defaultWhere[item.value]"
|
|
|
- @blur="change"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- :style="{
|
|
|
- width: item.width ? item.width + 'px' : '220px'
|
|
|
- }"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- </el-dropdown-menu>
|
|
|
- </div>
|
|
|
- </el-dropdown>
|
|
|
+ <el-option
|
|
|
+ v-for="item in transactionMethodsOp"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
<el-form-item>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@@ -148,9 +72,9 @@
|
|
|
>
|
|
|
查询
|
|
|
</el-button>
|
|
|
- <el-button @click="reset" icon="el-icon-refresh-left" type="primary"
|
|
|
+ <!-- <el-button @click="reset" icon="el-icon-refresh-left" type="primary"
|
|
|
>重置</el-button
|
|
|
- >
|
|
|
+ > -->
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
@@ -186,6 +110,8 @@
|
|
|
:account-info-dialog-flag.sync="accountInfoDialogFlag"
|
|
|
@getAccountInfo="getAccountInfo"
|
|
|
></accountInfoDialog>
|
|
|
+
|
|
|
+ <parentList ref="parentRef" @changeParent="changeParent"></parentList>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
@@ -195,10 +121,13 @@
|
|
|
import accountInfoDialog from './accountInfoDialog.vue';
|
|
|
import { shippingModeOp, transactionMethodsOp, paymentStatus, paymentType, invoiceStatusOp } from '@/enum/dict.js';
|
|
|
import { receiptPaymentPlanPage } from '@/api/financialManage/payAndCollectPlan';
|
|
|
+ import parentList from '@/views/saleManage/contact/components/parentList.vue';
|
|
|
+ import { enterprisePage } from '@/api/contractManage/contractBook';
|
|
|
export default {
|
|
|
mixins: [dictMixins, tabMixins],
|
|
|
components: {
|
|
|
- accountInfoDialog
|
|
|
+ accountInfoDialog,
|
|
|
+ parentList
|
|
|
},
|
|
|
props: {
|
|
|
form: {
|
|
|
@@ -529,10 +458,30 @@
|
|
|
// fixed: 'right'
|
|
|
// }
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ rules() {
|
|
|
+ return {
|
|
|
+ initiatorId: [
|
|
|
+ { required: true, message: '请选择', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ customerId: [
|
|
|
+ { required: true, message: '请选择', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ transactionMode: [
|
|
|
+ { required: true, message: '请选择', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ enterprisePage: [],
|
|
|
+ searchForm: {
|
|
|
+ initiatorId: '',
|
|
|
+ customerId: '',
|
|
|
+ customerName: '',
|
|
|
+ transactionMode: 1
|
|
|
+ },
|
|
|
currentIndex: null,
|
|
|
accountInfoDialogFlag: false,
|
|
|
currentRow: {},
|
|
|
@@ -547,8 +496,51 @@
|
|
|
},
|
|
|
created() {
|
|
|
this.requestDict('结算方式');
|
|
|
+ this.getEnterprisePage();
|
|
|
},
|
|
|
methods: {
|
|
|
+ handParent() {
|
|
|
+ let item = {
|
|
|
+ id: this.searchForm.customerId
|
|
|
+ };
|
|
|
+ this.$refs.parentRef.open(item);
|
|
|
+ },
|
|
|
+ search() {
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
+ if (!valid) return this.$message.warning('请选择查询条件');
|
|
|
+ this.reload(this.searchForm);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ reset() {
|
|
|
+ this.searchForm = {
|
|
|
+ initiatorId: '',
|
|
|
+ customerId: '',
|
|
|
+ customerName: '',
|
|
|
+ transactionMode: 1
|
|
|
+ };
|
|
|
+ this.reload(this.searchForm);
|
|
|
+ },
|
|
|
+ changeParent(item) {
|
|
|
+ this.searchForm.customerId = item.id;
|
|
|
+ },
|
|
|
+ getEnterprisePage() {
|
|
|
+ enterprisePage({
|
|
|
+ pageNum: 1,
|
|
|
+ size: 100
|
|
|
+ }).then((res) => {
|
|
|
+ this.enterprisePage = [];
|
|
|
+ this.enterprisePage.push(...res.list);
|
|
|
+ this.searchForm.initiatorId = this.enterprisePage[0].id;
|
|
|
+ this.reload(this.searchForm);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getEnterprise(val) {
|
|
|
+ let data = this.enterprisePage.find(
|
|
|
+ (item) => item.id == val
|
|
|
+ );
|
|
|
+ this.searchForm.customerName = data.name;
|
|
|
+ // this.searchForm.initiatorId = data.id;
|
|
|
+ },
|
|
|
init(item = {}, currentIndex = '') {
|
|
|
this.currentIndex = currentIndex;
|
|
|
// if (item.id) {
|
|
|
@@ -562,13 +554,11 @@
|
|
|
},
|
|
|
/* 表格数据源 */
|
|
|
datasource({ page, limit, where, order }) {
|
|
|
- if (this.contactData.id) {
|
|
|
- where['contactId'] = this.contactData.id;
|
|
|
- }
|
|
|
return receiptPaymentPlanPage({
|
|
|
pageNum: page,
|
|
|
size: limit,
|
|
|
...where,
|
|
|
+ invoiceStatus: '0,1',
|
|
|
// reviewStatus: 2,
|
|
|
sourceType: this.type
|
|
|
});
|
|
|
@@ -592,28 +582,28 @@
|
|
|
let invoiceStatus = this.selection.map((item) => item.invoiceStatus);
|
|
|
console.log(customerIds, initiatorIds);
|
|
|
let flag = false
|
|
|
- if(this.type == 2) {
|
|
|
- this.selection.forEach(item => {
|
|
|
- if(item.transactionMode == 2 && item.paymentStatus == 0) {
|
|
|
- console.log('selection', item);
|
|
|
- flag = true
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ // if(this.type == 2) {
|
|
|
+ // this.selection.forEach(item => {
|
|
|
+ // if(item.transactionMode == 2 && item.paymentStatus == 0) {
|
|
|
+ // console.log('selection', item);
|
|
|
+ // flag = true
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
|
|
|
console.log(customerIds, initiatorIds, flag);
|
|
|
- if(flag) {
|
|
|
- this.$message.warning('先款后票的计划需要付款后再开票!');
|
|
|
- return
|
|
|
- }
|
|
|
- if(invoiceStatus.includes(2)) {
|
|
|
- this.$message.warning('请选择未开票的计划!');
|
|
|
- return
|
|
|
- }
|
|
|
- if(this.selection.length == 0 || new Set(customerIds).size != 1 || new Set(initiatorIds).size != 1) {
|
|
|
- this.$message.warning('请选择相同客户和销售方的计划!');
|
|
|
- return
|
|
|
- }
|
|
|
+ // if(flag) {
|
|
|
+ // this.$message.warning('先款后票的计划需要付款后再开票!');
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if(invoiceStatus.includes(2)) {
|
|
|
+ // this.$message.warning('请选择未开票的计划!');
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if(this.selection.length == 0 || new Set(customerIds).size != 1 || new Set(initiatorIds).size != 1) {
|
|
|
+ // this.$message.warning('请选择相同客户和销售方的计划!');
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
this.$emit('getPlanData', this.selection)
|
|
|
this.handleClose()
|