|
@@ -242,6 +242,7 @@ export default {
|
|
|
pay_rate: [
|
|
|
{
|
|
|
companyNo: '',
|
|
|
+ companyName: '',
|
|
|
rate: '',
|
|
|
isEdit: true
|
|
|
}
|
|
@@ -314,12 +315,14 @@ export default {
|
|
|
const platformResponse = await asyncRequest.detail({ id: this.sitem.id })
|
|
|
const { platform_name, platform_type, is_select_pay_rate, use_type, pay_list, pay_title } = platformResponse.data
|
|
|
|
|
|
- if (Array.isArray(pay_list) && pay_list.length > 0) {
|
|
|
- const { companyNo } = pay_list[0]
|
|
|
- const companyResponse = await asyncRequest.company({ companyNo })
|
|
|
- const company = companyResponse.data.list.find(({ companyNo: _companyNo }) => _companyNo === companyNo)
|
|
|
- pay_list[0].companyName = company.company
|
|
|
- }
|
|
|
+ // if (Array.isArray(pay_list) && pay_list.length > 0) {
|
|
|
+ // const { companyNoc } = pay_list[pay_list.length - 1]
|
|
|
+ // console.log(pay_list[pay_list.length - 1])
|
|
|
+
|
|
|
+ // const companyResponse = await asyncRequest.company({ companyNo })
|
|
|
+ // const company = companyResponse.data.list.find(({ companyNo: _companyNo }) => _companyNo === companyNo)
|
|
|
+ // pay_list[0].companyName = company ? company.company : ''
|
|
|
+ // }
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
@@ -329,10 +332,8 @@ export default {
|
|
|
platform_type: String(platform_type) ? String(platform_type) : '0',
|
|
|
use_type: String(use_type) ? String(use_type) : '1',
|
|
|
is_pay: String(is_select_pay_rate) ? String(is_select_pay_rate) : '',
|
|
|
- pay_rate: pay_list.length !== 0 ? pay_list : [{ companyNo: '', rate: '', isEdit: true }]
|
|
|
+ pay_rate: pay_list.length !== 0 ? [pay_list[pay_list.length - 1]] : [{ companyNo: '', rate: '', isEdit: true }]
|
|
|
}
|
|
|
-
|
|
|
- console.log(this.ruleForm)
|
|
|
},
|
|
|
handleEdit(index) {
|
|
|
const lineData = this.ruleForm.pay_rate[index]
|
|
@@ -381,7 +382,6 @@ export default {
|
|
|
|
|
|
if (model.pay_list && model.pay_list.length > 0) {
|
|
|
delete model.pay_list[0].isEdit
|
|
|
- delete model.pay_list[0].companyName
|
|
|
delete model.pay_list[0].is_cgd
|
|
|
delete model.pay_list[0].is_qrd
|
|
|
}
|
|
@@ -423,14 +423,20 @@ export default {
|
|
|
},
|
|
|
handleCompanyChange(e, index) {
|
|
|
const { code, label } = e
|
|
|
+
|
|
|
const companyInfo = {
|
|
|
companyNo: code,
|
|
|
companyName: label
|
|
|
}
|
|
|
+
|
|
|
+ console.log(companyInfo)
|
|
|
+
|
|
|
this.$set(this.ruleForm.pay_rate, index, {
|
|
|
...this.ruleForm.pay_rate[index],
|
|
|
...companyInfo
|
|
|
})
|
|
|
+
|
|
|
+ console.log(this.ruleForm)
|
|
|
},
|
|
|
handleRateChange(rate, index) {
|
|
|
this.$set(this.ruleForm.pay_rate, index, {
|