正在显示
1 个修改的文件
包含
397 行增加
和
0 行删除
| 1 | +<template> | ||
| 2 | + <a-spin :spinning="confirmLoading"> | ||
| 3 | + <j-form-container :disabled="formDisabled"> | ||
| 4 | + <!-- 主表单区域 --> | ||
| 5 | + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | ||
| 6 | + <a-row> | ||
| 7 | + <!-- <a-col :span="6" > | ||
| 8 | + <a-form-model-item label="询价标书文件号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xjbswjh"> | ||
| 9 | + <a-input v-model="model.xjbswjh" disabled ></a-input> | ||
| 10 | + </a-form-model-item> | ||
| 11 | + </a-col> --> | ||
| 12 | + <a-col :span="6" > | ||
| 13 | + <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code"> | ||
| 14 | + <a-input v-model="model.tenderInfo.code" disabled></a-input> | ||
| 15 | + </a-form-model-item> | ||
| 16 | + </a-col> | ||
| 17 | + <a-col :span="6" > | ||
| 18 | + <a-form-model-item label="标段(包)名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenderName"> | ||
| 19 | + <a-input v-model="model.tenderInfo.tenderName" disabled></a-input> | ||
| 20 | + </a-form-model-item> | ||
| 21 | + </a-col> | ||
| 22 | + <a-col :span="6" > | ||
| 23 | + <a-form-model-item label="物料长描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="miaoshu"> | ||
| 24 | + <a-input v-model="model.tenderInfo.miaoshu" disabled></a-input> | ||
| 25 | + </a-form-model-item> | ||
| 26 | + </a-col> | ||
| 27 | + <a-col :span="6" > | ||
| 28 | + <a-form-model-item label="品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pinpai"> | ||
| 29 | + <a-input v-model="model.tenderInfo.pinpai" disabled></a-input> | ||
| 30 | + </a-form-model-item> | ||
| 31 | + </a-col> | ||
| 32 | + | ||
| 33 | + <a-col :span="6" > | ||
| 34 | + <a-form-model-item label="计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jldw"> | ||
| 35 | + <a-input v-model="model.tenderInfo.jldw" disabled></a-input> | ||
| 36 | + </a-form-model-item> | ||
| 37 | + </a-col> | ||
| 38 | + <a-col :span="6" > | ||
| 39 | + <a-form-model-item label="需求数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xqsl"> | ||
| 40 | + <a-input v-model="model.tenderInfo.xqsl" disabled></a-input> | ||
| 41 | + </a-form-model-item> | ||
| 42 | + </a-col> | ||
| 43 | + <a-col :span="6" > | ||
| 44 | + <a-form-model-item label="需求交货期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xqjhq"> | ||
| 45 | + <j-date v-model="model.tenderInfo.xqjhq" style="width: 100%" disabled/> | ||
| 46 | + </a-form-model-item> | ||
| 47 | + </a-col> | ||
| 48 | + <a-col :span="6" > | ||
| 49 | + <a-form-model-item label="需求单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xqdw"> | ||
| 50 | + <a-input v-model="model.tenderInfo.xqdw" disabled ></a-input> | ||
| 51 | + </a-form-model-item> | ||
| 52 | + </a-col> | ||
| 53 | + | ||
| 54 | + <a-col :span="6" > | ||
| 55 | + <a-form-model-item label="库存数据" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kcsj"> | ||
| 56 | + <a-input v-model="model.kcsj" disabled ></a-input> | ||
| 57 | + </a-form-model-item> | ||
| 58 | + </a-col> | ||
| 59 | + <a-col :span="6" > | ||
| 60 | + <a-form-model-item label="在途库存" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ztkf"> | ||
| 61 | + <a-input v-model="model.ztkf" disabled></a-input> | ||
| 62 | + </a-form-model-item> | ||
| 63 | + </a-col> | ||
| 64 | + <a-col :span="6" > | ||
| 65 | + <a-form-model-item label="最近中标单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zjzbdj"> | ||
| 66 | + <a-input v-model="model.zjzbdj" disabled></a-input> | ||
| 67 | + </a-form-model-item> | ||
| 68 | + </a-col> | ||
| 69 | + <a-col :span="6" > | ||
| 70 | + <a-form-model-item label="最后一次中标时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zhzbsj"> | ||
| 71 | + <a-input v-model="model.zhzbsj" disabled></a-input> | ||
| 72 | + </a-form-model-item> | ||
| 73 | + </a-col> | ||
| 74 | + | ||
| 75 | + <a-col :span="6" :offset="18"> | ||
| 76 | + <a-form-model-item label="投标参考价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tbjg"> | ||
| 77 | + <a-input-number v-model="model.tbjg" placeholder="投标参考价" style="width: 14vw" ></a-input-number> | ||
| 78 | + </a-form-model-item> | ||
| 79 | + </a-col> | ||
| 80 | + <!-- <a-col :span="6" > | ||
| 81 | + <a-form-model-item label="中标价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zbj"> | ||
| 82 | + <a-input v-model="model.zbj" placeholder="请输入中标价" ></a-input> | ||
| 83 | + </a-form-model-item> | ||
| 84 | + </a-col> | ||
| 85 | + <a-col :span="6" > | ||
| 86 | + <a-form-model-item label="单价差异" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="djchay"> | ||
| 87 | + <a-input v-model="model.djchay" placeholder="请输入单价差异" ></a-input> | ||
| 88 | + </a-form-model-item> | ||
| 89 | + </a-col> | ||
| 90 | + <a-col :span="6" > | ||
| 91 | + <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sl"> | ||
| 92 | + <a-input v-model="model.sl" placeholder="请输入数量" ></a-input> | ||
| 93 | + </a-form-model-item> | ||
| 94 | + </a-col> | ||
| 95 | + <a-col :span="6" > | ||
| 96 | + <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sj"> | ||
| 97 | + <a-input v-model="model.sj" placeholder="请输入时间" ></a-input> | ||
| 98 | + </a-form-model-item> | ||
| 99 | + </a-col> | ||
| 100 | + <a-col :span="6" > | ||
| 101 | + <a-form-model-item label="是否中标" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sfzb"> | ||
| 102 | + <a-input v-model="model.sfzb" placeholder="请输入是否中标" ></a-input> | ||
| 103 | + </a-form-model-item> | ||
| 104 | + </a-col> | ||
| 105 | + <a-col :span="6" > | ||
| 106 | + <a-form-model-item label="是否已采购完成" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sfcgwc"> | ||
| 107 | + <a-input v-model="model.sfcgwc" placeholder="请输入是否已采购完成" ></a-input> | ||
| 108 | + </a-form-model-item> | ||
| 109 | + </a-col> | ||
| 110 | + <a-col :span="6" > | ||
| 111 | + <a-form-model-item label="交货时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jhsj"> | ||
| 112 | + <a-input v-model="model.jhsj" placeholder="请输入交货时间" ></a-input> | ||
| 113 | + </a-form-model-item> | ||
| 114 | + </a-col> --> | ||
| 115 | + </a-row> | ||
| 116 | + </a-form-model> | ||
| 117 | + </j-form-container> | ||
| 118 | + <!-- 子表单区域 --> | ||
| 119 | + <!-- <a-tabs v-model="activeKey" @change="handleChangeTabs"> | ||
| 120 | + <a-tab-pane tab="询价明细表" :key="refKeys[0]" :forceRender="true"> | ||
| 121 | + <j-vxe-table | ||
| 122 | + keep-source | ||
| 123 | + :ref="refKeys[0]" | ||
| 124 | + :loading="tblTradeInquiryInfoTable.loading" | ||
| 125 | + :columns="tblTradeInquiryInfoTable.columns" | ||
| 126 | + :dataSource="tblTradeInquiryInfoTable.dataSource" | ||
| 127 | + :maxHeight="300" | ||
| 128 | + :disabled="formDisabled" | ||
| 129 | + :rowNumber="true" | ||
| 130 | + :rowSelection="true" | ||
| 131 | + :toolbar="true" | ||
| 132 | + /> | ||
| 133 | + </a-tab-pane> | ||
| 134 | + </a-tabs> --> | ||
| 135 | + <j-vxe-table | ||
| 136 | + keep-source | ||
| 137 | + :ref="refKeys[0]" | ||
| 138 | + :loading="tblTradeInquiryInfoTable.loading" | ||
| 139 | + :columns="tblTradeInquiryInfoTable.columns" | ||
| 140 | + :dataSource="tblTradeInquiryInfoTable.dataSource" | ||
| 141 | + :maxHeight="300" | ||
| 142 | + :disabled="formDisabled" | ||
| 143 | + :rowNumber="true" | ||
| 144 | + :rowSelection="false" | ||
| 145 | + :toolbar="false" | ||
| 146 | + /> | ||
| 147 | + </a-spin> | ||
| 148 | +</template> | ||
| 149 | + | ||
| 150 | +<script> | ||
| 151 | + | ||
| 152 | + import { getAction } from '@/api/manage' | ||
| 153 | + import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' | ||
| 154 | + import { JVXETypes } from '@/components/jeecg/JVxeTable' | ||
| 155 | + import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js' | ||
| 156 | + import { validateDuplicateValue } from '@/utils/util' | ||
| 157 | + import JFormContainer from '@/components/jeecg/JFormContainer' | ||
| 158 | + | ||
| 159 | + export default { | ||
| 160 | + name: 'TblTradeInquiryApprovalForm', | ||
| 161 | + mixins: [JVxeTableModelMixin], | ||
| 162 | + components: { | ||
| 163 | + JFormContainer | ||
| 164 | + }, | ||
| 165 | + data() { | ||
| 166 | + return { | ||
| 167 | + labelCol: { | ||
| 168 | + xs: { span: 24 }, | ||
| 169 | + sm: { span: 8 } | ||
| 170 | + }, | ||
| 171 | + wrapperCol: { | ||
| 172 | + xs: { span: 24 }, | ||
| 173 | + sm: { span: 14 } | ||
| 174 | + }, | ||
| 175 | + model: { | ||
| 176 | + tenderInfo: {} | ||
| 177 | + }, | ||
| 178 | + // 新增时子表默认添加几行空数据 | ||
| 179 | + addDefaultRowNum: 1, | ||
| 180 | + validatorRules: { | ||
| 181 | + tbjg: [{ required: true, message: '请输入数据!' }] | ||
| 182 | + }, | ||
| 183 | + refKeys: ['tblTradeInquiryInfo' ], | ||
| 184 | + tableKeys: ['tblTradeInquiryInfo' ], | ||
| 185 | + activeKey: 'tblTradeInquiryInfo', | ||
| 186 | + // 询价明细表 | ||
| 187 | + tblTradeInquiryInfoTable: { | ||
| 188 | + loading: false, | ||
| 189 | + dataSource: [], | ||
| 190 | + columns: [ | ||
| 191 | + { | ||
| 192 | + title: '供货商名称', | ||
| 193 | + key: 'ghsmc', | ||
| 194 | + type: JVXETypes.input, | ||
| 195 | + disabled: true, | ||
| 196 | + width: '200px', | ||
| 197 | + defaultValue: '' | ||
| 198 | + }, | ||
| 199 | + { | ||
| 200 | + title: '专票单价', | ||
| 201 | + key: 'zpdj', | ||
| 202 | + type: JVXETypes.input, | ||
| 203 | + disabled: true, | ||
| 204 | + width: '120px', | ||
| 205 | + defaultValue: '' | ||
| 206 | + }, | ||
| 207 | + { | ||
| 208 | + title: '专票税率(%)', | ||
| 209 | + key: 'zpsl', | ||
| 210 | + type: JVXETypes.input, | ||
| 211 | + disabled: true, | ||
| 212 | + width: '120px', | ||
| 213 | + defaultValue: '' | ||
| 214 | + }, | ||
| 215 | + { | ||
| 216 | + title: '普票单价', | ||
| 217 | + key: 'ppdj', | ||
| 218 | + type: JVXETypes.input, | ||
| 219 | + disabled: true, | ||
| 220 | + width: '120px', | ||
| 221 | + defaultValue: '' | ||
| 222 | + }, | ||
| 223 | + { | ||
| 224 | + title: '普票税率(%)', | ||
| 225 | + key: 'ppsl', | ||
| 226 | + type: JVXETypes.input, | ||
| 227 | + disabled: true, | ||
| 228 | + width: '120px', | ||
| 229 | + defaultValue: '' | ||
| 230 | + }, | ||
| 231 | + { | ||
| 232 | + title: '无票单价', | ||
| 233 | + key: 'wpdj', | ||
| 234 | + type: JVXETypes.input, | ||
| 235 | + disabled: true, | ||
| 236 | + width: '120px', | ||
| 237 | + defaultValue: '' | ||
| 238 | + }, | ||
| 239 | + { | ||
| 240 | + title: '是否含运费', | ||
| 241 | + key: 'sfhyf', | ||
| 242 | + type: JVXETypes.input, | ||
| 243 | + disabled: true, | ||
| 244 | + width: '120px', | ||
| 245 | + defaultValue: '' | ||
| 246 | + }, | ||
| 247 | + { | ||
| 248 | + title: '运费', | ||
| 249 | + key: 'yf', | ||
| 250 | + type: JVXETypes.input, | ||
| 251 | + disabled: true, | ||
| 252 | + width: '120px', | ||
| 253 | + defaultValue: '' | ||
| 254 | + }, | ||
| 255 | + { | ||
| 256 | + title: '发货地址', | ||
| 257 | + key: 'fhdz', | ||
| 258 | + type: JVXETypes.input, | ||
| 259 | + disabled: true, | ||
| 260 | + width: '200px', | ||
| 261 | + defaultValue: '' | ||
| 262 | + }, | ||
| 263 | + { | ||
| 264 | + title: '最小出货量', | ||
| 265 | + key: 'zxchl', | ||
| 266 | + type: JVXETypes.input, | ||
| 267 | + disabled: true, | ||
| 268 | + width: '120px', | ||
| 269 | + defaultValue: '' | ||
| 270 | + }, | ||
| 271 | + { | ||
| 272 | + title: 'L/T(交货周期天)', | ||
| 273 | + key: 'jhzqt', | ||
| 274 | + type: JVXETypes.input, | ||
| 275 | + disabled: true, | ||
| 276 | + width: '160px', | ||
| 277 | + defaultValue: '' | ||
| 278 | + }, | ||
| 279 | + { | ||
| 280 | + title: '价格评价', | ||
| 281 | + key: 'jgpj', | ||
| 282 | + type: JVXETypes.select, | ||
| 283 | + options: [{ value: '最佳', text: '最佳' }, { value: '优选', text: '优选' }, { value: '一般', text: '一般' }], | ||
| 284 | + width: '100px', | ||
| 285 | + validateRules: [{ required: true, message: '请选择${title}!' }], | ||
| 286 | + placeholder: '请选择${title}' | ||
| 287 | + }, | ||
| 288 | + { | ||
| 289 | + title: '是否需要重新询价', | ||
| 290 | + key: 'sfxycxxj', | ||
| 291 | + type: JVXETypes.select, | ||
| 292 | + options: [], | ||
| 293 | + dictCode: 'is_open', | ||
| 294 | + width: '200px', | ||
| 295 | + validateRules: [{ required: true, message: '请选择${title}!' }], | ||
| 296 | + placeholder: '请选择${title}' | ||
| 297 | + }, | ||
| 298 | + { | ||
| 299 | + title: '原因/备注', | ||
| 300 | + key: 'bz', | ||
| 301 | + type: JVXETypes.input, | ||
| 302 | + width: '200px', | ||
| 303 | + placeholder: '请输入${title}', | ||
| 304 | + defaultValue: '' | ||
| 305 | + } | ||
| 306 | + // { | ||
| 307 | + // title: '关联招标id', | ||
| 308 | + // key: 'tradeId', | ||
| 309 | + // type: JVXETypes.input, | ||
| 310 | + // width:"200px", | ||
| 311 | + // placeholder: '请输入${title}', | ||
| 312 | + // defaultValue:'', | ||
| 313 | + // }, | ||
| 314 | + ] | ||
| 315 | + }, | ||
| 316 | + url: { | ||
| 317 | + add: '/trade/tblTradeBidSub/add', | ||
| 318 | + edit: '/trade/tblTradeBidSub/inquiryApproval', | ||
| 319 | + queryById: '/trade/tblTradeBidSub/queryById', | ||
| 320 | + tblTradeInquiryInfo: { | ||
| 321 | + list: '/trade/tblTradeBidSub/queryTblTradeInquiryInfoByMainId' | ||
| 322 | + } | ||
| 323 | + } | ||
| 324 | + } | ||
| 325 | + }, | ||
| 326 | + props: { | ||
| 327 | + // 表单禁用 | ||
| 328 | + disabled: { | ||
| 329 | + type: Boolean, | ||
| 330 | + default: false, | ||
| 331 | + required: false | ||
| 332 | + } | ||
| 333 | + }, | ||
| 334 | + computed: { | ||
| 335 | + formDisabled() { | ||
| 336 | + return this.disabled | ||
| 337 | + } | ||
| 338 | + }, | ||
| 339 | + created () { | ||
| 340 | + | ||
| 341 | + }, | ||
| 342 | + methods: { | ||
| 343 | + // edit(record){ | ||
| 344 | + // console.log(record) | ||
| 345 | + // }, | ||
| 346 | + addBefore() { | ||
| 347 | + this.tblTradeInquiryInfoTable.dataSource = [] | ||
| 348 | + }, | ||
| 349 | + getAllTable() { | ||
| 350 | + let values = this.tableKeys.map(key => getRefPromise(this, key)) | ||
| 351 | + return Promise.all(values) | ||
| 352 | + }, | ||
| 353 | + /** 调用完edit()方法之后会自动调用此方法 */ | ||
| 354 | + editAfter() { | ||
| 355 | + this.$nextTick(() => { | ||
| 356 | + }) | ||
| 357 | + // 加载子表数据 | ||
| 358 | + if (this.model.id) { | ||
| 359 | + let params = { id: this.model.tradeId } | ||
| 360 | + this.requestSubTableData(this.url.tblTradeInquiryInfo.list, params, this.tblTradeInquiryInfoTable) | ||
| 361 | + } | ||
| 362 | + }, | ||
| 363 | + // 校验所有一对一子表表单 | ||
| 364 | + validateSubForm(allValues) { | ||
| 365 | + console.log(allValues) | ||
| 366 | + return new Promise((resolve, reject) => { | ||
| 367 | + Promise.all([ | ||
| 368 | + ]).then(() => { | ||
| 369 | + resolve(allValues) | ||
| 370 | + }).catch(e => { | ||
| 371 | + if (e.error === VALIDATE_FAILED) { | ||
| 372 | + // 如果有未通过表单验证的子表,就自动跳转到它所在的tab | ||
| 373 | + this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index] | ||
| 374 | + } else { | ||
| 375 | + console.error(e) | ||
| 376 | + } | ||
| 377 | + }) | ||
| 378 | + }) | ||
| 379 | + }, | ||
| 380 | + /** 整理成formData */ | ||
| 381 | + classifyIntoFormData(allValues) { | ||
| 382 | + let main = Object.assign(this.model, allValues.formValue) | ||
| 383 | + return { | ||
| 384 | + ...main, // 展开 | ||
| 385 | + tblTradeInquiryInfoList: allValues.tablesValue[0].tableData | ||
| 386 | + } | ||
| 387 | + }, | ||
| 388 | + validateError(msg) { | ||
| 389 | + this.$message.error(msg) | ||
| 390 | + } | ||
| 391 | + | ||
| 392 | + } | ||
| 393 | + } | ||
| 394 | +</script> | ||
| 395 | + | ||
| 396 | +<style scoped> | ||
| 397 | +</style> |
-
请 注册 或 登录 后发表评论