Commit dda9b7c53724a8265cc5ca885c5aca7979791097

Authored by 史婷婷
2 parents 07d91938 ad7f3472

Merge remote-tracking branch 'origin/cjerp-1.0_20260116' into publish_cjerp

@@ -216,7 +216,10 @@ export default { @@ -216,7 +216,10 @@ export default {
216 const m = res.data || {} 216 const m = res.data || {}
217 const next = { ...this.form, ...m } 217 const next = { ...this.form, ...m }
218 next.id = m.id || m.code || id 218 next.id = m.id || m.code || id
219 - next.purchaseOrderLineList = Array.isArray(m.purchaseOrderLineList) ? m.purchaseOrderLineList.map(x => ({ ...x })) : [] 219 + next.purchaseOrderLineList = Array.isArray(m.purchaseOrderLineList) ? m.purchaseOrderLineList.map(x => ({
  220 + ...x,
  221 + assessmentExceedsAgreement: Number(x.assessmentExceedsAgreement || 0).toFixed(2) || 0.00,
  222 + })) : []
220 this.form = next; 223 this.form = next;
221 this.initPurchaseOrderLineList = next.purchaseOrderLineList || []; 224 this.initPurchaseOrderLineList = next.purchaseOrderLineList || [];
222 this.refreshStandardName() 225 this.refreshStandardName()
@@ -212,7 +212,10 @@ export default { @@ -212,7 +212,10 @@ export default {
212 const next = { ...this.form, ...m } 212 const next = { ...this.form, ...m }
213 next.id = m.id || m.code || id; 213 next.id = m.id || m.code || id;
214 next.purchaseOrderId = m.orderId || ''; 214 next.purchaseOrderId = m.orderId || '';
215 - next.purchaseOrderLineList = Array.isArray(m.afterChangeSpecList) ? m.afterChangeSpecList.map(x => ({ ...x })) : [] 215 + next.purchaseOrderLineList = Array.isArray(m.afterChangeSpecList) ? m.afterChangeSpecList.map(x => ({
  216 + ...x,
  217 + assessmentExceedsAgreement: Number(x.assessmentExceedsAgreement || 0).toFixed(2) || 0.00,
  218 + })) : []
216 this.form = next; 219 this.form = next;
217 this.initPurchaseOrderLineList = next.purchaseOrderLineList || []; 220 this.initPurchaseOrderLineList = next.purchaseOrderLineList || [];
218 this.refreshStandardName() 221 this.refreshStandardName()
@@ -148,8 +148,9 @@ @@ -148,8 +148,9 @@
148 </uni-list-item> 148 </uni-list-item>
149 <uni-list-item title="考核超协"> 149 <uni-list-item title="考核超协">
150 <template v-slot:footer> 150 <template v-slot:footer>
151 - <uni-easyinput v-model="item.assessmentExceedsAgreement" placeholder="请输入考核超协"  
152 - :inputBorder="false" /> 151 + <uni-easyinput type="digit" v-model="item.assessmentExceedsAgreement"
  152 + placeholder="请输入考核超协" :inputBorder="false"
  153 + @input="onAssessmentInput($event, idx)" @blur="onAssessmentBlur($event, idx)" />
153 </template> 154 </template>
154 </uni-list-item> 155 </uni-list-item>
155 </view> 156 </view>
@@ -330,6 +331,49 @@ export default { @@ -330,6 +331,49 @@ export default {
330 } 331 }
331 }) 332 })
332 }, 333 },
  334 + onAssessmentInput(val, idx) {
  335 + const it = this.items[idx]
  336 + if (!it) return
  337 + // 允许负号、数字、小数点
  338 + let v = String(val).replace(/[^0-9.-]/g, '')
  339 + // 处理多个小数点
  340 + const parts = v.split('.')
  341 + if (parts.length > 2) {
  342 + v = parts[0] + '.' + parts.slice(1).join('')
  343 + }
  344 + // 处理多个负号(仅允许出现在开头)
  345 + if (v.indexOf('-') > 0) {
  346 + v = v.replace(/-/g, '')
  347 + }
  348 + if (v.startsWith('-') && (v.match(/-/g) || []).length > 1) {
  349 + v = '-' + v.replace(/-/g, '')
  350 + }
  351 + // 限制两位小数
  352 + if (v.includes('.')) {
  353 + const [int, dec] = v.split('.')
  354 + v = int + '.' + dec.slice(0, 2)
  355 + }
  356 + this.$set(this.items[idx], 'assessmentExceedsAgreement', v)
  357 + this.emitChange()
  358 + },
  359 + onAssessmentBlur(val, idx) {
  360 + const it = this.items[idx]
  361 + if (!it) return
  362 + let v = it.assessmentExceedsAgreement
  363 + if (!v || v === '-') {
  364 + v = ''
  365 + } else {
  366 + // 尝试转数字并保留两位小数
  367 + const n = parseFloat(v)
  368 + if (!isNaN(n)) {
  369 + v = n.toFixed(2)
  370 + } else {
  371 + v = ''
  372 + }
  373 + }
  374 + this.$set(this.items[idx], 'assessmentExceedsAgreement', v)
  375 + this.emitChange()
  376 + },
