| | |
| | | :data="form.items" ref="itemsCrudRef" |
| | | > |
| | | <template #unit="{row}"> |
| | | <el-select v-model="row.unit" :disabled="scope.disabled" placeholder="请选择计费单位"> |
| | | <el-select v-model="row.unit" :disabled="scope.disabled || !rowKeys.includes(row.rowKey)" placeholder="请选择计费单位"> |
| | | <el-option |
| | | v-for="dict in sys_unit" |
| | | :key="dict.value" |
| | |
| | | </el-select> |
| | | </template> |
| | | <template #price="{row}"> |
| | | <el-input v-model="row.price" :min="1" :disabled="scope.disabled" type="number" placeholder="请输入金额"></el-input> |
| | | <el-input v-model="row.price" :min="1" :disabled="scope.disabled || !rowKeys.includes(row.rowKey)" type="number" placeholder="请输入金额"></el-input> |
| | | </template> |
| | | <template #currency="{row}"> |
| | | <el-radio-group v-model="row.currency" :disabled="scope.disabled"> |
| | | <el-radio-group v-model="row.currency" :disabled="scope.disabled || !rowKeys.includes(row.rowKey)"> |
| | | <el-radio |
| | | v-for="dict in sys_currency" |
| | | :key="dict.value" |
| | |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | if (active) { |
| | | console.log(active) |
| | | Object.assign(form.value, { |
| | | projectId: active.id, |
| | | projectName: active.projectName, |
| | |
| | | }); |
| | | } |
| | | }, |
| | | type: 'table',suffixIcon:'search', |
| | | type: 'table',suffixIcon:'search',dataType: 'object', |
| | | children:{ |
| | | border: true, |
| | | searchMenuSpan: 5, |
| | |
| | | id = value[0] |
| | | } |
| | | getTmsProject(id).then(res=>{ |
| | | return callback(res.data||{}) |
| | | return callback(res.data ? [res.data] : []) |
| | | }) |
| | | }else{ |
| | | listTmsProject({pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{ |
| | |
| | | handleSelectionChangeFunc: (selection: any) => { |
| | | selectionList.value = selection; |
| | | }, |
| | | getBeginListFunc:()=>{ |
| | | getBeginListFunc:(params = {})=>{ |
| | | queryParams.value.planType = '0' |
| | | return params; |
| | | }, |
| | | handleBeforeOpenFunc:(type:string)=>{ |
| | | form.value.items = []; |
| | | if (type === 'add'){ |
| | | form.value.items = sys_quotation_items.value.map((item:any)=>{ |
| | | return { rowKey: randomId() ,freeName: item.label,unit: '次'} |
| | | return { rowKey: randomId() ,freeName: item.label,free: item.value,unit: '次'} |
| | | }) |
| | | } |
| | | }, |
| | | rowSaveBegin:(row:any,loading:any)=>{ |
| | | if (selectionList2.value.length == 0){ |
| | | proxy.$modal.msgError("请至少选择一条应收费用报价项"); |
| | | loading(); |
| | | throw new Error("请至少选择一条应收费用报价项"); |
| | | if (selectionList2.value.length > 0){ |
| | | let filter = selectionList2.value.filter((item:any)=>{ |
| | | return !item.price || !item.currency |
| | | }); |
| | | if (filter.length > 0){ |
| | | proxy.$modal.msgError("请填写所有必填项"); |
| | | loading(); |
| | | throw new Error("请填写所有必填项") |
| | | } |
| | | row.quoteItems = selectionList2.value; |
| | | |
| | | } |
| | | |
| | | |
| | | }, |
| | | rowUpdateBegin(row:any,loading:any){ |
| | | if (selectionList2.value.length > 0){ |
| | | let filter = selectionList2.value.filter((item:any)=>{ |
| | | return !item.price || !item.currency |
| | | }); |
| | | return !item.price || !item.currency |
| | | }); |
| | | if (filter.length > 0){ |
| | | proxy.$modal.msgError("请填写所有必填项"); |
| | | loading(); |
| | | throw new Error("请填写所有必填项") |
| | | } |
| | | row.quoteItems = selectionList2.value; |
| | | |
| | | }, |
| | | rowUpdateBegin(row:any,loading:any){ |
| | | if (selectionList2.value.length == 0){ |
| | | proxy.$modal.msgError("请至少选择一条应收费用报价项"); |
| | | loading(); |
| | | throw new Error("请至少选择一条应收费用报价项"); |
| | | |
| | | } |
| | | let filter = selectionList2.value.filter((item:any)=>{ |
| | | return !item.price || !item.currency |
| | | }); |
| | | if (filter.length > 0){ |
| | | proxy.$modal.msgError("请填写所有必填项"); |
| | | loading(); |
| | | throw new Error("请填写所有必填项") |
| | | } |
| | | row.quoteItems = selectionList2.value; |
| | | |
| | | }, |
| | | handleEndOpenFunc:(type:string,res:any)=>{ |
| | | if (type === 'edit'){ |
| | |
| | | }); |
| | | form.value.items = sys_quotation_items.value.map((item:any)=>{ |
| | | let find = selectionList2.value.find((ele:any)=> |
| | | ele.freeName === item.label |
| | | ele.free == item.value |
| | | ); |
| | | if ( find){ |
| | | return find; |
| | | }else{ |
| | | return { rowKey: randomId() ,freeName: item.label,unit: '次'} |
| | | return { rowKey: randomId() ,freeName: item.label,free: item.value,unit: '次'} |
| | | } |
| | | }) |
| | | nextTick( ()=>{ |
| | |
| | | const goToDetail = (row?:any) => { |
| | | router.push("/collectionTmsQuotePlan/collectionTmsQuotePlanItem?quotePlanType=0"ePlanId=" + row.id); |
| | | } |
| | | |
| | | const rowKeys = ref<any>([]); |
| | | const selectionChange2 = (selection?: any[]) => { |
| | | selectionList2.value = selection; |
| | | rowKeys.value = selection?.map((item:any)=>item.rowKey); |
| | | } |
| | | |
| | | |