|
|
@@ -5,11 +5,11 @@
|
|
|
<DkCollapse @on-change="changeCollapse" ref="collapse">
|
|
|
<DkPanel prop="essentialInformation">
|
|
|
<!-- 单据信息 -->
|
|
|
- <DkForm slot="content" ref="formInline" v-model="formData" style="width:100%">
|
|
|
+ <DkForm slot="content" ref="formInline" v-model="formData" :labelMaxWords="6" style="width:100%">
|
|
|
<!--客户电话-->
|
|
|
<DkFormItem prop="cusPhone" :required="true">
|
|
|
<SelectMagnifier v-model="formData.cusPhone" ref="cusPhone" :telephone="true"
|
|
|
- primary-key="cusId" :multiple="false"
|
|
|
+ primary-key="objectId" :multiple="false"
|
|
|
:type="this.$config.MagnifierType.customer"
|
|
|
@on-input-blur="selectCustomer"
|
|
|
@ok="selectCustomer"/>
|
|
|
@@ -41,6 +41,10 @@
|
|
|
<DatePickerPop v-model="formData.accDate"
|
|
|
:short-cut-flag="true"/>
|
|
|
</DkFormItem>
|
|
|
+ <!--合计收款金额-->
|
|
|
+ <DkFormItem prop="sumAmtRec">
|
|
|
+ <InputPop ref="sumAmtRec" v-model="formData.sumAmtRec" :disabled="true"/>
|
|
|
+ </DkFormItem>
|
|
|
</DkForm>
|
|
|
</DkPanel>
|
|
|
<!--客户收款-->
|
|
|
@@ -51,7 +55,7 @@
|
|
|
:height="this.tableHeight"
|
|
|
:new-row-flag="true"
|
|
|
:columns="this.type === this.$config.formMode.add ? addReceiptColumns: null"
|
|
|
- controlId="receiptMac"/>
|
|
|
+ controlId="macId" @on-choose="getTotals" @changeValue="getTotals"/>
|
|
|
</div>
|
|
|
</DkPanel>
|
|
|
</DkCollapse>
|
|
|
@@ -78,7 +82,7 @@ export default {
|
|
|
formData: {
|
|
|
accDate: new Date(),
|
|
|
rpType: null,
|
|
|
- cusId: null,//客户Id
|
|
|
+ objectId: null,//客户Id
|
|
|
cusName: null,
|
|
|
cusPhone: null,
|
|
|
addressFull: null, // 详细地址
|
|
|
@@ -88,13 +92,15 @@ export default {
|
|
|
orgId: null,
|
|
|
orgName: null,
|
|
|
orgCode: null,
|
|
|
+ sumAmtRec: null,
|
|
|
makeStaff: self.$store.state.user.id,
|
|
|
+ cpId: self.$store.state.user.cpId,
|
|
|
itemList: [],
|
|
|
},
|
|
|
addReceiptColumns: [
|
|
|
{
|
|
|
field: 'macName',
|
|
|
- controlId: 'receiptMac',
|
|
|
+ controlId: 'macId',
|
|
|
type: 'tableSelect',
|
|
|
width: 200,
|
|
|
dataType: self.$config.tableSelectType.moneyAccount,
|
|
|
@@ -110,7 +116,7 @@ export default {
|
|
|
// },
|
|
|
//收款金额
|
|
|
{
|
|
|
- field: 'receiptAmt',
|
|
|
+ field: 'amtRec',
|
|
|
type: 'number',
|
|
|
digits: 2,
|
|
|
sum: true,
|
|
|
@@ -137,7 +143,7 @@ export default {
|
|
|
*/
|
|
|
selectCustomer(val) {
|
|
|
if (val && val.length > 0) {
|
|
|
- this.formData.cusId = val[0].cusId
|
|
|
+ this.formData.objectId = val[0].cusId
|
|
|
this.formData.cusPhone = val[0].cusPhone
|
|
|
this.formData.cusName = val[0].cusName
|
|
|
this.formData.orgId = val[0].orgId
|
|
|
@@ -148,6 +154,23 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
+ * @desc : 计算合计
|
|
|
+ * @date : 2022/5/30 15:31
|
|
|
+ * @author : 付斌
|
|
|
+ */
|
|
|
+ getTotals(field, row, rowIndex) {
|
|
|
+ let table = this.$refs['receiptTable'].getTableDataFilter();
|
|
|
+ let sumAmtRec = 0; // 合计数量
|
|
|
+ if (table && table.length > 0) {
|
|
|
+ table.forEach(row => {
|
|
|
+ if (row["amtRec"]) {
|
|
|
+ sumAmtRec += parseFloat(row["amtRec"]);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.formData.sumAmtRec = sumAmtRec;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
* @desc : 通过id查询
|
|
|
* @author : 付斌
|
|
|
* @date : 2022/03/04 13:17
|
|
|
@@ -177,8 +200,8 @@ export default {
|
|
|
return false;
|
|
|
}
|
|
|
for (let it of itemTable) {
|
|
|
- if (!it.receiptAmt || it.receiptAmt === '') {
|
|
|
- this.$Message.warning(this.$t('W_042', {'param': '明细数量不能'}))
|
|
|
+ if (!it.amtRec || it.amtRec === '') {
|
|
|
+ this.$Message.warning(this.$t('W_042', {'param': '收款金额不能'}))
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
@@ -199,8 +222,9 @@ export default {
|
|
|
// 修改新增的表数据
|
|
|
let itemTable = this.$refs['receiptTable'].getTableDataFilter();
|
|
|
this.formData.itemList = itemTable
|
|
|
+ this.params = {...this.formData}
|
|
|
// itemTable.forEach((it, index) => {
|
|
|
- // this.$set(it, 'residueAmt', it["receiptAmt"]);
|
|
|
+ // this.$set(it, 'residueAmt', it["amtRec"]);
|
|
|
// Object.assign(it, it, this.formData)
|
|
|
// });
|
|
|
// this.params = {"itemList": itemTable}
|
|
|
@@ -227,7 +251,7 @@ export default {
|
|
|
this.formData = {
|
|
|
accDate: new Date(),
|
|
|
rpType: null,
|
|
|
- cusId: null,//客户Id
|
|
|
+ objectId: null,//客户Id
|
|
|
cusName: null,
|
|
|
cusPhone: null,
|
|
|
addressFull: null, // 详细地址
|