333 toggleItem(idx) { 377 toggleItem(idx) {
334 const it = this.items[idx] 378 const it = this.items[idx]
335 if (!it) return 379 if (!it) return
@@ -5,12 +5,14 @@ @@ -5,12 +5,14 @@
5 <view class="section"> 5 <view class="section">
6 <text class="row company">{{ form.customerName }}</text> 6 <text class="row company">{{ form.customerName }}</text>
7 <view :class="['status', `status_${form.status}`]" /> 7 <view :class="['status', `status_${form.status}`]" />
8 - <view class="row"><text class="label">发货日期</text><text class="value">{{ form.shipmentsDate }}</text></view> 8 + <view class="row"><text class="label">原发货日期</text><text class="value">{{ form.shipmentsDate }}</text></view>
  9 + <view class="row"><text class="label">实际发货日期</text><text class="value">{{ form.newShipmentDate }}</text></view>
9 <view class="row"><text class="label">生产厂</text><text class="value">{{ form.workshopName }}</text></view> 10 <view class="row"><text class="label">生产厂</text><text class="value">{{ form.workshopName }}</text></view>
10 <view class="row"><text class="label">办事处</text><text class="value">{{ form.deptName }}</text></view> 11 <view class="row"><text class="label">办事处</text><text class="value">{{ form.deptName }}</text></view>
11 <view class="row"><text class="label">区域</text><text class="value">{{ form.regionName }}</text></view> 12 <view class="row"><text class="label">区域</text><text class="value">{{ form.regionName }}</text></view>
12 <view class="row"><text class="label">交货方式</text><text class="value">{{ form.deliveryType }}</text></view> 13 <view class="row"><text class="label">交货方式</text><text class="value">{{ form.deliveryType }}</text></view>
13 <view class="row"><text class="label">目的地</text><text class="value">{{ form.destination }}</text></view> 14 <view class="row"><text class="label">目的地</text><text class="value">{{ form.destination }}</text></view>
  15 + <view class="row"><text class="label">是否当日发货</text><text class="value">{{ form.onTimeShipment === true ? '是' : (form.onTimeShipment === false ? '否' : '') }}</text></view>
14 </view> 16 </view>
15 17
16 <!-- 产品 --> 18 <!-- 产品 -->
@@ -41,6 +43,36 @@ @@ -41,6 +43,36 @@
41 </view> 43 </view>
42 </view> 44 </view>
43 </uni-popup> 45 </uni-popup>
  46 + <!-- 填写日期 -->
  47 + <uni-popup ref="fillDatePopup" type="bottom" :mask-click="false">
  48 + <view class="dialog">
  49 + <view class="dialog_header">
  50 + <text>填写日期</text>
  51 + <view class="dialog_close" @click="closeFillDateInfo"></view>
  52 + </view>
  53 + <view class="dialog_body fill-data_body">
  54 + <uni-list>
  55 + <uni-list-item title="原发货日期">
  56 + <template v-slot:footer>
  57 + <view class="value">{{ fillDateForm.shipmentsDate }}</view>
  58 + </template>
  59 + </uni-list-item>
  60 + <uni-list-item>
  61 + <template v-slot:body>
  62 + <view class="item-title"><text class="required">*</text><text>实际发货日期</text></view>
  63 + </template>
  64 + <template v-slot:footer>
  65 + <uni-datetime-picker type="date" :start="todayDate"
  66 + v-model="fillDateForm.newShipmentDate" />
  67 + </template>
  68 + </uni-list-item>
  69 + </uni-list>
  70 + </view>
  71 + <view class="dialog_footer">
  72 + <button class="btn confirm" type="primary" @click="onFillDateSave">保存</button>
  73 + </view>
  74 + </view>
  75 + </uni-popup>
44 <!-- 申请延期 --> 76 <!-- 申请延期 -->
45 <uni-popup ref="applyDelayPopup" type="bottom" :mask-click="false"> 77 <uni-popup ref="applyDelayPopup" type="bottom" :mask-click="false">
46 <view class="dialog"> 78 <view class="dialog">
@@ -136,7 +168,7 @@ @@ -136,7 +168,7 @@
136 </template> 168 </template>
137 169
138 <script> 170 <script>
139 -import { getDetailApi, saveSignInTicket, checkApi, splitDataApi } from '@/api/invoice.js' 171 +import { getDetailApi, saveSignInTicket, checkApi, splitDataApi, updateApi } from '@/api/invoice.js'
140 import Product from './product.vue' 172 import Product from './product.vue'
141 import DetailButtons from '@/components/detail-buttons/index.vue' 173 import DetailButtons from '@/components/detail-buttons/index.vue'
142 import FileUpload from '@/components/file-upload/index.vue' 174 import FileUpload from '@/components/file-upload/index.vue'
@@ -154,12 +186,18 @@ export default { @@ -154,12 +186,18 @@ export default {
154 // { text: '编辑', visible: true, variant: 'outline', event: 'edit' }, 186 // { text: '编辑', visible: true, variant: 'outline', event: 'edit' },
155 { text: '填写实发数', visible: true, variant: 'outline', event: 'fill' }, 187 { text: '填写实发数', visible: true, variant: 'outline', event: 'fill' },
156 { text: '上传签收单据', visible: true, variant: 'primary', event: 'upload' }, 188 { text: '上传签收单据', visible: true, variant: 'primary', event: 'upload' },
  189 + { text: '填写日期', visible: true, variant: 'primary', event: 'fillDate' },
157 ], 190 ],
158 uploadFile: { id: '', name: '' }, 191 uploadFile: { id: '', name: '' },
159 applyDelayForm: {}, 192 applyDelayForm: {},
160 splitForm: { 193 splitForm: {
161 initItem: {}, 194 initItem: {},
162 }, 195 },
  196 + fillDateForm: {
  197 + id: '',
  198 + shipmentsDate: '',
  199 + newShipmentDate: '',
  200 + },
163 } 201 }
164 }, 202 },
165 computed: { 203 computed: {
@@ -168,8 +206,10 @@ export default { @@ -168,8 +206,10 @@ export default {
168 const e = String(m.status || '') 206 const e = String(m.status || '')
169 return { 207 return {
170 canEdit: e === 'UN_SHIPMENTS', 208 canEdit: e === 'UN_SHIPMENTS',
171 - canFill: e === 'UN_SHIPMENTS', 209 + // onTimeShipment 有值(true || false), 填写实发数按钮不显示
  210 + canFill: e === 'UN_SHIPMENTS' && (m.onTimeShipment !== false && m.onTimeShipment !== true),
172 canUpload: e === 'SHIPMENTS', 211 canUpload: e === 'SHIPMENTS',
  212 + canFillDate: e === 'UN_SHIPMENTS' && m.onTimeShipment === false && !m.newShipmentDate,
173 } 213 }
174 }, 214 },
175 displayButtons() { 215 displayButtons() {
@@ -178,7 +218,15 @@ export default { @@ -178,7 +218,15 @@ export default {
178 // { ...this.buttons[0], visible: f.canEdit && this.$auth.hasPermi('shipping-plan-manage:invoice:modify') }, 218 // { ...this.buttons[0], visible: f.canEdit && this.$auth.hasPermi('shipping-plan-manage:invoice:modify') },
179 { ...this.buttons[0], visible: f.canFill && this.$auth.hasPermi('shipping-plan-manage:invoice:fill') }, 219 { ...this.buttons[0], visible: f.canFill && this.$auth.hasPermi('shipping-plan-manage:invoice:fill') },
180 { ...this.buttons[1], visible: f.canUpload && this.$auth.hasPermi('shipping-plan-manage:invoice:upload') }, 220 { ...this.buttons[1], visible: f.canUpload && this.$auth.hasPermi('shipping-plan-manage:invoice:upload') },
  221 + { ...this.buttons[2], visible: f.canFillDate && this.$auth.hasPermi('shipping-plan-manage:invoice:fill-date') },
181 ] 222 ]
  223 + },
  224 + todayDate() {
  225 + const now = new Date()
  226 + const y = now.getFullYear()
  227 + const m = String(now.getMonth() + 1).padStart(2, '0')
  228 + const d = String(now.getDate()).padStart(2, '0')
  229 + return `${y}-${m}-${d}`
182 } 230 }
183 }, 231 },
184 onLoad(query) { 232 onLoad(query) {
@@ -200,6 +248,7 @@ export default { @@ -200,6 +248,7 @@ export default {
200 // edit: () => this.onEdit(), 248 // edit: () => this.onEdit(),
201 fill: () => this.onFill(), 249 fill: () => this.onFill(),
202 upload: () => this.onUpload(), 250 upload: () => this.onUpload(),
  251 + fillDate: () => this.onFillDate(),
203 } 252 }
204 const fn = map[btn.event] 253 const fn = map[btn.event]
205 if (typeof fn === 'function') fn() 254 if (typeof fn === 'function') fn()
@@ -221,6 +270,11 @@ export default { @@ -221,6 +270,11 @@ export default {
221 onUpload() { 270 onUpload() {
222 this.$refs.uploadPopup && this.$refs.uploadPopup.open() 271 this.$refs.uploadPopup && this.$refs.uploadPopup.open()
223 }, 272 },
  273 + onFillDate() {
  274 + this.fillDateForm.id = this.form.id;
  275 + this.fillDateForm.shipmentsDate = this.form.shipmentsDate;
  276 + this.$refs.fillDatePopup && this.$refs.fillDatePopup.open()
  277 + },
224 downloadFile, 278 downloadFile,
225 closeUploadInfo() { 279 closeUploadInfo() {
226 this.uploadFile = { id: '', name: '' }; 280 this.uploadFile = { id: '', name: '' };
@@ -248,6 +302,31 @@ export default { @@ -248,6 +302,31 @@ export default {
248 uni.showToast({ title: (e && e.msg) || '保存失败', icon: 'none' }) 302 uni.showToast({ title: (e && e.msg) || '保存失败', icon: 'none' })
249 } 303 }
250 }, 304 },
  305 + closeFillDateInfo() {
  306 + this.uploadFile = { id: '', name: '' };
  307 + this.$refs.fillDatePopup && this.$refs.fillDatePopup.close()
  308 + },
  309 + async onFillDateSave() {
  310 + console.log('onFillDateSave__this.fillDateForm', this.fillDateForm)
  311 + if (!this.fillDateForm.newShipmentDate) {
  312 + uni.showToast({
  313 + title: '请选择实际发货日期',
  314 + icon: 'none'
  315 + })
  316 + return
  317 + }
  318 + const params = {
  319 + id: this.fillDateForm.id,
  320 + newShipmentDate: this.fillDateForm.newShipmentDate,
  321 + }
  322 + try {
  323 + await updateApi(params)
  324 + uni.showToast({ title: '保存成功', icon: 'success' })
  325 + setTimeout(() => { uni.redirectTo({ url: '/pages/invoice/index' }) }, 300)
  326 + } catch (e) {
  327 + uni.showToast({ title: (e && e.msg) || '保存失败', icon: 'none' })
  328 + }
  329 + },
251 // 申请延期 330 // 申请延期
252 applyDelayFun(id) { 331 applyDelayFun(id) {
253 getShipmentPlanDetailApi(id).then(res => { 332 getShipmentPlanDetailApi(id).then(res => {
@@ -501,6 +580,7 @@ export default { @@ -501,6 +580,7 @@ export default {
501 padding: 12rpx 4rpx 24rpx; 580 padding: 12rpx 4rpx 24rpx;
502 max-height: 70vh; 581 max-height: 70vh;
503 overflow-y: auto; 582 overflow-y: auto;
  583 +
504 } 584 }
505 585
506 .split_body { 586 .split_body {
@@ -740,4 +820,11 @@ export default { @@ -740,4 +820,11 @@ export default {
740 } 820 }
741 } 821 }
742 } 822 }
  823 +.fill-data_body {
  824 + ::v-deep .uni-list-item {
  825 + &__container {
  826 + align-items: center;
  827 + }
  828 + }
  829 +}
743 </style> 830 </style>
@@ -2,6 +2,14 @@ @@ -2,6 +2,14 @@
2 <view class="page"> 2 <view class="page">
3 <scroll-view class="scroll" scroll-y> 3 <scroll-view class="scroll" scroll-y>
4 <uni-list> 4 <uni-list>
  5 + <view class="section">
  6 + <uni-list-item class="select-item" :class="form.onTimeShipment != null ? 'is-filled' : 'is-empty'" clickable
  7 + @click="openShipmentSheet" :rightText="onTimeShipmentText" showArrow>
  8 + <template v-slot:body>
  9 + <view class="item-title"><text>是否当日发货</text></view>
  10 + </template>
  11 + </uni-list-item>
  12 + </view>
5 <!-- 产品 --> 13 <!-- 产品 -->
6 <view class="section2"> 14 <view class="section2">
7 <!-- mode="add" 允许编辑 --> 15 <!-- mode="add" 允许编辑 -->
@@ -24,24 +32,36 @@ @@ -24,24 +32,36 @@
24 </view> 32 </view>
25 </view> 33 </view>
26 </uni-popup> 34 </uni-popup>
  35 + <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value"
  36 + @confirm="onSheetConfirm" />
27 </view> 37 </view>
28 </template> 38 </template>
29 39
30 <script> 40 <script>
31 import { listByShipmentOrderId, dataReplenishInput } from '@/api/invoice.js' 41 import { listByShipmentOrderId, dataReplenishInput } from '@/api/invoice.js'
32 import Product from './product.vue' 42 import Product from './product.vue'
  43 +import SingleSelectSheet from '@/components/single-select/index.vue'
33 44
34 export default { 45 export default {
35 name: 'InvoiceFill', 46 name: 'InvoiceFill',
36 - components: { Product }, 47 + components: { Product, SingleSelectSheet },
37 data() { 48 data() {
38 return { 49 return {
39 form: { 50 form: {
40 id: '', 51 id: '',
41 - detailList: [] 52 + detailList: [],
  53 + onTimeShipment: true
42 }, 54 },
43 initDetailList: [], 55 initDetailList: [],
44 - customerName: '' 56 + customerName: '',
  57 + sheet: { visible: false, title: '请选择', options: [], value: '' }
  58 + }
  59 + },
  60 + computed: {
  61 + onTimeShipmentText() {
  62 + if (this.form.onTimeShipment === true) return '是'
  63 + if (this.form.onTimeShipment === false) return '否'
  64 + return '请选择'
45 } 65 }
46 }, 66 },
47 onLoad(query) { 67 onLoad(query) {
@@ -109,6 +129,17 @@ export default { @@ -109,6 +129,17 @@ export default {
109 this.$refs.confirmPopup && this.$refs.confirmPopup.close(); 129 this.$refs.confirmPopup && this.$refs.confirmPopup.close();
110 this.submitData(type); 130 this.submitData(type);
111 }, 131 },
  132 + openShipmentSheet() {
  133 + this.sheet = {
  134 + visible: true,
  135 + title: '是否当日发货',
  136 + options: [{ label: '是', value: true }, { label: '否', value: false }],
  137 + value: this.form.onTimeShipment
  138 + }
  139 + },
  140 + onSheetConfirm({ value }) {
  141 + this.form.onTimeShipment = value
  142 + },
112 async submitData(type) { 143 async submitData(type) {
113 this.loading = true; 144 this.loading = true;
114 const params = {}; 145 const params = {};
@@ -126,6 +157,7 @@ export default { @@ -126,6 +157,7 @@ export default {
126 params.id = this.form.id || ''; 157 params.id = this.form.id || '';
127 params.detailList = detailList; 158 params.detailList = detailList;
128 params.type = type || ''; 159 params.type = type || '';
  160 + params.onTimeShipment = this.form.onTimeShipment;
129 console.log(params); 161 console.log(params);
130 162
131 try { 163 try {
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <view class="page"> 2 <view class="page">
3 <view class="dev-list-fixed"> 3 <view class="dev-list-fixed">
4 <view class="search-row"> 4 <view class="search-row">
5 - <uni-search-bar v-model="searchKeyword" radius="6" placeholder="请输入购货单位" clearButton="auto" 5 + <uni-search-bar v-model="searchKeyword" radius="6" placeholder="请输入购货单位或者发货单编号" clearButton="auto"
6 cancelButton="none" bgColor="#F3F3F3" textColor="rgba(0,0,0,0.4)" @confirm="search" 6 cancelButton="none" bgColor="#F3F3F3" textColor="rgba(0,0,0,0.4)" @confirm="search"
7 @input="onSearchInput" /> 7 @input="onSearchInput" />
8 <view class="tool-icons"> 8 <view class="tool-icons">
@@ -26,6 +26,9 @@ @@ -26,6 +26,9 @@
26 </view> 26 </view>
27 </view> 27 </view>
28 <view class="info-row"> 28 <view class="info-row">
  29 + <text>发货单编号</text><text>{{ item.code || '-' }}</text>
  30 + </view>
  31 + <view class="info-row">
29 <text>生产厂</text><text>{{ item.workshopName || '-' }}</text> 32 <text>生产厂</text><text>{{ item.workshopName || '-' }}</text>
30 </view> 33 </view>
31 <view class="info-row"> 34 <view class="info-row">
@@ -35,7 +38,10 @@ @@ -35,7 +38,10 @@
35 <text>交货方式</text><text>{{ item.deliveryType || '-' }}</text> 38 <text>交货方式</text><text>{{ item.deliveryType || '-' }}</text>
36 </view> 39 </view>
37 <view class="info-row"> 40 <view class="info-row">
38 - <text>发货日期</text><text>{{ item.shipmentsDate || '-' }}</text> 41 + <text>是否当日发货</text><text>{{ item.onTimeShipment === true ? '是' : (item.onTimeShipment === false ? '否' : '-') || '-' }}</text>
  42 + </view>
  43 + <view class="info-row">
  44 + <text>原发货日期</text><text>{{ item.shipmentsDate || '-' }}</text>
39 </view> 45 </view>
40 </view> 46 </view>
41 </template> 47 </template>
@@ -68,7 +74,7 @@ @@ -68,7 +74,7 @@
68 </view> 74 </view>
69 75
70 <view class="form-item"> 76 <view class="form-item">
71 - <view class="label">货日期</view> 77 + <view class="label">原发货日期</view>
72 <uni-datetime-picker type="daterange" v-model="model.dateRange" start="2023-01-01" @change="onDateChange($event, model)"/> 78 <uni-datetime-picker type="daterange" v-model="model.dateRange" start="2023-01-01" @change="onDateChange($event, model)"/>
73 </view> 79 </view>
74 </view> 80 </view>
@@ -132,7 +138,7 @@ export default { @@ -132,7 +138,7 @@ export default {
132 computed: { 138 computed: {
133 extraCombined() { 139 extraCombined() {
134 return { 140 return {
135 - customerName: this.searchKeywordDebounced || undefined 141 + searchKey: this.searchKeywordDebounced || undefined
136 } 142 }
137 } 143 }
138 }, 144 },
@@ -253,7 +259,7 @@ export default { @@ -253,7 +259,7 @@ export default {
253 delete params.dateRange 259 delete params.dateRange
254 } 260 }
255 if (this.searchKeywordDebounced) { 261 if (this.searchKeywordDebounced) {
256 - params.customerName = this.searchKeywordDebounced 262 + params.searchKey = this.searchKeywordDebounced
257 } 263 }
258 return queryApi(params) 264 return queryApi(params)
259 .then(res => { 265 .then(res => {
@@ -316,7 +316,10 @@ export default { @@ -316,7 +316,10 @@ export default {
316 const m = res.data || {} 316 const m = res.data || {}
317 const next = { ...this.form, ...m } 317 const next = { ...this.form, ...m }
318 next.id = m.id || m.code || id 318 next.id = m.id || m.code || id
319 - next.purchaseOrderLineList = Array.isArray(m.purchaseOrderLineList) ? m.purchaseOrderLineList.map(x => ({ ...x })) : [] 319 + next.purchaseOrderLineList = Array.isArray(m.purchaseOrderLineList) ? m.purchaseOrderLineList.map(x => ({
  320 + ...x,
  321 + assessmentExceedsAgreement: Number(x.assessmentExceedsAgreement || 0).toFixed(2) || 0.00,
  322 + })) : []
320 this.form = next; 323 this.form = next;
321 this.initPurchaseOrderLineList = next.purchaseOrderLineList || []; 324 this.initPurchaseOrderLineList = next.purchaseOrderLineList || [];
322 this.refreshStandardName() 325 this.refreshStandardName()
@@ -225,7 +225,10 @@ export default { @@ -225,7 +225,10 @@ export default {
225 const m = res.data || {} 225 const m = res.data || {}
226 const next = { ...this.form, ...m } 226 const next = { ...this.form, ...m }
227 next.id = m.id || m.code || id 227 next.id = m.id || m.code || id
228 - next.purchaseOrderLineList = Array.isArray(m.purchaseOrderLineList) ? m.purchaseOrderLineList.map(x => ({ ...x })) : [] 228 + next.purchaseOrderLineList = Array.isArray(m.purchaseOrderLineList) ? m.purchaseOrderLineList.map(x => ({
  229 + ...x,
  230 + assessmentExceedsAgreement: Number(x.assessmentExceedsAgreement || 0).toFixed(2) || 0.00,
  231 + })) : []
229 this.form = next; 232 this.form = next;
230 this.initPurchaseOrderLineList = next.purchaseOrderLineList || []; 233 this.initPurchaseOrderLineList = next.purchaseOrderLineList || [];
231 this.refreshStandardName() 234 this.refreshStandardName()
@@ -75,9 +75,10 @@ @@ -75,9 +75,10 @@
75 </uni-list-item> 75 </uni-list-item>
76 <uni-list-item title="考核超协"> 76 <uni-list-item title="考核超协">
77 <template v-slot:footer> 77 <template v-slot:footer>
78 - <uni-easyinput :disabled="pageType === 'modify'" 78 + <uni-easyinput type="digit" :disabled="pageType === 'modify'"
79 v-model="item.assessmentExceedsAgreement" 79 v-model="item.assessmentExceedsAgreement"
80 - :placeholder="pageType === 'modify' ? '' : '请输入考核超协'" :inputBorder="false" /> 80 + :placeholder="pageType === 'modify' ? '' : '请输入考核超协'" :inputBorder="false"
  81 + @input="onAssessmentInput($event, idx)" @blur="onAssessmentBlur($event, idx)" />
81 </template> 82 </template>
82 </uni-list-item> 83 </uni-list-item>
83 </uni-list> 84 </uni-list>
@@ -223,6 +224,49 @@ export default { @@ -223,6 +224,49 @@ export default {
223 toggleViewCollapse() { 224 toggleViewCollapse() {
224 this.collapsedView = !this.collapsedView 225 this.collapsedView = !this.collapsedView
225 }, 226 },
  227 + onAssessmentInput(val, idx) {
  228 + const it = this.items[idx]
  229 + if (!it) return
  230 + // 允许负号、数字、小数点
  231 + let v = String(val).replace(/[^0-9.-]/g, '')
  232 + // 处理多个小数点
  233 + const parts = v.split('.')
  234 + if (parts.length > 2) {
  235 + v = parts[0] + '.' + parts.slice(1).join('')
  236 + }
  237 + // 处理多个负号(仅允许出现在开头)
  238 + if (v.indexOf('-') > 0) {
  239 + v = v.replace(/-/g, '')
  240 + }
  241 + if (v.startsWith('-') && (v.match(/-/g) || []).length > 1) {
  242 + v = '-' + v.replace(/-/g, '')
  243 + }
  244 + // 限制两位小数
  245 + if (v.includes('.')) {
  246 + const [int, dec] = v.split('.')
  247 + v = int + '.' + dec.slice(0, 2)
  248 + }
  249 + this.$set(this.items[idx], 'assessmentExceedsAgreement', v)
  250 + this.emitChange()
  251 + },
  252 + onAssessmentBlur(val, idx) {
  253 + const it = this.items[idx]
  254 + if (!it) return
  255 + let v = it.assessmentExceedsAgreement
  256 + if (!v || v === '-') {
  257 + v = ''
  258 + } else {
  259 + // 尝试转数字并保留两位小数
  260 + const n = parseFloat(v)
  261 + if (!isNaN(n)) {
  262 + v = n.toFixed(2)
  263 + } else {
  264 + v = ''
  265 + }
  266 + }
  267 + this.$set(this.items[idx], 'assessmentExceedsAgreement', v)
  268 + this.emitChange()
  269 + },
226 onDeliveryChange(e, item, idx) { 270 onDeliveryChange(e, item, idx) {
227 const getStr = (x) => { 271 const getStr = (x) => {
228 if (x && x.detail && x.detail.value !== undefined) return x.detail.value 272 if (x && x.detail && x.detail.value !== undefined) return x.detail.value