|
|
@@ -5,7 +5,7 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="来源类型" prop="sourceType">
|
|
|
<el-select
|
|
|
- :disabled="dialogType == 'view'|| !!saleOrderData?.id"
|
|
|
+ :disabled="dialogType == 'view' || !!saleOrderData?.id"
|
|
|
clearable
|
|
|
class="ele-block"
|
|
|
v-model="dataForm.sourceType"
|
|
|
@@ -39,7 +39,7 @@
|
|
|
v-if="dataForm.sourceType == 3"
|
|
|
>
|
|
|
<el-input
|
|
|
- :disabled="dialogType == 'view'|| !!saleOrderData?.id"
|
|
|
+ :disabled="dialogType == 'view' || !!saleOrderData?.id"
|
|
|
v-model="dataForm.orderNo"
|
|
|
@click.native="handleGetOrd"
|
|
|
></el-input>
|
|
|
@@ -155,11 +155,21 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="12" v-if="dialogType == 'view'">
|
|
|
+ <el-form-item prop="createUserName" label="对账人">
|
|
|
+ <el-input disabled v-model="dataForm.createUserName"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" v-if="dialogType == 'view'">
|
|
|
+ <el-form-item prop="createTime" label="对账时间">
|
|
|
+ <el-input disabled v-model="dataForm.createTime"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
<el-row v-if="dialogType == 'view'">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item prop="repliedFiles" label="回执附件">
|
|
|
-
|
|
|
+ <fileMain v-model="dataForm.repliedFiles" type="view"></fileMain>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -180,177 +190,180 @@
|
|
|
</el-form>
|
|
|
</template>
|
|
|
<script xmlns:el-col="http://www.w3.org/1999/html">
|
|
|
-import parentList from '@/views/saleManage/contact/components/parentList.vue';
|
|
|
-import OrderListDialog from '@/views/saleManage/saleOrder/accountstatement/components/orderListDialog.vue';
|
|
|
-import { getFile } from '@/api/system/file';
|
|
|
+ import parentList from '@/views/saleManage/contact/components/parentList.vue';
|
|
|
+ import OrderListDialog from '@/views/saleManage/saleOrder/accountstatement/components/orderListDialog.vue';
|
|
|
+ import { getFile } from '@/api/system/file';
|
|
|
|
|
|
-export default {
|
|
|
- name: 'saleForm',
|
|
|
- components: { OrderListDialog, parentList },
|
|
|
- //客户管理数据
|
|
|
- props: {
|
|
|
- dataForm: {
|
|
|
- type: Object,
|
|
|
- default: () => {
|
|
|
- return {};
|
|
|
- }
|
|
|
- },
|
|
|
- datasource: {
|
|
|
- type: Object,
|
|
|
- default: () => {
|
|
|
- return [];
|
|
|
- }
|
|
|
- },
|
|
|
- dialogType: '',
|
|
|
- contactData: {
|
|
|
- type: Object,
|
|
|
- default: () => {
|
|
|
- return {};
|
|
|
- }
|
|
|
- },
|
|
|
- saleOrderData: {
|
|
|
- type: Object,
|
|
|
- default: () => {
|
|
|
- return {};
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- monthByDays: {},
|
|
|
- quarterList: {
|
|
|
- 一季度: ['-01-01 00:00:00', '-03-31 23:59:59'],
|
|
|
- 二季度: ['-04-01 00:00:00', '-06-30 23:59:59'],
|
|
|
- 三季度: ['-07-01 00:00:00', '-09-30 23:59:59'],
|
|
|
- 四季度: ['-10-01 00:00:00', '-12-31 23:59:59']
|
|
|
+ export default {
|
|
|
+ name: 'saleForm',
|
|
|
+ components: { OrderListDialog, parentList },
|
|
|
+ //客户管理数据
|
|
|
+ props: {
|
|
|
+ dataForm: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
},
|
|
|
- startTime: '-01-01 00:00:00',
|
|
|
- endTime: '23:59:59',
|
|
|
- rules: {
|
|
|
- sourceType: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- contactId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- projectId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- orderId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- dateType: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- year: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- quarter: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- month: { required: true, message: '请选择', trigger: 'change' },
|
|
|
- dateTimeRange: { required: true, message: '请选择', trigger: 'change' }
|
|
|
- }
|
|
|
- };
|
|
|
- },
|
|
|
- methods: {
|
|
|
- //查询
|
|
|
- handleSearch() {
|
|
|
- //
|
|
|
- switch (this.dataForm.dateType) {
|
|
|
- case 1:
|
|
|
- this.dataForm.dateValue = this.dataForm.year;
|
|
|
- this.dataForm.startDate = this.dataForm.year + this.startTime;
|
|
|
- this.dataForm.endDate = this.dataForm.year + '-12-31 23:59:59';
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- this.dataForm.dateValue =
|
|
|
- this.dataForm.year + '年-' + this.dataForm.quarter;
|
|
|
- this.dataForm.startDate =
|
|
|
- this.dataForm.year + this.quarterList[this.dataForm.quarter][0];
|
|
|
- this.dataForm.endDate =
|
|
|
- this.dataForm.year + this.quarterList[this.dataForm.quarter][1];
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- this.dataForm.dateValue = this.dataForm.month;
|
|
|
- this.dataForm.startDate = this.dataForm.month + '-01 00:00:00';
|
|
|
- let data = this.dataForm.month.split('-');
|
|
|
- let days = new Date(data[0], data[1], 0).getDate();
|
|
|
- this.dataForm.endDate =
|
|
|
- this.dataForm.month + '-' + days + ' 23:59:59';
|
|
|
- break;
|
|
|
- default:
|
|
|
- this.dataForm.dateValue = '';
|
|
|
- this.dataForm.startDate =
|
|
|
- this.dataForm.dateTimeRange[0] + ' 00:00:00';
|
|
|
- this.dataForm.endDate = this.dataForm.dateTimeRange[1] + ' 23:59:59';
|
|
|
+ datasource: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dialogType: '',
|
|
|
+ contactData: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
+ },
|
|
|
+ saleOrderData: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
}
|
|
|
- this.$refs.form.validate((validate) => {
|
|
|
- if (!validate) return;
|
|
|
- this.$emit('handleSearch', this.dataForm);
|
|
|
- });
|
|
|
- },
|
|
|
- //
|
|
|
- getDays() {},
|
|
|
- //获取客户信息
|
|
|
- handleGetCus() {
|
|
|
- let item = { id: this.dataForm.contactId };
|
|
|
- this.$refs.parentRef.open(item);
|
|
|
- },
|
|
|
- //选择客户信息回调
|
|
|
- getCusInfo(obj) {
|
|
|
- let params = Object.assign({}, this.dataForm, {
|
|
|
- contactId: obj.id,
|
|
|
- contactName: obj.name,
|
|
|
- sourceName: obj.name,
|
|
|
- sourceId: obj.id
|
|
|
- });
|
|
|
- this.$emit('update:dataForm', params);
|
|
|
- this.reloadTableData();
|
|
|
- },
|
|
|
- //获取订单信息
|
|
|
- handleGetOrd() {
|
|
|
- let item = { id: this.dataForm.orderId };
|
|
|
- this.$refs.orderListDialogRef.open(item);
|
|
|
},
|
|
|
- //选择订单信息回调
|
|
|
- getOrderInfo(obj) {
|
|
|
- this.dataForm.sourceType=3
|
|
|
- let params = Object.assign({}, this.dataForm, {
|
|
|
- orderId: obj.id,
|
|
|
- orderNo: obj.orderNo,
|
|
|
- contactId: obj.partaId,
|
|
|
- contactName: obj.partaName,
|
|
|
- sourceName: obj.orderNo,
|
|
|
- sourceId: obj.id
|
|
|
- });
|
|
|
- this.$emit('update:dataForm', params);
|
|
|
- this.reloadTableData();
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ monthByDays: {},
|
|
|
+ quarterList: {
|
|
|
+ 一季度: ['-01-01 00:00:00', '-03-31 23:59:59'],
|
|
|
+ 二季度: ['-04-01 00:00:00', '-06-30 23:59:59'],
|
|
|
+ 三季度: ['-07-01 00:00:00', '-09-30 23:59:59'],
|
|
|
+ 四季度: ['-10-01 00:00:00', '-12-31 23:59:59']
|
|
|
+ },
|
|
|
+ startTime: '-01-01 00:00:00',
|
|
|
+ endTime: '23:59:59',
|
|
|
+ rules: {
|
|
|
+ sourceType: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ contactId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ projectId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ orderId: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ dateType: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ year: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ quarter: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ month: { required: true, message: '请选择', trigger: 'change' },
|
|
|
+ dateTimeRange: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
},
|
|
|
- //切换来源类型重置数据
|
|
|
- handleChange(val) {
|
|
|
- let params = Object.assign(
|
|
|
- {},
|
|
|
- {
|
|
|
- ...this.dataForm,
|
|
|
- orderNo: '',
|
|
|
- orderId: '',
|
|
|
- contactId: '',
|
|
|
- contactName: '',
|
|
|
- sourceName: '',
|
|
|
- sourceId: ''
|
|
|
+ methods: {
|
|
|
+ //查询
|
|
|
+ handleSearch() {
|
|
|
+ //
|
|
|
+ switch (this.dataForm.dateType) {
|
|
|
+ case 1:
|
|
|
+ this.dataForm.dateValue = this.dataForm.year;
|
|
|
+ this.dataForm.startDate = this.dataForm.year + this.startTime;
|
|
|
+ this.dataForm.endDate = this.dataForm.year + '-12-31 23:59:59';
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ this.dataForm.dateValue =
|
|
|
+ this.dataForm.year + '年-' + this.dataForm.quarter;
|
|
|
+ this.dataForm.startDate =
|
|
|
+ this.dataForm.year + this.quarterList[this.dataForm.quarter][0];
|
|
|
+ this.dataForm.endDate =
|
|
|
+ this.dataForm.year + this.quarterList[this.dataForm.quarter][1];
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ this.dataForm.dateValue = this.dataForm.month;
|
|
|
+ this.dataForm.startDate = this.dataForm.month + '-01 00:00:00';
|
|
|
+ let data = this.dataForm.month.split('-');
|
|
|
+ let days = new Date(data[0], data[1], 0).getDate();
|
|
|
+ this.dataForm.endDate =
|
|
|
+ this.dataForm.month + '-' + days + ' 23:59:59';
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ this.dataForm.dateValue = '';
|
|
|
+ this.dataForm.startDate =
|
|
|
+ this.dataForm.dateTimeRange[0] + ' 00:00:00';
|
|
|
+ this.dataForm.endDate =
|
|
|
+ this.dataForm.dateTimeRange[1] + ' 23:59:59';
|
|
|
}
|
|
|
- );
|
|
|
+ this.$refs.form.validate((validate) => {
|
|
|
+ if (!validate) return;
|
|
|
+ this.$emit('handleSearch', this.dataForm);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //
|
|
|
+ getDays() {},
|
|
|
+ //获取客户信息
|
|
|
+ handleGetCus() {
|
|
|
+ let item = { id: this.dataForm.contactId };
|
|
|
+ this.$refs.parentRef.open(item);
|
|
|
+ },
|
|
|
+ //选择客户信息回调
|
|
|
+ getCusInfo(obj) {
|
|
|
+ let params = Object.assign({}, this.dataForm, {
|
|
|
+ contactId: obj.id,
|
|
|
+ contactName: obj.name,
|
|
|
+ sourceName: obj.name,
|
|
|
+ sourceId: obj.id
|
|
|
+ });
|
|
|
+ this.$emit('update:dataForm', params);
|
|
|
+ this.reloadTableData();
|
|
|
+ },
|
|
|
+ //获取订单信息
|
|
|
+ handleGetOrd() {
|
|
|
+ let item = { id: this.dataForm.orderId };
|
|
|
+ this.$refs.orderListDialogRef.open(item);
|
|
|
+ },
|
|
|
+ //选择订单信息回调
|
|
|
+ getOrderInfo(obj) {
|
|
|
+ this.dataForm.sourceType = 3;
|
|
|
+ let params = Object.assign({}, this.dataForm, {
|
|
|
+ orderId: obj.id,
|
|
|
+ orderNo: obj.orderNo,
|
|
|
+ contactId: obj.partaId,
|
|
|
+ contactName: obj.partaName,
|
|
|
+ sourceName: obj.orderNo,
|
|
|
+ sourceId: obj.id
|
|
|
+ });
|
|
|
+ this.$emit('update:dataForm', params);
|
|
|
+ this.reloadTableData();
|
|
|
+ },
|
|
|
+ //切换来源类型重置数据
|
|
|
+ handleChange(val) {
|
|
|
+ let params = Object.assign(
|
|
|
+ {},
|
|
|
+ {
|
|
|
+ ...this.dataForm,
|
|
|
+ orderNo: '',
|
|
|
+ orderId: '',
|
|
|
+ contactId: '',
|
|
|
+ contactName: '',
|
|
|
+ sourceName: '',
|
|
|
+ sourceId: ''
|
|
|
+ }
|
|
|
+ );
|
|
|
|
|
|
- this.$emit('update:dataForm', params);
|
|
|
- this.reloadTableData();
|
|
|
- if (val == 1 && this.contactData.id) {
|
|
|
- this.getCusInfo(this.contactData);
|
|
|
+ this.$emit('update:dataForm', params);
|
|
|
+ this.reloadTableData();
|
|
|
+ if (val == 1 && this.contactData.id) {
|
|
|
+ this.getCusInfo(this.contactData);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ reloadTableData() {
|
|
|
+ this.$emit('update:datasource', []);
|
|
|
+ },
|
|
|
+ downloadFile(file) {
|
|
|
+ getFile({ objectName: file.storePath }, file.name);
|
|
|
}
|
|
|
},
|
|
|
- reloadTableData() {
|
|
|
- this.$emit('update:datasource', []);
|
|
|
- },
|
|
|
- downloadFile(file) {
|
|
|
- getFile({ objectName: file.storePath }, file.name);
|
|
|
+ mounted() {
|
|
|
+ // const year = new Date().getFullYear(); // 获取当前年份
|
|
|
+ // for (let i = 0; i < 12; i++) {
|
|
|
+ // // 获取指定月份的天数
|
|
|
+ // this.monthByDays[i + 1] = new Date(year, i + 1, 0).getDate()
|
|
|
+ // }
|
|
|
}
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- // const year = new Date().getFullYear(); // 获取当前年份
|
|
|
- // for (let i = 0; i < 12; i++) {
|
|
|
- // // 获取指定月份的天数
|
|
|
- // this.monthByDays[i + 1] = new Date(year, i + 1, 0).getDate()
|
|
|
- // }
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
-
|
|
|
-<style scoped lang="scss">
|
|
|
-</style>
|
|
|
+<style scoped lang="scss"></style>
|