Commit aa75b2c4520890dd1d2016f2f75c471d671ac687

Authored by gesilong
1 parent 97943624

commit:提出的优化 修复等内容的优化

@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 </view> 8 </view>
9 <view class="body"> 9 <view class="body">
10 <view v-if="tab === 'base'"> 10 <view v-if="tab === 'base'">
11 - <component :is="componentName" :id="auditCtx.businessId" :node-code="nodeCode" ref="basicRef" /> 11 + <component :is="componentName" :id="auditCtx.businessId" :node-code="nodeCode" mode="audit" ref="basicRef" />
12 </view> 12 </view>
13 <view v-else> 13 <view v-else>
14 <FlowTimeline :nodeList="nodeList" :isEnd="isEnd" /> 14 <FlowTimeline :nodeList="nodeList" :isEnd="isEnd" />
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 </view> 8 </view>
9 <view class="body"> 9 <view class="body">
10 <view v-if="tab === 'base'"> 10 <view v-if="tab === 'base'">
11 - <component :is="componentName" :id="auditCtx.businessId" ref="basicRef" /> 11 + <component :is="componentName" :id="auditCtx.businessId" mode="detail" ref="basicRef" />
12 </view> 12 </view>
13 <view v-else> 13 <view v-else>
14 <FlowTimeline :nodeList="nodeList" :isEnd="isEnd" /> 14 <FlowTimeline :nodeList="nodeList" :isEnd="isEnd" />
@@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
46 <uni-easyinput :value="item.category" :inputBorder="false" disabled /> 46 <uni-easyinput :value="item.category" :inputBorder="false" disabled />
47 </template> 47 </template>
48 </uni-list-item> 48 </uni-list-item>
49 - <uni-list-item title="数量"> 49 + <uni-list-item title="数量(kg)">
50 <template v-slot:footer> 50 <template v-slot:footer>
51 <uni-easyinput :value="item.quantity" :inputBorder="false" disabled /> 51 <uni-easyinput :value="item.quantity" :inputBorder="false" disabled />
52 </template> 52 </template>
@@ -133,7 +133,7 @@ @@ -133,7 +133,7 @@
133 </template> 133 </template>
134 </uni-list-item> 134 </uni-list-item>
135 135
136 - <uni-list-item title="过磅数"> 136 + <uni-list-item title="过磅数(kg)">
137 <template v-slot:footer> 137 <template v-slot:footer>
138 <uni-easyinput :value="item.weighQuantity" :inputBorder="false" disabled /> 138 <uni-easyinput :value="item.weighQuantity" :inputBorder="false" disabled />
139 </template> 139 </template>
@@ -143,17 +143,17 @@ @@ -143,17 +143,17 @@
143 <uni-easyinput v-model="item.impurityRate" type="digit" :inputBorder="false" placeholder="请输入杂率" /> 143 <uni-easyinput v-model="item.impurityRate" type="digit" :inputBorder="false" placeholder="请输入杂率" />
144 </template> 144 </template>
145 </uni-list-item> 145 </uni-list-item>
146 - <uni-list-item title="折斤"> 146 + <uni-list-item title="折斤(kg)">
147 <template v-slot:footer> 147 <template v-slot:footer>
148 <uni-easyinput v-model="item.foldWeight" type="digit" :inputBorder="false" placeholder="请输入折斤" /> 148 <uni-easyinput v-model="item.foldWeight" type="digit" :inputBorder="false" placeholder="请输入折斤" />
149 </template> 149 </template>
150 </uni-list-item> 150 </uni-list-item>
151 - <uni-list-item title="退料"> 151 + <uni-list-item title="退料(kg)">
152 <template v-slot:footer> 152 <template v-slot:footer>
153 <uni-easyinput v-model="item.returnWeight" type="digit" :inputBorder="false" placeholder="请输入退料" /> 153 <uni-easyinput v-model="item.returnWeight" type="digit" :inputBorder="false" placeholder="请输入退料" />
154 </template> 154 </template>
155 </uni-list-item> 155 </uni-list-item>
156 - <uni-list-item title="入库净重"> 156 + <uni-list-item title="入库净重(kg)">
157 <template v-slot:footer> 157 <template v-slot:footer>
158 <uni-easyinput v-model="item.netWeight" type="digit" :inputBorder="false" placeholder="请输入入库净重" /> 158 <uni-easyinput v-model="item.netWeight" type="digit" :inputBorder="false" placeholder="请输入入库净重" />
159 </template> 159 </template>
@@ -181,19 +181,19 @@ @@ -181,19 +181,19 @@
181 <view class="total-title">合计</view> 181 <view class="total-title">合计</view>
182 <view class="total-body"> 182 <view class="total-body">
183 <view class="total-item"> 183 <view class="total-item">
184 - <text class="total-label">过磅数</text> 184 + <text class="total-label">过磅数(kg)</text>
185 <text class="total-value">{{ totalSummary.totalWeighQuantity || '-' }}</text> 185 <text class="total-value">{{ totalSummary.totalWeighQuantity || '-' }}</text>
186 </view> 186 </view>
187 <view class="total-item"> 187 <view class="total-item">
188 - <text class="total-label">折斤</text> 188 + <text class="total-label">折斤(kg)</text>
189 <text class="total-value">{{ totalSummary.totalFoldWeight || '-' }}</text> 189 <text class="total-value">{{ totalSummary.totalFoldWeight || '-' }}</text>
190 </view> 190 </view>
191 <view class="total-item"> 191 <view class="total-item">
192 - <text class="total-label">退料</text> 192 + <text class="total-label">退料(kg)</text>
193 <text class="total-value">{{ totalSummary.totalReturnWeight || '-' }}</text> 193 <text class="total-value">{{ totalSummary.totalReturnWeight || '-' }}</text>
194 </view> 194 </view>
195 <view class="total-item"> 195 <view class="total-item">
196 - <text class="total-label">入库净重</text> 196 + <text class="total-label">入库净重(kg)</text>
197 <text class="total-value">{{ totalSummary.totalNetWeight || '-' }}</text> 197 <text class="total-value">{{ totalSummary.totalNetWeight || '-' }}</text>
198 </view> 198 </view>
199 </view> 199 </view>
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 <view v-for="(item, idx) in applyList" :key="'a-' + (item.id || idx)" class="card"> 26 <view v-for="(item, idx) in applyList" :key="'a-' + (item.id || idx)" class="card">
27 <view class="card-index">第 {{ idx + 1 }} 行</view> 27 <view class="card-index">第 {{ idx + 1 }} 行</view>
28 <view class="row"><text class="label">类别</text><text class="value">{{ safeText(item.category) }}</text></view> 28 <view class="row"><text class="label">类别</text><text class="value">{{ safeText(item.category) }}</text></view>
29 - <view class="row"><text class="label">数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 29 + <view class="row"><text class="label">数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
30 </view> 30 </view>
31 </view> 31 </view>
32 </view> 32 </view>
@@ -49,11 +49,11 @@ @@ -49,11 +49,11 @@
49 <view class="row"><text class="label">品种</text><text class="value">{{ safeText(item.productName) }}</text></view> 49 <view class="row"><text class="label">品种</text><text class="value">{{ safeText(item.productName) }}</text></view>
50 <view class="row"><text class="label">类别</text><text class="value">{{ safeText(item.category) }}</text></view> 50 <view class="row"><text class="label">类别</text><text class="value">{{ safeText(item.category) }}</text></view>
51 <view class="row"><text class="label">名称</text><text class="value">{{ safeText(item.name) }}</text></view> 51 <view class="row"><text class="label">名称</text><text class="value">{{ safeText(item.name) }}</text></view>
52 - <view class="row"><text class="label">过磅数</text><text class="value">{{ formatNumber(item.weighQuantity) }}</text></view> 52 + <view class="row"><text class="label">过磅数(kg)</text><text class="value">{{ formatNumber(item.weighQuantity) }}</text></view>
53 <view class="row"><text class="label">杂率(%)</text><text class="value">{{ formatNumber(item.impurityRate) }}</text></view> 53 <view class="row"><text class="label">杂率(%)</text><text class="value">{{ formatNumber(item.impurityRate) }}</text></view>
54 - <view class="row"><text class="label">折斤</text><text class="value">{{ formatNumber(item.foldWeight) }}</text></view>  
55 - <view class="row"><text class="label">退料</text><text class="value">{{ formatNumber(item.returnWeight) }}</text></view>  
56 - <view class="row"><text class="label">入库净重</text><text class="value">{{ formatNumber(item.netWeight) }}</text></view> 54 + <view class="row"><text class="label">折斤(kg)</text><text class="value">{{ formatNumber(item.foldWeight) }}</text></view>
  55 + <view class="row"><text class="label">退料(kg)</text><text class="value">{{ formatNumber(item.returnWeight) }}</text></view>
  56 + <view class="row"><text class="label">入库净重(kg)</text><text class="value">{{ formatNumber(item.netWeight) }}</text></view>
57 <view class="row"><text class="label">备注</text><text class="value">{{ safeText(item.remark) }}</text></view> 57 <view class="row"><text class="label">备注</text><text class="value">{{ safeText(item.remark) }}</text></view>
58 </view> 58 </view>
59 </view> 59 </view>
@@ -68,19 +68,19 @@ @@ -68,19 +68,19 @@
68 <view class="total-title">合计</view> 68 <view class="total-title">合计</view>
69 <view class="total-body"> 69 <view class="total-body">
70 <view class="total-item"> 70 <view class="total-item">
71 - <text class="total-label">过磅数</text> 71 + <text class="total-label">过磅数(kg)</text>
72 <text class="total-value">{{ formatNumber(form.totalWeighQuantity) }}</text> 72 <text class="total-value">{{ formatNumber(form.totalWeighQuantity) }}</text>
73 </view> 73 </view>
74 <view class="total-item"> 74 <view class="total-item">
75 - <text class="total-label">折斤</text> 75 + <text class="total-label">折斤(kg)</text>
76 <text class="total-value">{{ formatNumber(form.totalFoldWeight) }}</text> 76 <text class="total-value">{{ formatNumber(form.totalFoldWeight) }}</text>
77 </view> 77 </view>
78 <view class="total-item"> 78 <view class="total-item">
79 - <text class="total-label">退料</text> 79 + <text class="total-label">退料(kg)</text>
80 <text class="total-value">{{ formatNumber(form.totalReturnWeight) }}</text> 80 <text class="total-value">{{ formatNumber(form.totalReturnWeight) }}</text>
81 </view> 81 </view>
82 <view class="total-item"> 82 <view class="total-item">
83 - <text class="total-label">入库净重</text> 83 + <text class="total-label">入库净重(kg)</text>
84 <text class="total-value">{{ formatNumber(form.totalNetWeight) }}</text> 84 <text class="total-value">{{ formatNumber(form.totalNetWeight) }}</text>
85 </view> 85 </view>
86 </view> 86 </view>
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 <view v-for="(item, idx) in applyList" :key="'a-' + (item.id || idx)" class="card"> 21 <view v-for="(item, idx) in applyList" :key="'a-' + (item.id || idx)" class="card">
22 <view class="card-index">第 {{ idx + 1 }} 行</view> 22 <view class="card-index">第 {{ idx + 1 }} 行</view>
23 <view class="row"><text class="label">类别</text><text class="value">{{ safeText(item.category) }}</text></view> 23 <view class="row"><text class="label">类别</text><text class="value">{{ safeText(item.category) }}</text></view>
24 - <view class="row"><text class="label">数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 24 + <view class="row"><text class="label">数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
25 </view> 25 </view>
26 </view> 26 </view>
27 </view> 27 </view>
@@ -40,11 +40,11 @@ @@ -40,11 +40,11 @@
40 <view class="row"><text class="label">品种</text><text class="value">{{ safeText(item.productName) }}</text></view> 40 <view class="row"><text class="label">品种</text><text class="value">{{ safeText(item.productName) }}</text></view>
41 <view class="row"><text class="label">类别</text><text class="value">{{ safeText(item.category) }}</text></view> 41 <view class="row"><text class="label">类别</text><text class="value">{{ safeText(item.category) }}</text></view>
42 <view class="row"><text class="label">名称</text><text class="value">{{ safeText(item.name) }}</text></view> 42 <view class="row"><text class="label">名称</text><text class="value">{{ safeText(item.name) }}</text></view>
43 - <view class="row"><text class="label">过磅数</text><text class="value">{{ formatNumber(item.weighQuantity) }}</text></view> 43 + <view class="row"><text class="label">过磅数(kg)</text><text class="value">{{ formatNumber(item.weighQuantity) }}</text></view>
44 <view class="row"><text class="label">杂率(%)</text><text class="value">{{ formatNumber(item.impurityRate) }}</text></view> 44 <view class="row"><text class="label">杂率(%)</text><text class="value">{{ formatNumber(item.impurityRate) }}</text></view>
45 - <view class="row"><text class="label">折斤</text><text class="value">{{ formatNumber(item.foldWeight) }}</text></view>  
46 - <view class="row"><text class="label">退料</text><text class="value">{{ formatNumber(item.returnWeight) }}</text></view>  
47 - <view class="row"><text class="label">入库净重</text><text class="value">{{ formatNumber(item.netWeight) }}</text></view> 45 + <view class="row"><text class="label">折斤(kg)</text><text class="value">{{ formatNumber(item.foldWeight) }}</text></view>
  46 + <view class="row"><text class="label">退料(kg)</text><text class="value">{{ formatNumber(item.returnWeight) }}</text></view>
  47 + <view class="row"><text class="label">入库净重(kg)</text><text class="value">{{ formatNumber(item.netWeight) }}</text></view>
48 <view class="row"><text class="label">备注</text><text class="value">{{ safeText(item.remark) }}</text></view> 48 <view class="row"><text class="label">备注</text><text class="value">{{ safeText(item.remark) }}</text></view>
49 </view> 49 </view>
50 </view> 50 </view>
@@ -59,19 +59,19 @@ @@ -59,19 +59,19 @@
59 <view class="total-title">合计</view> 59 <view class="total-title">合计</view>
60 <view class="total-body"> 60 <view class="total-body">
61 <view class="total-item"> 61 <view class="total-item">
62 - <text class="total-label">过磅数</text> 62 + <text class="total-label">过磅数(kg)</text>
63 <text class="total-value">{{ formatNumber(form.totalWeighQuantity) }}</text> 63 <text class="total-value">{{ formatNumber(form.totalWeighQuantity) }}</text>
64 </view> 64 </view>
65 <view class="total-item"> 65 <view class="total-item">
66 - <text class="total-label">折斤</text> 66 + <text class="total-label">折斤(kg)</text>
67 <text class="total-value">{{ formatNumber(form.totalFoldWeight) }}</text> 67 <text class="total-value">{{ formatNumber(form.totalFoldWeight) }}</text>
68 </view> 68 </view>
69 <view class="total-item"> 69 <view class="total-item">
70 - <text class="total-label">退料</text> 70 + <text class="total-label">退料(kg)</text>
71 <text class="total-value">{{ formatNumber(form.totalReturnWeight) }}</text> 71 <text class="total-value">{{ formatNumber(form.totalReturnWeight) }}</text>
72 </view> 72 </view>
73 <view class="total-item"> 73 <view class="total-item">
74 - <text class="total-label">入库净重</text> 74 + <text class="total-label">入库净重(kg)</text>
75 <text class="total-value">{{ formatNumber(form.totalNetWeight) }}</text> 75 <text class="total-value">{{ formatNumber(form.totalNetWeight) }}</text>
76 </view> 76 </view>
77 </view> 77 </view>
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 <uni-easyinput :value="item.category" :inputBorder="false" disabled /> 45 <uni-easyinput :value="item.category" :inputBorder="false" disabled />
46 </template> 46 </template>
47 </uni-list-item> 47 </uni-list-item>
48 - <uni-list-item title="数量"> 48 + <uni-list-item title="数量(kg)">
49 <template v-slot:footer> 49 <template v-slot:footer>
50 <uni-easyinput :value="item.quantity" :inputBorder="false" disabled /> 50 <uni-easyinput :value="item.quantity" :inputBorder="false" disabled />
51 </template> 51 </template>
@@ -132,7 +132,7 @@ @@ -132,7 +132,7 @@
132 </template> 132 </template>
133 </uni-list-item> 133 </uni-list-item>
134 134
135 - <uni-list-item title="过磅数"> 135 + <uni-list-item title="过磅数(kg)">
136 <template v-slot:footer> 136 <template v-slot:footer>
137 <uni-easyinput :value="item.weighQuantity" :inputBorder="false" disabled /> 137 <uni-easyinput :value="item.weighQuantity" :inputBorder="false" disabled />
138 </template> 138 </template>
@@ -142,17 +142,17 @@ @@ -142,17 +142,17 @@
142 <uni-easyinput v-model="item.impurityRate" type="digit" :inputBorder="false" placeholder="请输入杂率" /> 142 <uni-easyinput v-model="item.impurityRate" type="digit" :inputBorder="false" placeholder="请输入杂率" />
143 </template> 143 </template>
144 </uni-list-item> 144 </uni-list-item>
145 - <uni-list-item title="折斤"> 145 + <uni-list-item title="折斤(kg)">
146 <template v-slot:footer> 146 <template v-slot:footer>
147 <uni-easyinput v-model="item.foldWeight" type="digit" :inputBorder="false" placeholder="请输入折斤" /> 147 <uni-easyinput v-model="item.foldWeight" type="digit" :inputBorder="false" placeholder="请输入折斤" />
148 </template> 148 </template>
149 </uni-list-item> 149 </uni-list-item>
150 - <uni-list-item title="退料"> 150 + <uni-list-item title="退料(kg)">
151 <template v-slot:footer> 151 <template v-slot:footer>
152 <uni-easyinput v-model="item.returnWeight" type="digit" :inputBorder="false" placeholder="请输入退料" /> 152 <uni-easyinput v-model="item.returnWeight" type="digit" :inputBorder="false" placeholder="请输入退料" />
153 </template> 153 </template>
154 </uni-list-item> 154 </uni-list-item>
155 - <uni-list-item title="入库净重"> 155 + <uni-list-item title="入库净重(kg)">
156 <template v-slot:footer> 156 <template v-slot:footer>
157 <uni-easyinput v-model="item.netWeight" type="digit" :inputBorder="false" placeholder="请输入入库净重" /> 157 <uni-easyinput v-model="item.netWeight" type="digit" :inputBorder="false" placeholder="请输入入库净重" />
158 </template> 158 </template>
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 <text class="value">{{ row.category || '-' }}</text> 31 <text class="value">{{ row.category || '-' }}</text>
32 </view> 32 </view>
33 <view class="row"> 33 <view class="row">
34 - <text class="label">数量</text> 34 + <text class="label">数量(kg)</text>
35 <text class="value">{{ row.quantity === null || row.quantity === undefined || row.quantity === '' ? '-' : row.quantity }}</text> 35 <text class="value">{{ row.quantity === null || row.quantity === undefined || row.quantity === '' ? '-' : row.quantity }}</text>
36 </view> 36 </view>
37 37
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 <view v-for="(item, idx) in lineRows" :key="'l-' + (item.assayApplyId || idx)" class="card"> 31 <view v-for="(item, idx) in lineRows" :key="'l-' + (item.assayApplyId || idx)" class="card">
32 <view class="card-index">第 {{ idx + 1 }} 行</view> 32 <view class="card-index">第 {{ idx + 1 }} 行</view>
33 <view class="row"><text class="label">样品</text><text class="value">{{ safeText(item.productName) }}</text></view> 33 <view class="row"><text class="label">样品</text><text class="value">{{ safeText(item.productName) }}</text></view>
34 - <view class="row"><text class="label">数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 34 + <view class="row"><text class="label">数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
35 <view class="row"><text class="label">样号</text><text class="value">{{ safeText(item.testCode) }}</text></view> 35 <view class="row"><text class="label">样号</text><text class="value">{{ safeText(item.testCode) }}</text></view>
36 <view class="row"><text class="label">送样编号</text><text class="value">{{ safeText(item.assayApplyCode) }}</text></view> 36 <view class="row"><text class="label">送样编号</text><text class="value">{{ safeText(item.assayApplyCode) }}</text></view>
37 <view v-for="key in componentKeys" :key="key" class="row"> 37 <view v-for="key in componentKeys" :key="key" class="row">
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 <view v-for="(item, idx) in lineRows" :key="'l-' + (item.assayApplyId || idx)" class="card"> 26 <view v-for="(item, idx) in lineRows" :key="'l-' + (item.assayApplyId || idx)" class="card">
27 <view class="card-index">第 {{ idx + 1 }} 行</view> 27 <view class="card-index">第 {{ idx + 1 }} 行</view>
28 <view class="row"><text class="label">样品</text><text class="value">{{ safeText(item.productName) }}</text></view> 28 <view class="row"><text class="label">样品</text><text class="value">{{ safeText(item.productName) }}</text></view>
29 - <view class="row"><text class="label">数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 29 + <view class="row"><text class="label">数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
30 <view class="row"><text class="label">样号</text><text class="value">{{ safeText(item.testCode) }}</text></view> 30 <view class="row"><text class="label">样号</text><text class="value">{{ safeText(item.testCode) }}</text></view>
31 <view class="row"><text class="label">送样编号</text><text class="value">{{ safeText(item.assayApplyCode) }}</text></view> 31 <view class="row"><text class="label">送样编号</text><text class="value">{{ safeText(item.assayApplyCode) }}</text></view>
32 <view v-for="key in componentKeys" :key="key" class="row"> 32 <view v-for="key in componentKeys" :key="key" class="row">
@@ -49,6 +49,20 @@ @@ -49,6 +49,20 @@
49 </view> 49 </view>
50 </template> 50 </template>
51 51
  52 + <!-- 审核意见(仅审核时展示,按流程顺序) -->
  53 + <template v-if="isAudit && opinionRows.length">
  54 + <view class="title-header">
  55 + <image class="title-header_icon" src="/static/images/title.png" />
  56 + <span>审核意见</span>
  57 + </view>
  58 + <view class="section opinion-section">
  59 + <view v-for="item in opinionRows" :key="item.key" class="opinion-item">
  60 + <view class="opinion-label">{{ item.label }}</view>
  61 + <textarea class="opinion-textarea" :value="item.opinion || '-'" disabled />
  62 + </view>
  63 + </view>
  64 + </template>
  65 +
52 <!-- 是否继续审批(assay_report_yfcckzg 节点必填) --> 66 <!-- 是否继续审批(assay_report_yfcckzg 节点必填) -->
53 <view v-if="showContinueApproval" class="section"> 67 <view v-if="showContinueApproval" class="section">
54 <view class="field-row"> 68 <view class="field-row">
@@ -77,7 +91,9 @@ export default { @@ -77,7 +91,9 @@ export default {
77 props: { 91 props: {
78 id: { type: [String, Number], default: '' }, 92 id: { type: [String, Number], default: '' },
79 // 当前审核节点编码(flow/audit 透传,flow/instance/getByBusinessId 返回) 93 // 当前审核节点编码(flow/audit 透传,flow/instance/getByBusinessId 返回)
80 - nodeCode: { type: String, default: '' } 94 + nodeCode: { type: String, default: '' },
  95 + // 页面模式:audit-审核;detail-审核详情
  96 + mode: { type: String, default: 'detail' }
81 }, 97 },
82 data() { 98 data() {
83 return { 99 return {
@@ -97,9 +113,13 @@ export default { @@ -97,9 +113,13 @@ export default {
97 } 113 }
98 }, 114 },
99 computed: { 115 computed: {
100 - // assay_report_gyglkzg2 节点需填写 是否继续审批 116 + // 是否审核页面
  117 + isAudit() {
  118 + return this.mode === 'audit'
  119 + },
  120 + // assay_report_gyglkzg2 节点需填写 是否继续审批(仅审核时展示)
101 showContinueApproval() { 121 showContinueApproval() {
102 - return this.nodeCode === 'assay_report_gyglkzg2' 122 + return this.isAudit && this.nodeCode === 'assay_report_gyglkzg2'
103 }, 123 },
104 componentKeys() { 124 componentKeys() {
105 // 按 workshopCode 匹配成分项,名称兜底 125 // 按 workshopCode 匹配成分项,名称兜底
@@ -117,6 +137,27 @@ export default { @@ -117,6 +137,27 @@ export default {
117 const v = this.form.hasQualityProblem 137 const v = this.form.hasQualityProblem
118 return v === true || v === 1 || v === '1' 138 return v === true || v === 1 || v === '1'
119 }, 139 },
  140 + // 审核意见:按流程顺序(仓库主管 → 供应管理科主管 → 供应部主管 → 分厂主管)展示,缺失的节点不展示
  141 + opinionRows() {
  142 + const defs = [
  143 + { key: 'ckzg', label: '仓库主管', name: 'ckzgName', opinion: 'ckzgOpinion' },
  144 + { key: 'gyglkzg', label: '供应管理科主管', name: 'gyglkzgName', opinion: 'gyglkzgOpinion' },
  145 + { key: 'gybzg', label: '供应部主管', name: 'gybzgName', opinion: 'gybzgOpinion' },
  146 + { key: 'fczg', label: '分厂主管', name: 'fczgName', opinion: 'fczgOpinion' }
  147 + ]
  148 + return defs
  149 + .map(it => {
  150 + const person = this.form[it.name] == null ? '' : String(this.form[it.name]).trim()
  151 + const opinion = this.form[it.opinion] == null ? '' : String(this.form[it.opinion]).trim()
  152 + return {
  153 + key: it.key,
  154 + label: person ? `${it.label}:${person}` : it.label,
  155 + opinion,
  156 + visible: !!(person || opinion)
  157 + }
  158 + })
  159 + .filter(it => it.visible)
  160 + },
120 approvalStatusName() { 161 approvalStatusName() {
121 const v = this.form.approvalStatus == null ? '' : String(this.form.approvalStatus) 162 const v = this.form.approvalStatus == null ? '' : String(this.form.approvalStatus)
122 if (!v) return '-' 163 if (!v) return '-'
@@ -255,11 +296,40 @@ export default { @@ -255,11 +296,40 @@ export default {
255 } 296 }
256 } 297 }
257 298
  299 +.opinion-section {
  300 + padding: 24rpx 32rpx;
  301 +
  302 + .opinion-item {
  303 + margin-bottom: 24rpx;
  304 +
  305 + &:last-child { margin-bottom: 0; }
  306 +
  307 + .opinion-label {
  308 + font-size: 28rpx;
  309 + color: rgba(0, 0, 0, 0.9);
  310 + line-height: 40rpx;
  311 + margin-bottom: 12rpx;
  312 + }
  313 +
  314 + .opinion-textarea {
  315 + width: 100%;
  316 + box-sizing: border-box;
  317 + height: 140rpx;
  318 + padding: 16rpx 20rpx;
  319 + background: #fafafa;
  320 + border: 1rpx solid #eee;
  321 + border-radius: 8rpx;
  322 + font-size: 28rpx;
  323 + line-height: 40rpx;
  324 + color: rgba(0, 0, 0, 0.9);
  325 + }
  326 + }
  327 +}
  328 +
258 .field-row { 329 .field-row {
259 display: flex; 330 display: flex;
260 align-items: center; 331 align-items: center;
261 justify-content: space-between; 332 justify-content: space-between;
262 -  
263 .field-label { 333 .field-label {
264 flex: none; 334 flex: none;
265 font-size: 32rpx; 335 font-size: 32rpx;
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 <view v-for="(item, idx) in lineRows" :key="'l-' + (item.assayApplyId || idx)" class="card"> 27 <view v-for="(item, idx) in lineRows" :key="'l-' + (item.assayApplyId || idx)" class="card">
28 <view class="card-index">第 {{ idx + 1 }} 行</view> 28 <view class="card-index">第 {{ idx + 1 }} 行</view>
29 <view class="row"><text class="label">样品</text><text class="value">{{ safeText(item.productName) }}</text></view> 29 <view class="row"><text class="label">样品</text><text class="value">{{ safeText(item.productName) }}</text></view>
30 - <view class="row"><text class="label">数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 30 + <view class="row"><text class="label">数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
31 <view class="row"><text class="label">样号</text><text class="value">{{ safeText(item.testCode) }}</text></view> 31 <view class="row"><text class="label">样号</text><text class="value">{{ safeText(item.testCode) }}</text></view>
32 <view class="row"><text class="label">送样编号</text><text class="value">{{ safeText(item.assayApplyCode) }}</text></view> 32 <view class="row"><text class="label">送样编号</text><text class="value">{{ safeText(item.assayApplyCode) }}</text></view>
33 <view v-for="key in componentKeys" :key="key" class="row"> 33 <view v-for="key in componentKeys" :key="key" class="row">
@@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
46 <uni-easyinput :value="item.productName" :inputBorder="false" disabled /> 46 <uni-easyinput :value="item.productName" :inputBorder="false" disabled />
47 </template> 47 </template>
48 </uni-list-item> 48 </uni-list-item>
49 - <uni-list-item title="买断数量"> 49 + <uni-list-item title="买断数量(kg)">
50 <template v-slot:footer> 50 <template v-slot:footer>
51 <uni-easyinput :value="item.buyoutQuantity" :inputBorder="false" disabled /> 51 <uni-easyinput :value="item.buyoutQuantity" :inputBorder="false" disabled />
52 </template> 52 </template>
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 </uni-list-item> 63 </uni-list-item>
64 <uni-list-item> 64 <uni-list-item>
65 <template v-slot:body> 65 <template v-slot:body>
66 - <view class="item-title"><text class="required">*</text><text>入库数量</text></view> 66 + <view class="item-title"><text class="required">*</text><text>入库数量(kg)</text></view>
67 </template> 67 </template>
68 <template v-slot:footer> 68 <template v-slot:footer>
69 <uni-easyinput v-model="item.instockQuantity" type="digit" :inputBorder="false" placeholder="请输入入库数量" @input="recalcDiffAmount(item)" /> 69 <uni-easyinput v-model="item.instockQuantity" type="digit" :inputBorder="false" placeholder="请输入入库数量" @input="recalcDiffAmount(item)" />
@@ -118,7 +118,7 @@ @@ -118,7 +118,7 @@
118 <view class="total-title">合计</view> 118 <view class="total-title">合计</view>
119 <view class="total-body"> 119 <view class="total-body">
120 <view class="total-item"> 120 <view class="total-item">
121 - <text class="total-label">买断数量</text> 121 + <text class="total-label">买断数量(kg)</text>
122 <text class="total-value">{{ totalSummary.totalBuyoutQuantity || '-' }}</text> 122 <text class="total-value">{{ totalSummary.totalBuyoutQuantity || '-' }}</text>
123 </view> 123 </view>
124 <view class="total-item"> 124 <view class="total-item">
@@ -126,7 +126,7 @@ @@ -126,7 +126,7 @@
126 <text class="total-value">{{ totalSummary.totalBuyoutAmount || '-' }}</text> 126 <text class="total-value">{{ totalSummary.totalBuyoutAmount || '-' }}</text>
127 </view> 127 </view>
128 <view class="total-item"> 128 <view class="total-item">
129 - <text class="total-label">入库数量</text> 129 + <text class="total-label">入库数量(kg)</text>
130 <text class="total-value">{{ totalSummary.totalInstockQuantity || '-' }}</text> 130 <text class="total-value">{{ totalSummary.totalInstockQuantity || '-' }}</text>
131 </view> 131 </view>
132 <view class="total-item"> 132 <view class="total-item">
@@ -26,10 +26,10 @@ @@ -26,10 +26,10 @@
26 <view v-for="(item, idx) in lineList" :key="'l-' + (item.id || idx)" class="card"> 26 <view v-for="(item, idx) in lineList" :key="'l-' + (item.id || idx)" class="card">
27 <view class="card-index">第 {{ idx + 1 }} 行</view> 27 <view class="card-index">第 {{ idx + 1 }} 行</view>
28 <view class="row"><text class="label">买断品种</text><text class="value">{{ safeText(item.productName) }}</text></view> 28 <view class="row"><text class="label">买断品种</text><text class="value">{{ safeText(item.productName) }}</text></view>
29 - <view class="row"><text class="label">买断数量</text><text class="value">{{ formatNumber(item.buyoutQuantity) }}</text></view> 29 + <view class="row"><text class="label">买断数量(kg)</text><text class="value">{{ formatNumber(item.buyoutQuantity) }}</text></view>
30 <view class="row"><text class="label">买断单价</text><text class="value">{{ formatNumber(item.buyoutPrice) }}</text></view> 30 <view class="row"><text class="label">买断单价</text><text class="value">{{ formatNumber(item.buyoutPrice) }}</text></view>
31 <view class="row"><text class="label">买断金额</text><text class="value">{{ formatNumber(item.buyoutAmount) }}</text></view> 31 <view class="row"><text class="label">买断金额</text><text class="value">{{ formatNumber(item.buyoutAmount) }}</text></view>
32 - <view class="row"><text class="label">入库数量</text><text class="value">{{ formatNumber(item.instockQuantity) }}</text></view> 32 + <view class="row"><text class="label">入库数量(kg)</text><text class="value">{{ formatNumber(item.instockQuantity) }}</text></view>
33 <view class="row"><text class="label">入库单价</text><text class="value">{{ formatNumber(item.instockPrice) }}</text></view> 33 <view class="row"><text class="label">入库单价</text><text class="value">{{ formatNumber(item.instockPrice) }}</text></view>
34 <view class="row"><text class="label">入库金额</text><text class="value">{{ formatNumber(item.instockAmount) }}</text></view> 34 <view class="row"><text class="label">入库金额</text><text class="value">{{ formatNumber(item.instockAmount) }}</text></view>
35 <view class="row"><text class="label">预计吨损耗(元/吨)</text><text class="value">{{ formatNumber(item.expectTonLoss) }}</text></view> 35 <view class="row"><text class="label">预计吨损耗(元/吨)</text><text class="value">{{ formatNumber(item.expectTonLoss) }}</text></view>
@@ -46,9 +46,9 @@ @@ -46,9 +46,9 @@
46 <span>合计</span> 46 <span>合计</span>
47 </view> 47 </view>
48 <view class="section"> 48 <view class="section">
49 - <view class="row"><text class="label">买断数量</text><text class="value">{{ formatNumber(form.totalBuyoutQuantity) }}</text></view> 49 + <view class="row"><text class="label">买断数量(kg)</text><text class="value">{{ formatNumber(form.totalBuyoutQuantity) }}</text></view>
50 <view class="row"><text class="label">买断金额</text><text class="value">{{ formatNumber(form.totalBuyoutAmount) }}</text></view> 50 <view class="row"><text class="label">买断金额</text><text class="value">{{ formatNumber(form.totalBuyoutAmount) }}</text></view>
51 - <view class="row"><text class="label">入库数量</text><text class="value">{{ formatNumber(form.totalInstockQuantity) }}</text></view> 51 + <view class="row"><text class="label">入库数量(kg)</text><text class="value">{{ formatNumber(form.totalInstockQuantity) }}</text></view>
52 <view class="row"><text class="label">入库金额</text><text class="value">{{ formatNumber(form.totalInstockAmount) }}</text></view> 52 <view class="row"><text class="label">入库金额</text><text class="value">{{ formatNumber(form.totalInstockAmount) }}</text></view>
53 <view class="row"><text class="label">差异金额</text><text class="value">{{ formatNumber(form.totalDiffAmount) }}</text></view> 53 <view class="row"><text class="label">差异金额</text><text class="value">{{ formatNumber(form.totalDiffAmount) }}</text></view>
54 </view> 54 </view>
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 <uni-easyinput :value="item.productName" :inputBorder="false" disabled /> 45 <uni-easyinput :value="item.productName" :inputBorder="false" disabled />
46 </template> 46 </template>
47 </uni-list-item> 47 </uni-list-item>
48 - <uni-list-item title="买断数量"> 48 + <uni-list-item title="买断数量(kg)">
49 <template v-slot:footer> 49 <template v-slot:footer>
50 <uni-easyinput :value="item.buyoutQuantity" :inputBorder="false" disabled /> 50 <uni-easyinput :value="item.buyoutQuantity" :inputBorder="false" disabled />
51 </template> 51 </template>
@@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
62 </uni-list-item> 62 </uni-list-item>
63 <uni-list-item> 63 <uni-list-item>
64 <template v-slot:body> 64 <template v-slot:body>
65 - <view class="item-title"><text class="required">*</text><text>入库数量</text></view> 65 + <view class="item-title"><text class="required">*</text><text>入库数量(kg)</text></view>
66 </template> 66 </template>
67 <template v-slot:footer> 67 <template v-slot:footer>
68 <uni-easyinput v-model="item.instockQuantity" type="digit" :inputBorder="false" placeholder="请输入入库数量" @input="recalcDiffAmount(item)" /> 68 <uni-easyinput v-model="item.instockQuantity" type="digit" :inputBorder="false" placeholder="请输入入库数量" @input="recalcDiffAmount(item)" />
@@ -117,7 +117,7 @@ @@ -117,7 +117,7 @@
117 <view class="total-title">合计</view> 117 <view class="total-title">合计</view>
118 <view class="total-body"> 118 <view class="total-body">
119 <view class="total-item"> 119 <view class="total-item">
120 - <text class="total-label">买断数量</text> 120 + <text class="total-label">买断数量(kg)</text>
121 <text class="total-value">{{ totalSummary.totalBuyoutQuantity || '-' }}</text> 121 <text class="total-value">{{ totalSummary.totalBuyoutQuantity || '-' }}</text>
122 </view> 122 </view>
123 <view class="total-item"> 123 <view class="total-item">
@@ -125,7 +125,7 @@ @@ -125,7 +125,7 @@
125 <text class="total-value">{{ totalSummary.totalBuyoutAmount || '-' }}</text> 125 <text class="total-value">{{ totalSummary.totalBuyoutAmount || '-' }}</text>
126 </view> 126 </view>
127 <view class="total-item"> 127 <view class="total-item">
128 - <text class="total-label">入库数量</text> 128 + <text class="total-label">入库数量(kg)</text>
129 <text class="total-value">{{ totalSummary.totalInstockQuantity || '-' }}</text> 129 <text class="total-value">{{ totalSummary.totalInstockQuantity || '-' }}</text>
130 </view> 130 </view>
131 <view class="total-item"> 131 <view class="total-item">
@@ -21,10 +21,10 @@ @@ -21,10 +21,10 @@
21 <view v-for="(item, idx) in lineList" :key="'l-' + (item.id || idx)" class="card"> 21 <view v-for="(item, idx) in lineList" :key="'l-' + (item.id || idx)" class="card">
22 <view class="card-index">第 {{ idx + 1 }} 行</view> 22 <view class="card-index">第 {{ idx + 1 }} 行</view>
23 <view class="row"><text class="label">买断品种</text><text class="value">{{ safeText(item.productName) }}</text></view> 23 <view class="row"><text class="label">买断品种</text><text class="value">{{ safeText(item.productName) }}</text></view>
24 - <view class="row"><text class="label">买断数量</text><text class="value">{{ formatNumber(item.buyoutQuantity) }}</text></view> 24 + <view class="row"><text class="label">买断数量(kg)</text><text class="value">{{ formatNumber(item.buyoutQuantity) }}</text></view>
25 <view class="row"><text class="label">买断单价</text><text class="value">{{ formatNumber(item.buyoutPrice) }}</text></view> 25 <view class="row"><text class="label">买断单价</text><text class="value">{{ formatNumber(item.buyoutPrice) }}</text></view>
26 <view class="row"><text class="label">买断金额</text><text class="value">{{ formatNumber(item.buyoutAmount) }}</text></view> 26 <view class="row"><text class="label">买断金额</text><text class="value">{{ formatNumber(item.buyoutAmount) }}</text></view>
27 - <view class="row"><text class="label">入库数量</text><text class="value">{{ formatNumber(item.instockQuantity) }}</text></view> 27 + <view class="row"><text class="label">入库数量(kg)</text><text class="value">{{ formatNumber(item.instockQuantity) }}</text></view>
28 <view class="row"><text class="label">入库单价</text><text class="value">{{ formatNumber(item.instockPrice) }}</text></view> 28 <view class="row"><text class="label">入库单价</text><text class="value">{{ formatNumber(item.instockPrice) }}</text></view>
29 <view class="row"><text class="label">入库金额</text><text class="value">{{ formatNumber(item.instockAmount) }}</text></view> 29 <view class="row"><text class="label">入库金额</text><text class="value">{{ formatNumber(item.instockAmount) }}</text></view>
30 <view class="row"><text class="label">预计吨损耗(元/吨)</text><text class="value">{{ formatNumber(item.expectTonLoss) }}</text></view> 30 <view class="row"><text class="label">预计吨损耗(元/吨)</text><text class="value">{{ formatNumber(item.expectTonLoss) }}</text></view>
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 <view class="total-title">合计</view> 44 <view class="total-title">合计</view>
45 <view class="total-body"> 45 <view class="total-body">
46 <view class="total-item"> 46 <view class="total-item">
47 - <text class="total-label">买断数量</text> 47 + <text class="total-label">买断数量(kg)</text>
48 <text class="total-value">{{ formatNumber(form.totalBuyoutQuantity) }}</text> 48 <text class="total-value">{{ formatNumber(form.totalBuyoutQuantity) }}</text>
49 </view> 49 </view>
50 <view class="total-item"> 50 <view class="total-item">
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 <text class="total-value">{{ formatNumber(form.totalBuyoutAmount) }}</text> 52 <text class="total-value">{{ formatNumber(form.totalBuyoutAmount) }}</text>
53 </view> 53 </view>
54 <view class="total-item"> 54 <view class="total-item">
55 - <text class="total-label">入库数量</text> 55 + <text class="total-label">入库数量(kg)</text>
56 <text class="total-value">{{ formatNumber(form.totalInstockQuantity) }}</text> 56 <text class="total-value">{{ formatNumber(form.totalInstockQuantity) }}</text>
57 </view> 57 </view>
58 <view class="total-item"> 58 <view class="total-item">
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 </uni-list-item> 63 </uni-list-item>
64 <uni-list-item> 64 <uni-list-item>
65 <template v-slot:body> 65 <template v-slot:body>
66 - <view class="item-title"><text class="required">*</text><text>数量(采购数)</text></view> 66 + <view class="item-title"><text class="required">*</text><text>数量(采购数kg)</text></view>
67 </template> 67 </template>
68 <template v-slot:footer> 68 <template v-slot:footer>
69 <uni-easyinput v-model="item.purchaseQuantity" type="digit" :inputBorder="false" placeholder="请输入采购数" @input="recalcTaxAmount(item)" /> 69 <uni-easyinput v-model="item.purchaseQuantity" type="digit" :inputBorder="false" placeholder="请输入采购数" @input="recalcTaxAmount(item)" />
@@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
71 </uni-list-item> 71 </uni-list-item>
72 <uni-list-item> 72 <uni-list-item>
73 <template v-slot:body> 73 <template v-slot:body>
74 - <view class="item-title"><text class="required">*</text><text>数量(实收数)</text></view> 74 + <view class="item-title"><text class="required">*</text><text>数量(实收数kg)</text></view>
75 </template> 75 </template>
76 <template v-slot:footer> 76 <template v-slot:footer>
77 <uni-easyinput v-model="item.actualQuantity" type="digit" :inputBorder="false" placeholder="请输入实收数" /> 77 <uni-easyinput v-model="item.actualQuantity" type="digit" :inputBorder="false" placeholder="请输入实收数" />
@@ -115,11 +115,11 @@ @@ -115,11 +115,11 @@
115 <view class="total-title">合计</view> 115 <view class="total-title">合计</view>
116 <view class="total-body"> 116 <view class="total-body">
117 <view class="total-item"> 117 <view class="total-item">
118 - <text class="total-label">采购数</text> 118 + <text class="total-label">采购数(kg)</text>
119 <text class="total-value">{{ purchaseQuantityCap }}</text> 119 <text class="total-value">{{ purchaseQuantityCap }}</text>
120 </view> 120 </view>
121 <view class="total-item"> 121 <view class="total-item">
122 - <text class="total-label">实收数</text> 122 + <text class="total-label">实收数(kg)</text>
123 <text class="total-value">{{ totalActualQuantity || '-' }}</text> 123 <text class="total-value">{{ totalActualQuantity || '-' }}</text>
124 </view> 124 </view>
125 <view class="total-item"> 125 <view class="total-item">
@@ -143,9 +143,9 @@ @@ -143,9 +143,9 @@
143 143
144 <!-- 附件 --> 144 <!-- 附件 -->
145 <view class="form-group"> 145 <view class="form-group">
146 - <view class="item-title"><text class="required">*</text><text>附件</text></view> 146 + <view class="item-title"><text>附件</text></view>
147 <view class="upload-btn" @click="selectFile">上传文件</view> 147 <view class="upload-btn" @click="selectFile">上传文件</view>
148 - <view v-if="!fileList.length" class="empty-tip">请上传附件</view> 148 + <view v-if="!fileList.length" class="empty-tip">暂无附件</view>
149 <view v-for="(file, idx) in fileList" :key="file.fileId || idx" class="file-item"> 149 <view v-for="(file, idx) in fileList" :key="file.fileId || idx" class="file-item">
150 <text class="file-name">{{ file.fileName || '未命名文件' }}</text> 150 <text class="file-name">{{ file.fileName || '未命名文件' }}</text>
151 <text class="file-del" @click="removeFile(idx)">删除</text> 151 <text class="file-del" @click="removeFile(idx)">删除</text>
@@ -442,7 +442,6 @@ export default { @@ -442,7 +442,6 @@ export default {
442 if (row.actualQuantity === '' || row.actualQuantity == null) return this.tip(`明细第${i + 1}行:请输入实收数`) 442 if (row.actualQuantity === '' || row.actualQuantity == null) return this.tip(`明细第${i + 1}行:请输入实收数`)
443 if (row.taxPrice === '' || row.taxPrice == null) return this.tip(`明细第${i + 1}行:请输入含税单价`) 443 if (row.taxPrice === '' || row.taxPrice == null) return this.tip(`明细第${i + 1}行:请输入含税单价`)
444 } 444 }
445 - if (!this.fileList.length) return this.tip('请上传附件')  
446 return true 445 return true
447 }, 446 },
448 tip(msg) { 447 tip(msg) {
@@ -29,8 +29,8 @@ @@ -29,8 +29,8 @@
29 <view class="row"><text class="label">材料名称</text><text class="value">{{ safeText(item.name) }}</text></view> 29 <view class="row"><text class="label">材料名称</text><text class="value">{{ safeText(item.name) }}</text></view>
30 <view class="row"><text class="label">规格型号</text><text class="value">{{ safeText(item.specModel) }}</text></view> 30 <view class="row"><text class="label">规格型号</text><text class="value">{{ safeText(item.specModel) }}</text></view>
31 <view class="row"><text class="label">单位</text><text class="value">{{ safeText(item.unit) }}</text></view> 31 <view class="row"><text class="label">单位</text><text class="value">{{ safeText(item.unit) }}</text></view>
32 - <view class="row"><text class="label">数量(采购数)</text><text class="value">{{ formatNumber(item.purchaseQuantity) }}</text></view>  
33 - <view class="row"><text class="label">数量(实收数)</text><text class="value">{{ formatNumber(item.actualQuantity) }}</text></view> 32 + <view class="row"><text class="label">数量(采购数kg)</text><text class="value">{{ formatNumber(item.purchaseQuantity) }}</text></view>
  33 + <view class="row"><text class="label">数量(实收数kg)</text><text class="value">{{ formatNumber(item.actualQuantity) }}</text></view>
34 <view class="row"><text class="label">含税价格(单价)</text><text class="value">{{ formatNumber(item.taxPrice) }}</text></view> 34 <view class="row"><text class="label">含税价格(单价)</text><text class="value">{{ formatNumber(item.taxPrice) }}</text></view>
35 <view class="row"><text class="label">含税价格(金额)</text><text class="value">{{ formatNumber(item.taxAmount) }}</text></view> 35 <view class="row"><text class="label">含税价格(金额)</text><text class="value">{{ formatNumber(item.taxAmount) }}</text></view>
36 <view class="row"><text class="label">不含税价格(单价)</text><text class="value">{{ formatNumber(item.noTaxPrice) }}</text></view> 36 <view class="row"><text class="label">不含税价格(单价)</text><text class="value">{{ formatNumber(item.noTaxPrice) }}</text></view>
@@ -44,11 +44,11 @@ @@ -44,11 +44,11 @@
44 <view class="total-title">合计</view> 44 <view class="total-title">合计</view>
45 <view class="total-body"> 45 <view class="total-body">
46 <view class="total-item"> 46 <view class="total-item">
47 - <text class="total-label">采购数</text> 47 + <text class="total-label">采购数(kg)</text>
48 <text class="total-value">{{ purchaseQuantityCap }}</text> 48 <text class="total-value">{{ purchaseQuantityCap }}</text>
49 </view> 49 </view>
50 <view class="total-item"> 50 <view class="total-item">
51 - <text class="total-label">实收数</text> 51 + <text class="total-label">实收数(kg)</text>
52 <text class="total-value">{{ formatNumber(form.totalActualQuantity) }}</text> 52 <text class="total-value">{{ formatNumber(form.totalActualQuantity) }}</text>
53 </view> 53 </view>
54 <view class="total-item"> 54 <view class="total-item">
@@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
62 </uni-list-item> 62 </uni-list-item>
63 <uni-list-item> 63 <uni-list-item>
64 <template v-slot:body> 64 <template v-slot:body>
65 - <view class="item-title"><text class="required">*</text><text>数量(采购数)</text></view> 65 + <view class="item-title"><text class="required">*</text><text>数量(采购数kg)</text></view>
66 </template> 66 </template>
67 <template v-slot:footer> 67 <template v-slot:footer>
68 <uni-easyinput v-model="item.purchaseQuantity" type="digit" :inputBorder="false" placeholder="请输入采购数" @input="recalcTaxAmount(item)" /> 68 <uni-easyinput v-model="item.purchaseQuantity" type="digit" :inputBorder="false" placeholder="请输入采购数" @input="recalcTaxAmount(item)" />
@@ -70,7 +70,7 @@ @@ -70,7 +70,7 @@
70 </uni-list-item> 70 </uni-list-item>
71 <uni-list-item> 71 <uni-list-item>
72 <template v-slot:body> 72 <template v-slot:body>
73 - <view class="item-title"><text class="required">*</text><text>数量(实收数)</text></view> 73 + <view class="item-title"><text class="required">*</text><text>数量(实收数kg)</text></view>
74 </template> 74 </template>
75 <template v-slot:footer> 75 <template v-slot:footer>
76 <uni-easyinput v-model="item.actualQuantity" type="digit" :inputBorder="false" placeholder="请输入实收数" /> 76 <uni-easyinput v-model="item.actualQuantity" type="digit" :inputBorder="false" placeholder="请输入实收数" />
@@ -114,11 +114,11 @@ @@ -114,11 +114,11 @@
114 <view class="total-title">合计</view> 114 <view class="total-title">合计</view>
115 <view class="total-body"> 115 <view class="total-body">
116 <view class="total-item"> 116 <view class="total-item">
117 - <text class="total-label">采购数</text> 117 + <text class="total-label">采购数(kg)</text>
118 <text class="total-value">{{ purchaseQuantityCap }}</text> 118 <text class="total-value">{{ purchaseQuantityCap }}</text>
119 </view> 119 </view>
120 <view class="total-item"> 120 <view class="total-item">
121 - <text class="total-label">实收数</text> 121 + <text class="total-label">实收数(kg)</text>
122 <text class="total-value">{{ totalActualQuantity || '-' }}</text> 122 <text class="total-value">{{ totalActualQuantity || '-' }}</text>
123 </view> 123 </view>
124 <view class="total-item"> 124 <view class="total-item">
@@ -142,9 +142,9 @@ @@ -142,9 +142,9 @@
142 142
143 <!-- 附件 --> 143 <!-- 附件 -->
144 <view class="form-group"> 144 <view class="form-group">
145 - <view class="item-title"><text class="required">*</text><text>附件</text></view> 145 + <view class="item-title"><text>附件</text></view>
146 <view class="upload-btn" @click="selectFile">上传文件</view> 146 <view class="upload-btn" @click="selectFile">上传文件</view>
147 - <view v-if="!fileList.length" class="empty-tip">请上传附件</view> 147 + <view v-if="!fileList.length" class="empty-tip">暂无附件</view>
148 <view v-for="(file, idx) in fileList" :key="file.fileId || idx" class="file-item"> 148 <view v-for="(file, idx) in fileList" :key="file.fileId || idx" class="file-item">
149 <text class="file-name">{{ file.fileName || '未命名文件' }}</text> 149 <text class="file-name">{{ file.fileName || '未命名文件' }}</text>
150 <text class="file-del" @click="removeFile(idx)">删除</text> 150 <text class="file-del" @click="removeFile(idx)">删除</text>
@@ -369,7 +369,6 @@ export default { @@ -369,7 +369,6 @@ export default {
369 if (row.actualQuantity === '' || row.actualQuantity == null) return this.tip(`明细第${i + 1}行:请输入实收数`) 369 if (row.actualQuantity === '' || row.actualQuantity == null) return this.tip(`明细第${i + 1}行:请输入实收数`)
370 if (row.taxPrice === '' || row.taxPrice == null) return this.tip(`明细第${i + 1}行:请输入含税单价`) 370 if (row.taxPrice === '' || row.taxPrice == null) return this.tip(`明细第${i + 1}行:请输入含税单价`)
371 } 371 }
372 - if (!this.fileList.length) return this.tip('请上传附件')  
373 return true 372 return true
374 }, 373 },
375 tip(msg) { 374 tip(msg) {
@@ -24,9 +24,9 @@ @@ -24,9 +24,9 @@
24 <view class="row"><text class="label">材料名称</text><text class="value">{{ safeText(item.name) }}</text></view> 24 <view class="row"><text class="label">材料名称</text><text class="value">{{ safeText(item.name) }}</text></view>
25 <view class="row"><text class="label">规格型号</text><text class="value">{{ safeText(item.specModel) }}</text></view> 25 <view class="row"><text class="label">规格型号</text><text class="value">{{ safeText(item.specModel) }}</text></view>
26 <view class="row"><text class="label">单位</text><text class="value">{{ safeText(item.unit) }}</text></view> 26 <view class="row"><text class="label">单位</text><text class="value">{{ safeText(item.unit) }}</text></view>
27 - <view class="row"><text class="label">数量(采购数)</text><text class="value">{{ formatNumber(item.purchaseQuantity) }}</text></view> 27 + <view class="row"><text class="label">数量(采购数kg)</text><text class="value">{{ formatNumber(item.purchaseQuantity) }}</text></view>
28 <view class="row actual-row"> 28 <view class="row actual-row">
29 - <view class="label"><text v-if="canEditActualQuantity" class="required">*</text><text>数量(实收数)</text></view> 29 + <view class="label"><text v-if="canEditActualQuantity" class="required">*</text><text>数量(实收数kg)</text></view>
30 <view class="actual-value"> 30 <view class="actual-value">
31 <uni-easyinput v-if="canEditActualQuantity" v-model="item.actualQuantity" type="digit" 31 <uni-easyinput v-if="canEditActualQuantity" v-model="item.actualQuantity" type="digit"
32 :inputBorder="false" placeholder="请输入实收数" /> 32 :inputBorder="false" placeholder="请输入实收数" />
@@ -50,11 +50,11 @@ @@ -50,11 +50,11 @@
50 <view class="total-title">合计</view> 50 <view class="total-title">合计</view>
51 <view class="total-body"> 51 <view class="total-body">
52 <view class="total-item"> 52 <view class="total-item">
53 - <text class="total-label">采购数</text> 53 + <text class="total-label">采购数(kg)</text>
54 <text class="total-value">{{ purchaseQuantityCap }}</text> 54 <text class="total-value">{{ purchaseQuantityCap }}</text>
55 </view> 55 </view>
56 <view class="total-item"> 56 <view class="total-item">
57 - <text class="total-label">实收数</text> 57 + <text class="total-label">实收数(kg)</text>
58 <text class="total-value">{{ formatNumber(form.totalActualQuantity) }}</text> 58 <text class="total-value">{{ formatNumber(form.totalActualQuantity) }}</text>
59 </view> 59 </view>
60 <view class="total-item"> 60 <view class="total-item">
@@ -79,7 +79,7 @@ @@ -79,7 +79,7 @@
79 <uni-easyinput :value="item.productName" :inputBorder="false" disabled /> 79 <uni-easyinput :value="item.productName" :inputBorder="false" disabled />
80 </template> 80 </template>
81 </uni-list-item> 81 </uni-list-item>
82 - <uni-list-item title="计划数量"> 82 + <uni-list-item title="计划数量(kg)">
83 <template v-slot:footer> 83 <template v-slot:footer>
84 <uni-easyinput :value="item.quantity" :inputBorder="false" disabled /> 84 <uni-easyinput :value="item.quantity" :inputBorder="false" disabled />
85 </template> 85 </template>
@@ -135,7 +135,7 @@ @@ -135,7 +135,7 @@
135 </uni-list-item> 135 </uni-list-item>
136 <uni-list-item title="过磅数量"> 136 <uni-list-item title="过磅数量">
137 <template v-slot:body> 137 <template v-slot:body>
138 - <view class="item-title"><text class="required">*</text><text>过磅数量</text></view> 138 + <view class="item-title"><text class="required">*</text><text>过磅数量(kg)</text></view>
139 </template> 139 </template>
140 <template v-slot:footer> 140 <template v-slot:footer>
141 <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入过磅数量" /> 141 <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入过磅数量" />
@@ -179,7 +179,7 @@ @@ -179,7 +179,7 @@
179 </uni-list-item> 179 </uni-list-item>
180 <uni-list-item title="数量"> 180 <uni-list-item title="数量">
181 <template v-slot:body> 181 <template v-slot:body>
182 - <view class="item-title"><text class="required">*</text><text>数量</text></view> 182 + <view class="item-title"><text class="required">*</text><text>数量(kg)</text></view>
183 </template> 183 </template>
184 <template v-slot:footer> 184 <template v-slot:footer>
185 <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入数量" /> 185 <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入数量" />
@@ -210,7 +210,7 @@ @@ -210,7 +210,7 @@
210 </uni-list-item> 210 </uni-list-item>
211 <uni-list-item> 211 <uni-list-item>
212 <template v-slot:body> 212 <template v-slot:body>
213 - <view class="item-title"><text class="required">*</text><text>过磅总重</text></view> 213 + <view class="item-title"><text class="required">*</text><text>过磅总重(kg)</text></view>
214 </template> 214 </template>
215 <template v-slot:footer> 215 <template v-slot:footer>
216 <uni-easyinput v-model="form.totalGrossWeight" type="digit" :inputBorder="false" placeholder="请输入过磅总重" /> 216 <uni-easyinput v-model="form.totalGrossWeight" type="digit" :inputBorder="false" placeholder="请输入过磅总重" />
@@ -218,13 +218,13 @@ @@ -218,13 +218,13 @@
218 </uni-list-item> 218 </uni-list-item>
219 <uni-list-item> 219 <uni-list-item>
220 <template v-slot:body> 220 <template v-slot:body>
221 - <view class="item-title"><text class="required">*</text><text>实际伙重</text></view> 221 + <view class="item-title"><text class="required">*</text><text>实际伙重(kg)</text></view>
222 </template> 222 </template>
223 <template v-slot:footer> 223 <template v-slot:footer>
224 <uni-easyinput v-model="form.actualImpurityWeight" type="digit" :inputBorder="false" placeholder="请输入实际伙重" /> 224 <uni-easyinput v-model="form.actualImpurityWeight" type="digit" :inputBorder="false" placeholder="请输入实际伙重" />
225 </template> 225 </template>
226 </uni-list-item> 226 </uni-list-item>
227 - <uni-list-item title="货物净重"> 227 + <uni-list-item title="货物净重(kg)">
228 <template v-slot:footer> 228 <template v-slot:footer>
229 <uni-easyinput :value="computedNetWeight" :inputBorder="false" disabled /> 229 <uni-easyinput :value="computedNetWeight" :inputBorder="false" disabled />
230 </template> 230 </template>
@@ -251,7 +251,16 @@ @@ -251,7 +251,16 @@
251 <uni-list> 251 <uni-list>
252 <uni-list-item> 252 <uni-list-item>
253 <template v-slot:body> 253 <template v-slot:body>
254 - <view class="item-title"><text class="required">*</text><text>供应存欠料</text></view> 254 + <view class="item-title"><text>来料类型备注</text></view>
  255 + </template>
  256 + <template v-slot:footer>
  257 + <uni-easyinput class="deduction-remark-input" v-model="form.deductionTypeRemark"
  258 + type="textarea" :inputBorder="false" placeholder="请输入来料类型备注" autoHeight />
  259 + </template>
  260 + </uni-list-item>
  261 + <uni-list-item>
  262 + <template v-slot:body>
  263 + <view class="item-title"><text>供应存欠料</text></view>
255 </template> 264 </template>
256 <template v-slot:footer> 265 <template v-slot:footer>
257 <uni-easyinput v-model="form.supplierStockMaterial" :inputBorder="false" placeholder="请输入供应存欠料" /> 266 <uni-easyinput v-model="form.supplierStockMaterial" :inputBorder="false" placeholder="请输入供应存欠料" />
@@ -259,7 +268,7 @@ @@ -259,7 +268,7 @@
259 </uni-list-item> 268 </uni-list-item>
260 <uni-list-item> 269 <uni-list-item>
261 <template v-slot:body> 270 <template v-slot:body>
262 - <view class="item-title"><text class="required">*</text><text>物流存欠料</text></view> 271 + <view class="item-title"><text>物流存欠料</text></view>
263 </template> 272 </template>
264 <template v-slot:footer> 273 <template v-slot:footer>
265 <uni-easyinput v-model="form.logisticsStockMaterial" :inputBorder="false" placeholder="请输入物流存欠料" /> 274 <uni-easyinput v-model="form.logisticsStockMaterial" :inputBorder="false" placeholder="请输入物流存欠料" />
@@ -319,7 +328,7 @@ import { @@ -319,7 +328,7 @@ import {
319 weighTicketCreateApi 328 weighTicketCreateApi
320 } from '@/api/procure-manage/weighTicket.js' 329 } from '@/api/procure-manage/weighTicket.js'
321 import { breedRelationshipQueryApi } from '@/api/procure-manage/salesmanQuotation.js' 330 import { breedRelationshipQueryApi } from '@/api/procure-manage/salesmanQuotation.js'
322 -import { getDicByCodes, getDicName } from '@/utils/dic.js' 331 +import { getDicByCodes } from '@/utils/dic.js'
323 332
324 export default { 333 export default {
325 name: 'AddWeightTicket', 334 name: 'AddWeightTicket',
@@ -336,6 +345,7 @@ export default { @@ -336,6 +345,7 @@ export default {
336 totalGrossWeight: '', 345 totalGrossWeight: '',
337 actualImpurityWeight: '', 346 actualImpurityWeight: '',
338 deductionTypes: [], 347 deductionTypes: [],
  348 + deductionTypeRemark: '',
339 supplierStockMaterial: '', 349 supplierStockMaterial: '',
340 logisticsStockMaterial: '', 350 logisticsStockMaterial: '',
341 plateNumber: '', 351 plateNumber: '',
@@ -420,6 +430,14 @@ export default { @@ -420,6 +430,14 @@ export default {
420 if (net === '' || net === null || net === undefined) return '' 430 if (net === '' || net === null || net === undefined) return ''
421 return numberToChineseUpper(net) 431 return numberToChineseUpper(net)
422 }, 432 },
  433 + // 过磅数量合计
  434 + weightQuantityTotal() {
  435 + const total = (this.weighList || []).reduce((sum, item) => {
  436 + const qty = Number(item.quantity)
  437 + return sum + (isNaN(qty) ? 0 : qty)
  438 + }, 0)
  439 + return Math.round(total * 100) / 100
  440 + },
423 // 业务摘要 441 // 业务摘要
424 computedBusinessSummary() { 442 computedBusinessSummary() {
425 const parts = [] 443 const parts = []
@@ -432,10 +450,9 @@ export default { @@ -432,10 +450,9 @@ export default {
432 }) 450 })
433 .filter(text => !!text) 451 .filter(text => !!text)
434 if (weightItems.length) parts.push(weightItems.join('、')) 452 if (weightItems.length) parts.push(weightItems.join('、'))
435 - const deductionNames = (this.form.deductionTypes || [])  
436 - .map(code => getDicName('DEDUCTION_TYPE', code, this.dicOptions.DEDUCTION_TYPE))  
437 - .filter(name => !!name)  
438 - if (deductionNames.length) parts.push(deductionNames.join('、')) 453 + // 来料扣杂类型段落以「来料类型备注」文本为准(用户可自由修改)
  454 + const deductionSegment = (this.form.deductionTypeRemark || '').trim()
  455 + if (deductionSegment) parts.push(deductionSegment)
439 if (this.form.supplierStockMaterial) parts.push(`供应存欠料:${this.form.supplierStockMaterial}`) 456 if (this.form.supplierStockMaterial) parts.push(`供应存欠料:${this.form.supplierStockMaterial}`)
440 if (this.form.logisticsStockMaterial) parts.push(`物流存欠料:${this.form.logisticsStockMaterial}`) 457 if (this.form.logisticsStockMaterial) parts.push(`物流存欠料:${this.form.logisticsStockMaterial}`)
441 if (this.form.plateNumber) parts.push(`车牌号:${this.form.plateNumber}`) 458 if (this.form.plateNumber) parts.push(`车牌号:${this.form.plateNumber}`)
@@ -448,6 +465,15 @@ export default { @@ -448,6 +465,15 @@ export default {
448 return [summary, note].filter(text => !!text).join('\n') 465 return [summary, note].filter(text => !!text).join('\n')
449 } 466 }
450 }, 467 },
  468 + watch: {
  469 + // 来料扣杂类型增减时,同步维护「来料类型备注」文本(保留用户已填写的数字等内容)
  470 + 'form.deductionTypes': {
  471 + deep: true,
  472 + handler(list) {
  473 + this.syncDeductionRemark(list)
  474 + }
  475 + }
  476 + },
451 created() { 477 created() {
452 this.planSheet.fetchFn = this.fetchPlans.bind(this) 478 this.planSheet.fetchFn = this.fetchPlans.bind(this)
453 this.loadDicData() 479 this.loadDicData()
@@ -494,6 +520,31 @@ export default { @@ -494,6 +520,31 @@ export default {
494 }) 520 })
495 .catch(() => {}) 521 .catch(() => {})
496 }, 522 },
  523 + // 按所选扣杂类型同步备注文本:移除已取消的类型、补充新增的类型,保留用户已填写的后缀内容
  524 + syncDeductionRemark(list) {
  525 + const selected = (list || []).map(code => String(code))
  526 + const names = this.deductionTypeOptions
  527 + .filter(it => selected.includes(it.value))
  528 + .map(it => it.text)
  529 + .filter(name => !!name)
  530 + const segments = (this.form.deductionTypeRemark || '')
  531 + .split('、')
  532 + .map(text => text.trim())
  533 + .filter(text => !!text)
  534 + // 名称按长度倒序匹配,避免「水」误匹配「水杂」这类前缀相同的情况
  535 + const sortedNames = names.slice().sort((a, b) => b.length - a.length)
  536 + const matched = []
  537 + segments.forEach(text => {
  538 + const name = sortedNames.find(item => text.startsWith(item))
  539 + if (!name) return
  540 + if (!matched.some(item => item.name === name)) matched.push({ name, text })
  541 + })
  542 + const result = names.map(name => {
  543 + const found = matched.find(item => item.name === name)
  544 + return found ? found.text : name
  545 + })
  546 + this.form.deductionTypeRemark = result.join('、')
  547 + },
497 // 计划选择弹窗数据源 548 // 计划选择弹窗数据源
498 fetchPlans({ pageIndex, pageSize, extra }) { 549 fetchPlans({ pageIndex, pageSize, extra }) {
499 const keyword = (extra && extra.keyword) || '' 550 const keyword = (extra && extra.keyword) || ''
@@ -563,11 +614,16 @@ export default { @@ -563,11 +614,16 @@ export default {
563 row.productName = '' 614 row.productName = ''
564 row.invoiceProductName = '' 615 row.invoiceProductName = ''
565 }, 616 },
  617 + // 当前行可选的品种(同一计划下已被其他行选中的品种不再展示)
  618 + getWeightProductOptions(item) {
  619 + const used = (this.weighList || [])
  620 + .filter(row => row !== item && row.planCode === item.planCode && row.productId && row.productId !== item.productId)
  621 + .map(row => row.productId)
  622 + return (this.planList || []).filter(it => it.planCode === item.planCode && !used.includes(it.productId))
  623 + },
566 // 当前计划编号下的品种选项 624 // 当前计划编号下的品种选项
567 getWeightProductLabels(item) { 625 getWeightProductLabels(item) {
568 - return (this.planList || [])  
569 - .filter(it => it.planCode === item.planCode)  
570 - .map(it => it.productName || '') 626 + return this.getWeightProductOptions(item).map(it => it.productName || '')
571 }, 627 },
572 getWeightProductLabel(item) { 628 getWeightProductLabel(item) {
573 if (!item.productId) return '' 629 if (!item.productId) return ''
@@ -577,7 +633,7 @@ export default { @@ -577,7 +633,7 @@ export default {
577 // 过磅品种改选:整行替换为对应计划明细数据(保留行id与计划编号) 633 // 过磅品种改选:整行替换为对应计划明细数据(保留行id与计划编号)
578 handleWeightProductChange(idx, optIdx) { 634 handleWeightProductChange(idx, optIdx) {
579 const row = this.weighList[idx] 635 const row = this.weighList[idx]
580 - const options = (this.planList || []).filter(it => it.planCode === row.planCode) 636 + const options = this.getWeightProductOptions(row)
581 const raw = options[optIdx] 637 const raw = options[optIdx]
582 if (!raw) return 638 if (!raw) return
583 this.weighList.splice(idx, 1, { 639 this.weighList.splice(idx, 1, {
@@ -629,8 +685,8 @@ export default { @@ -629,8 +685,8 @@ export default {
629 if (f.totalGrossWeight === '' || f.totalGrossWeight == null) return this.tip('请输入过磅总重') 685 if (f.totalGrossWeight === '' || f.totalGrossWeight == null) return this.tip('请输入过磅总重')
630 if (f.actualImpurityWeight === '' || f.actualImpurityWeight == null) return this.tip('请输入实际伙重') 686 if (f.actualImpurityWeight === '' || f.actualImpurityWeight == null) return this.tip('请输入实际伙重')
631 if (!f.deductionTypes || !f.deductionTypes.length) return this.tip('请选择来料扣杂类型') 687 if (!f.deductionTypes || !f.deductionTypes.length) return this.tip('请选择来料扣杂类型')
632 - if (!f.supplierStockMaterial) return this.tip('请输入供应存欠料')  
633 - if (!f.logisticsStockMaterial) return this.tip('请输入物流存欠料') 688 + // if (!f.supplierStockMaterial) return this.tip('请输入供应存欠料')
  689 + // if (!f.logisticsStockMaterial) return this.tip('请输入物流存欠料')
634 if (!f.plateNumber) return this.tip('请输入车牌号') 690 if (!f.plateNumber) return this.tip('请输入车牌号')
635 // 过磅明细:计划编号、品种、数量必填 691 // 过磅明细:计划编号、品种、数量必填
636 const weightList = this.weighList || [] 692 const weightList = this.weighList || []
@@ -689,12 +745,24 @@ export default { @@ -689,12 +745,24 @@ export default {
689 documentRemark: this.computedDocumentRemark || null 745 documentRemark: this.computedDocumentRemark || null
690 } 746 }
691 }, 747 },
  748 + // 过磅数量合计与货物净重不一致时二次确认
  749 + async confirmQuantityMismatch() {
  750 + const net = this.computedNetWeight
  751 + if (net === '' || net === null || net === undefined) return true
  752 + const netNum = Math.round(Number(net) * 100) / 100
  753 + if (this.weightQuantityTotal === netNum) return true
  754 + const res = await new Promise(resolve => {
  755 + uni.showModal({ title: '提示', content: '过磅数量总和货物净重不一致,确定保存吗?', confirmText: '确定', cancelText: '取消', success: resolve })
  756 + })
  757 + return !!(res && res.confirm)
  758 + },
692 async onSubmit() { 759 async onSubmit() {
693 if (!this.validate()) return 760 if (!this.validate()) return
694 const confirmRes = await new Promise(resolve => { 761 const confirmRes = await new Promise(resolve => {
695 uni.showModal({ title: '提示', content: '确定保存过磅单吗?', confirmText: '确定', cancelText: '取消', success: resolve }) 762 uni.showModal({ title: '提示', content: '确定保存过磅单吗?', confirmText: '确定', cancelText: '取消', success: resolve })
696 }) 763 })
697 if (!(confirmRes && confirmRes.confirm)) return 764 if (!(confirmRes && confirmRes.confirm)) return
  765 + if (!(await this.confirmQuantityMismatch())) return
698 uni.showLoading({ title: '提交中...', mask: true }) 766 uni.showLoading({ title: '提交中...', mask: true })
699 weighTicketCreateApi(this.buildSubmitData()) 767 weighTicketCreateApi(this.buildSubmitData())
700 .then(() => { 768 .then(() => {
@@ -1050,6 +1118,12 @@ function numberToChineseUpper(num) { @@ -1050,6 +1118,12 @@ function numberToChineseUpper(num) {
1050 } 1118 }
1051 } 1119 }
1052 1120
  1121 +// 来料类型备注:textarea 占满剩余宽度
  1122 +.deduction-remark-input {
  1123 + flex: 1;
  1124 + width: 100%;
  1125 +}
  1126 +
1053 .remark-group { 1127 .remark-group {
1054 margin-bottom: 32rpx; 1128 margin-bottom: 32rpx;
1055 1129
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 <view class="card-index">第 {{ idx + 1 }} 行</view> 29 <view class="card-index">第 {{ idx + 1 }} 行</view>
30 <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(item.planCode) }}</text></view> 30 <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(item.planCode) }}</text></view>
31 <view class="row"><text class="label">计划品种</text><text class="value">{{ safeText(item.productName) }}</text></view> 31 <view class="row"><text class="label">计划品种</text><text class="value">{{ safeText(item.productName) }}</text></view>
32 - <view class="row"><text class="label">计划数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 32 + <view class="row"><text class="label">计划数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
33 </view> 33 </view>
34 </view> 34 </view>
35 </view> 35 </view>
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(item.planCode) }}</text></view> 51 <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(item.planCode) }}</text></view>
52 <view class="row"><text class="label">过磅品种</text><text class="value">{{ safeText(item.productName) }}</text></view> 52 <view class="row"><text class="label">过磅品种</text><text class="value">{{ safeText(item.productName) }}</text></view>
53 <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(item.invoiceProductName) }}</text></view> 53 <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(item.invoiceProductName) }}</text></view>
54 - <view class="row"><text class="label">过磅数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 54 + <view class="row"><text class="label">过磅数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
55 </view> 55 </view>
56 </view> 56 </view>
57 </view> 57 </view>
@@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
71 <view v-for="(item, idx) in applyList" :key="'a-' + (item.id || idx)" class="card"> 71 <view v-for="(item, idx) in applyList" :key="'a-' + (item.id || idx)" class="card">
72 <view class="card-index">第 {{ idx + 1 }} 行</view> 72 <view class="card-index">第 {{ idx + 1 }} 行</view>
73 <view class="row"><text class="label">类别</text><text class="value">{{ safeText(item.category) }}</text></view> 73 <view class="row"><text class="label">类别</text><text class="value">{{ safeText(item.category) }}</text></view>
74 - <view class="row"><text class="label">数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 74 + <view class="row"><text class="label">数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
75 </view> 75 </view>
76 </view> 76 </view>
77 </view> 77 </view>
@@ -83,9 +83,9 @@ @@ -83,9 +83,9 @@
83 </view> 83 </view>
84 <view class="section"> 84 <view class="section">
85 <view class="row"><text class="label">物料名称</text><text class="value">{{ safeText(form.materialName) }}</text></view> 85 <view class="row"><text class="label">物料名称</text><text class="value">{{ safeText(form.materialName) }}</text></view>
86 - <view class="row"><text class="label">过磅总重</text><text class="value">{{ formatNumber(form.totalGrossWeight) }}</text></view>  
87 - <view class="row"><text class="label">实际伙重</text><text class="value">{{ formatNumber(form.actualImpurityWeight) }}</text></view>  
88 - <view class="row"><text class="label">货物净重</text><text class="value">{{ formatNumber(form.netWeight) }}</text></view> 86 + <view class="row"><text class="label">过磅总重(kg)</text><text class="value">{{ formatNumber(form.totalGrossWeight) }}</text></view>
  87 + <view class="row"><text class="label">实际伙重(kg)</text><text class="value">{{ formatNumber(form.actualImpurityWeight) }}</text></view>
  88 + <view class="row"><text class="label">货物净重(kg)</text><text class="value">{{ formatNumber(form.netWeight) }}</text></view>
89 <view class="row"><text class="label">净重大写</text><text class="value">{{ safeText(form.netWeightUpper) }}</text></view> 89 <view class="row"><text class="label">净重大写</text><text class="value">{{ safeText(form.netWeightUpper) }}</text></view>
90 <view class="row"><text class="label">来料扣杂类型</text><text class="value">{{ deductionNames }}</text></view> 90 <view class="row"><text class="label">来料扣杂类型</text><text class="value">{{ deductionNames }}</text></view>
91 <view class="row"><text class="label">供应存欠料</text><text class="value">{{ safeText(form.supplierStockMaterial) }}</text></view> 91 <view class="row"><text class="label">供应存欠料</text><text class="value">{{ safeText(form.supplierStockMaterial) }}</text></view>
@@ -72,7 +72,7 @@ @@ -72,7 +72,7 @@
72 <uni-easyinput :value="item.productName" :inputBorder="false" disabled /> 72 <uni-easyinput :value="item.productName" :inputBorder="false" disabled />
73 </template> 73 </template>
74 </uni-list-item> 74 </uni-list-item>
75 - <uni-list-item title="计划数量"> 75 + <uni-list-item title="计划数量(kg)">
76 <template v-slot:footer> 76 <template v-slot:footer>
77 <uni-easyinput :value="item.quantity" :inputBorder="false" disabled /> 77 <uni-easyinput :value="item.quantity" :inputBorder="false" disabled />
78 </template> 78 </template>
@@ -133,9 +133,9 @@ @@ -133,9 +133,9 @@
133 <uni-easyinput v-model="item.invoiceProductName" :inputBorder="false" disabled /> 133 <uni-easyinput v-model="item.invoiceProductName" :inputBorder="false" disabled />
134 </template> 134 </template>
135 </uni-list-item> 135 </uni-list-item>
136 - <uni-list-item title="过磅数量"> 136 + <uni-list-item title="过磅数量(kg)">
137 <template v-slot:body> 137 <template v-slot:body>
138 - <view class="item-title"><text class="required">*</text><text>过磅数量</text></view> 138 + <view class="item-title"><text class="required">*</text><text>过磅数量(kg)</text></view>
139 </template> 139 </template>
140 <template v-slot:footer> 140 <template v-slot:footer>
141 <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入过磅数量" /> 141 <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入过磅数量" />
@@ -180,7 +180,7 @@ @@ -180,7 +180,7 @@
180 </uni-list-item> 180 </uni-list-item>
181 <uni-list-item title="数量"> 181 <uni-list-item title="数量">
182 <template v-slot:body> 182 <template v-slot:body>
183 - <view class="item-title"><text class="required">*</text><text>数量</text></view> 183 + <view class="item-title"><text class="required">*</text><text>数量(kg)</text></view>
184 </template> 184 </template>
185 <template v-slot:footer> 185 <template v-slot:footer>
186 <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入数量" :disabled="isReweigh" /> 186 <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入数量" :disabled="isReweigh" />
@@ -211,7 +211,7 @@ @@ -211,7 +211,7 @@
211 </uni-list-item> 211 </uni-list-item>
212 <uni-list-item> 212 <uni-list-item>
213 <template v-slot:body> 213 <template v-slot:body>
214 - <view class="item-title"><text class="required">*</text><text>过磅总重</text></view> 214 + <view class="item-title"><text class="required">*</text><text>过磅总重(kg)</text></view>
215 </template> 215 </template>
216 <template v-slot:footer> 216 <template v-slot:footer>
217 <uni-easyinput v-model="form.totalGrossWeight" type="digit" :inputBorder="false" placeholder="请输入过磅总重" /> 217 <uni-easyinput v-model="form.totalGrossWeight" type="digit" :inputBorder="false" placeholder="请输入过磅总重" />
@@ -219,13 +219,13 @@ @@ -219,13 +219,13 @@
219 </uni-list-item> 219 </uni-list-item>
220 <uni-list-item> 220 <uni-list-item>
221 <template v-slot:body> 221 <template v-slot:body>
222 - <view class="item-title"><text class="required">*</text><text>实际伙重</text></view> 222 + <view class="item-title"><text class="required">*</text><text>实际伙重(kg)</text></view>
223 </template> 223 </template>
224 <template v-slot:footer> 224 <template v-slot:footer>
225 <uni-easyinput v-model="form.actualImpurityWeight" type="digit" :inputBorder="false" placeholder="请输入实际伙重" /> 225 <uni-easyinput v-model="form.actualImpurityWeight" type="digit" :inputBorder="false" placeholder="请输入实际伙重" />
226 </template> 226 </template>
227 </uni-list-item> 227 </uni-list-item>
228 - <uni-list-item title="货物净重"> 228 + <uni-list-item title="货物净重(kg)">
229 <template v-slot:footer> 229 <template v-slot:footer>
230 <uni-easyinput :value="computedNetWeight" :inputBorder="false" disabled /> 230 <uni-easyinput :value="computedNetWeight" :inputBorder="false" disabled />
231 </template> 231 </template>
@@ -252,7 +252,16 @@ @@ -252,7 +252,16 @@
252 <uni-list> 252 <uni-list>
253 <uni-list-item> 253 <uni-list-item>
254 <template v-slot:body> 254 <template v-slot:body>
255 - <view class="item-title"><text class="required">*</text><text>供应存欠料</text></view> 255 + <view class="item-title"><text>来料类型备注</text></view>
  256 + </template>
  257 + <template v-slot:footer>
  258 + <uni-easyinput class="deduction-remark-input" v-model="form.deductionTypeRemark"
  259 + type="textarea" :inputBorder="false" placeholder="请输入来料类型备注" autoHeight />
  260 + </template>
  261 + </uni-list-item>
  262 + <uni-list-item>
  263 + <template v-slot:body>
  264 + <view class="item-title"><text>供应存欠料</text></view>
256 </template> 265 </template>
257 <template v-slot:footer> 266 <template v-slot:footer>
258 <uni-easyinput v-model="form.supplierStockMaterial" :inputBorder="false" placeholder="请输入供应存欠料" /> 267 <uni-easyinput v-model="form.supplierStockMaterial" :inputBorder="false" placeholder="请输入供应存欠料" />
@@ -260,7 +269,7 @@ @@ -260,7 +269,7 @@
260 </uni-list-item> 269 </uni-list-item>
261 <uni-list-item> 270 <uni-list-item>
262 <template v-slot:body> 271 <template v-slot:body>
263 - <view class="item-title"><text class="required">*</text><text>物流存欠料</text></view> 272 + <view class="item-title"><text>物流存欠料</text></view>
264 </template> 273 </template>
265 <template v-slot:footer> 274 <template v-slot:footer>
266 <uni-easyinput v-model="form.logisticsStockMaterial" :inputBorder="false" placeholder="请输入物流存欠料" /> 275 <uni-easyinput v-model="form.logisticsStockMaterial" :inputBorder="false" placeholder="请输入物流存欠料" />
@@ -320,7 +329,7 @@ import { @@ -320,7 +329,7 @@ import {
320 weighTicketUpdateApi 329 weighTicketUpdateApi
321 } from '@/api/procure-manage/weighTicket.js' 330 } from '@/api/procure-manage/weighTicket.js'
322 import { breedRelationshipQueryApi } from '@/api/procure-manage/salesmanQuotation.js' 331 import { breedRelationshipQueryApi } from '@/api/procure-manage/salesmanQuotation.js'
323 -import { getDicByCodes, getDicName } from '@/utils/dic.js' 332 +import { getDicByCodes } from '@/utils/dic.js'
324 333
325 export default { 334 export default {
326 name: 'ModifyWeightTicket', 335 name: 'ModifyWeightTicket',
@@ -338,6 +347,7 @@ export default { @@ -338,6 +347,7 @@ export default {
338 totalGrossWeight: '', 347 totalGrossWeight: '',
339 actualImpurityWeight: '', 348 actualImpurityWeight: '',
340 deductionTypes: [], 349 deductionTypes: [],
  350 + deductionTypeRemark: '',
341 supplierStockMaterial: '', 351 supplierStockMaterial: '',
342 logisticsStockMaterial: '', 352 logisticsStockMaterial: '',
343 plateNumber: '', 353 plateNumber: '',
@@ -426,6 +436,14 @@ export default { @@ -426,6 +436,14 @@ export default {
426 if (net === '' || net === null || net === undefined) return '' 436 if (net === '' || net === null || net === undefined) return ''
427 return numberToChineseUpper(net) 437 return numberToChineseUpper(net)
428 }, 438 },
  439 + // 过磅数量合计
  440 + weightQuantityTotal() {
  441 + const total = (this.weighList || []).reduce((sum, item) => {
  442 + const qty = Number(item.quantity)
  443 + return sum + (isNaN(qty) ? 0 : qty)
  444 + }, 0)
  445 + return Math.round(total * 100) / 100
  446 + },
429 // 业务摘要 447 // 业务摘要
430 computedBusinessSummary() { 448 computedBusinessSummary() {
431 const parts = [] 449 const parts = []
@@ -438,10 +456,9 @@ export default { @@ -438,10 +456,9 @@ export default {
438 }) 456 })
439 .filter(text => !!text) 457 .filter(text => !!text)
440 if (weightItems.length) parts.push(weightItems.join('、')) 458 if (weightItems.length) parts.push(weightItems.join('、'))
441 - const deductionNames = (this.form.deductionTypes || [])  
442 - .map(code => getDicName('DEDUCTION_TYPE', code, this.dicOptions.DEDUCTION_TYPE))  
443 - .filter(name => !!name)  
444 - if (deductionNames.length) parts.push(deductionNames.join('、')) 459 + // 来料扣杂类型段落以「来料类型备注」文本为准(用户可自由修改)
  460 + const deductionSegment = (this.form.deductionTypeRemark || '').trim()
  461 + if (deductionSegment) parts.push(deductionSegment)
445 if (this.form.supplierStockMaterial) parts.push(`供应存欠料:${this.form.supplierStockMaterial}`) 462 if (this.form.supplierStockMaterial) parts.push(`供应存欠料:${this.form.supplierStockMaterial}`)
446 if (this.form.logisticsStockMaterial) parts.push(`物流存欠料:${this.form.logisticsStockMaterial}`) 463 if (this.form.logisticsStockMaterial) parts.push(`物流存欠料:${this.form.logisticsStockMaterial}`)
447 if (this.form.plateNumber) parts.push(`车牌号:${this.form.plateNumber}`) 464 if (this.form.plateNumber) parts.push(`车牌号:${this.form.plateNumber}`)
@@ -454,14 +471,23 @@ export default { @@ -454,14 +471,23 @@ export default {
454 return [summary, note].filter(text => !!text).join('\n') 471 return [summary, note].filter(text => !!text).join('\n')
455 } 472 }
456 }, 473 },
  474 + watch: {
  475 + // 来料扣杂类型增减时,同步维护「来料类型备注」文本(保留用户已填写的数字等内容)
  476 + 'form.deductionTypes': {
  477 + deep: true,
  478 + handler(list) {
  479 + this.syncDeductionRemark(list)
  480 + }
  481 + }
  482 + },
457 onLoad(query) { 483 onLoad(query) {
458 this.id = (query && query.id) || '' 484 this.id = (query && query.id) || ''
459 }, 485 },
460 created() { 486 created() {
461 this.planSheet.fetchFn = this.fetchPlans.bind(this) 487 this.planSheet.fetchFn = this.fetchPlans.bind(this)
462 - this.loadDicData()  
463 this.loadVarietyOptions() 488 this.loadVarietyOptions()
464 - this.loadDetail() 489 + // 先加载字典,再回显详情,保证来料类型备注能正确解析
  490 + this.loadDicData().finally(() => this.loadDetail())
465 }, 491 },
466 methods: { 492 methods: {
467 async loadDicData() { 493 async loadDicData() {
@@ -482,6 +508,53 @@ export default { @@ -482,6 +508,53 @@ export default {
482 this.varietyOptions = [] 508 this.varietyOptions = []
483 } 509 }
484 }, 510 },
  511 + // 当前已选扣杂类型的名称
  512 + getSelectedDeductionNames() {
  513 + const selected = (this.form.deductionTypes || []).map(code => String(code))
  514 + return this.deductionTypeOptions
  515 + .filter(it => selected.includes(it.value))
  516 + .map(it => it.text)
  517 + .filter(name => !!name)
  518 + },
  519 + // 按所选扣杂类型同步备注文本:移除已取消的类型、补充新增的类型,保留用户已填写的后缀内容
  520 + syncDeductionRemark(list) {
  521 + const selected = (list || []).map(code => String(code))
  522 + const names = this.deductionTypeOptions
  523 + .filter(it => selected.includes(it.value))
  524 + .map(it => it.text)
  525 + .filter(name => !!name)
  526 + const segments = (this.form.deductionTypeRemark || '')
  527 + .split('、')
  528 + .map(text => text.trim())
  529 + .filter(text => !!text)
  530 + // 名称按长度倒序匹配,避免「水」误匹配「水杂」这类前缀相同的情况
  531 + const sortedNames = names.slice().sort((a, b) => b.length - a.length)
  532 + const matched = []
  533 + segments.forEach(text => {
  534 + const name = sortedNames.find(item => text.startsWith(item))
  535 + if (!name) return
  536 + if (!matched.some(item => item.name === name)) matched.push({ name, text })
  537 + })
  538 + const result = names.map(name => {
  539 + const found = matched.find(item => item.name === name)
  540 + return found ? found.text : name
  541 + })
  542 + this.form.deductionTypeRemark = result.join('、')
  543 + },
  544 + // 从已保存的业务摘要中解析来料扣杂类型段落,用于回显来料类型备注
  545 + extractDeductionRemark(businessSummary) {
  546 + const names = this.getSelectedDeductionNames()
  547 + const parts = String(businessSummary || '')
  548 + .split(',')
  549 + .map(text => text.trim())
  550 + .filter(text => !!text)
  551 + const found = parts.find(part => {
  552 + if (part.includes('公斤') || part.includes(':')) return false
  553 + const items = part.split('、').map(text => text.trim()).filter(text => !!text)
  554 + return items.length > 0 && items.every(text => names.some(name => text.startsWith(name)))
  555 + })
  556 + return found || names.join('、')
  557 + },
485 loadDetail() { 558 loadDetail() {
486 if (!this.id) { 559 if (!this.id) {
487 uni.showToast({ title: '缺少单据ID', icon: 'none' }) 560 uni.showToast({ title: '缺少单据ID', icon: 'none' })
@@ -505,11 +578,14 @@ export default { @@ -505,11 +578,14 @@ export default {
505 totalGrossWeight: data.totalGrossWeight == null ? '' : String(data.totalGrossWeight), 578 totalGrossWeight: data.totalGrossWeight == null ? '' : String(data.totalGrossWeight),
506 actualImpurityWeight: data.actualImpurityWeight == null ? '' : String(data.actualImpurityWeight), 579 actualImpurityWeight: data.actualImpurityWeight == null ? '' : String(data.actualImpurityWeight),
507 deductionTypes: data.deductionTypes ? String(data.deductionTypes).split(',').filter(Boolean) : [], 580 deductionTypes: data.deductionTypes ? String(data.deductionTypes).split(',').filter(Boolean) : [],
  581 + deductionTypeRemark: '',
508 supplierStockMaterial: data.supplierStockMaterial || '', 582 supplierStockMaterial: data.supplierStockMaterial || '',
509 logisticsStockMaterial: data.logisticsStockMaterial || '', 583 logisticsStockMaterial: data.logisticsStockMaterial || '',
510 plateNumber: data.plateNumber || '', 584 plateNumber: data.plateNumber || '',
511 specialNote: data.specialNote || '' 585 specialNote: data.specialNote || ''
512 } 586 }
  587 + // 回显来料类型备注:优先取已保存业务摘要中的扣杂段落
  588 + this.form.deductionTypeRemark = this.extractDeductionRemark(data.businessSummary)
513 // 计划选择回显:行对象缓存供提交 planIds 使用(id 取计划明细行上的计划 id) 589 // 计划选择回显:行对象缓存供提交 planIds 使用(id 取计划明细行上的计划 id)
514 this.planList = (Array.isArray(data.planLines) ? data.planLines : []).map(it => ({ ...it })) 590 this.planList = (Array.isArray(data.planLines) ? data.planLines : []).map(it => ({ ...it }))
515 this.selectedPlanRows = this.planList.map(item => ({ 591 this.selectedPlanRows = this.planList.map(item => ({
@@ -610,11 +686,16 @@ export default { @@ -610,11 +686,16 @@ export default {
610 row.productName = '' 686 row.productName = ''
611 row.invoiceProductName = '' 687 row.invoiceProductName = ''
612 }, 688 },
  689 + // 当前行可选的品种(同一计划下已被其他行选中的品种不再展示)
  690 + getWeightProductOptions(item) {
  691 + const used = (this.weighList || [])
  692 + .filter(row => row !== item && row.planCode === item.planCode && row.productId && row.productId !== item.productId)
  693 + .map(row => row.productId)
  694 + return (this.planList || []).filter(it => it.planCode === item.planCode && !used.includes(it.productId))
  695 + },
613 // 当前计划编号下的品种选项 696 // 当前计划编号下的品种选项
614 getWeightProductLabels(item) { 697 getWeightProductLabels(item) {
615 - return (this.planList || [])  
616 - .filter(it => it.planCode === item.planCode)  
617 - .map(it => it.productName || '') 698 + return this.getWeightProductOptions(item).map(it => it.productName || '')
618 }, 699 },
619 getWeightProductLabel(item) { 700 getWeightProductLabel(item) {
620 if (!item.productId) return '' 701 if (!item.productId) return ''
@@ -624,7 +705,7 @@ export default { @@ -624,7 +705,7 @@ export default {
624 // 过磅品种改选:整行替换为对应计划明细数据(保留行id与计划编号) 705 // 过磅品种改选:整行替换为对应计划明细数据(保留行id与计划编号)
625 handleWeightProductChange(idx, optIdx) { 706 handleWeightProductChange(idx, optIdx) {
626 const row = this.weighList[idx] 707 const row = this.weighList[idx]
627 - const options = (this.planList || []).filter(it => it.planCode === row.planCode) 708 + const options = this.getWeightProductOptions(row)
628 const raw = options[optIdx] 709 const raw = options[optIdx]
629 if (!raw) return 710 if (!raw) return
630 this.weighList.splice(idx, 1, { 711 this.weighList.splice(idx, 1, {
@@ -676,8 +757,8 @@ export default { @@ -676,8 +757,8 @@ export default {
676 if (f.totalGrossWeight === '' || f.totalGrossWeight == null) return this.tip('请输入过磅总重') 757 if (f.totalGrossWeight === '' || f.totalGrossWeight == null) return this.tip('请输入过磅总重')
677 if (f.actualImpurityWeight === '' || f.actualImpurityWeight == null) return this.tip('请输入实际伙重') 758 if (f.actualImpurityWeight === '' || f.actualImpurityWeight == null) return this.tip('请输入实际伙重')
678 if (!f.deductionTypes || !f.deductionTypes.length) return this.tip('请选择来料扣杂类型') 759 if (!f.deductionTypes || !f.deductionTypes.length) return this.tip('请选择来料扣杂类型')
679 - if (!f.supplierStockMaterial) return this.tip('请输入供应存欠料')  
680 - if (!f.logisticsStockMaterial) return this.tip('请输入物流存欠料') 760 + // if (!f.supplierStockMaterial) return this.tip('请输入供应存欠料')
  761 + // if (!f.logisticsStockMaterial) return this.tip('请输入物流存欠料')
681 if (!f.plateNumber) return this.tip('请输入车牌号') 762 if (!f.plateNumber) return this.tip('请输入车牌号')
682 // 过磅明细:计划编号、品种、数量必填 763 // 过磅明细:计划编号、品种、数量必填
683 const weightList = this.weighList || [] 764 const weightList = this.weighList || []
@@ -737,12 +818,24 @@ export default { @@ -737,12 +818,24 @@ export default {
737 documentRemark: this.computedDocumentRemark || null 818 documentRemark: this.computedDocumentRemark || null
738 } 819 }
739 }, 820 },
  821 + // 过磅数量合计与货物净重不一致时二次确认
  822 + async confirmQuantityMismatch() {
  823 + const net = this.computedNetWeight
  824 + if (net === '' || net === null || net === undefined) return true
  825 + const netNum = Math.round(Number(net) * 100) / 100
  826 + if (this.weightQuantityTotal === netNum) return true
  827 + const res = await new Promise(resolve => {
  828 + uni.showModal({ title: '提示', content: '过磅数量总和货物净重不一致,确定保存吗?', confirmText: '确定', cancelText: '取消', success: resolve })
  829 + })
  830 + return !!(res && res.confirm)
  831 + },
740 async onSubmit() { 832 async onSubmit() {
741 if (!this.validate()) return 833 if (!this.validate()) return
742 const confirmRes = await new Promise(resolve => { 834 const confirmRes = await new Promise(resolve => {
743 uni.showModal({ title: '提示', content: '确定保存修改吗?', confirmText: '确定', cancelText: '取消', success: resolve }) 835 uni.showModal({ title: '提示', content: '确定保存修改吗?', confirmText: '确定', cancelText: '取消', success: resolve })
744 }) 836 })
745 if (!(confirmRes && confirmRes.confirm)) return 837 if (!(confirmRes && confirmRes.confirm)) return
  838 + if (!(await this.confirmQuantityMismatch())) return
746 uni.showLoading({ title: '保存中...', mask: true }) 839 uni.showLoading({ title: '保存中...', mask: true })
747 weighTicketUpdateApi(this.buildSubmitData()) 840 weighTicketUpdateApi(this.buildSubmitData())
748 .then(() => { 841 .then(() => {
@@ -1101,6 +1194,12 @@ function numberToChineseUpper(num) { @@ -1101,6 +1194,12 @@ function numberToChineseUpper(num) {
1101 } 1194 }
1102 } 1195 }
1103 1196
  1197 +// 来料类型备注:textarea 占满剩余宽度
  1198 +.deduction-remark-input {
  1199 + flex: 1;
  1200 + width: 100%;
  1201 +}
  1202 +
1104 .remark-group { 1203 .remark-group {
1105 margin-bottom: 32rpx; 1204 margin-bottom: 32rpx;
1106 1205
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
68 <uni-easyinput :value="item.productName" :inputBorder="false" disabled /> 68 <uni-easyinput :value="item.productName" :inputBorder="false" disabled />
69 </template> 69 </template>
70 </uni-list-item> 70 </uni-list-item>
71 - <uni-list-item title="计划数量"> 71 + <uni-list-item title="计划数量(kg)">
72 <template v-slot:footer> 72 <template v-slot:footer>
73 <uni-easyinput :value="item.quantity" :inputBorder="false" disabled /> 73 <uni-easyinput :value="item.quantity" :inputBorder="false" disabled />
74 </template> 74 </template>
@@ -105,7 +105,7 @@ @@ -105,7 +105,7 @@
105 </uni-list-item> 105 </uni-list-item>
106 <uni-list-item title="过磅数量"> 106 <uni-list-item title="过磅数量">
107 <template v-slot:body> 107 <template v-slot:body>
108 - <view class="item-title"><text class="required">*</text><text>过磅数量</text></view> 108 + <view class="item-title"><text class="required">*</text><text>过磅数量(kg)</text></view>
109 </template> 109 </template>
110 <template v-slot:footer> 110 <template v-slot:footer>
111 <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入过磅数量" /> 111 <uni-easyinput v-model="item.quantity" type="digit" :inputBorder="false" placeholder="请输入过磅数量" />
@@ -131,7 +131,7 @@ @@ -131,7 +131,7 @@
131 <uni-easyinput :value="item.category" :inputBorder="false" disabled /> 131 <uni-easyinput :value="item.category" :inputBorder="false" disabled />
132 </template> 132 </template>
133 </uni-list-item> 133 </uni-list-item>
134 - <uni-list-item title="数量"> 134 + <uni-list-item title="数量(kg)">
135 <template v-slot:footer> 135 <template v-slot:footer>
136 <uni-easyinput :value="item.quantity" :inputBorder="false" disabled /> 136 <uni-easyinput :value="item.quantity" :inputBorder="false" disabled />
137 </template> 137 </template>
@@ -156,7 +156,7 @@ @@ -156,7 +156,7 @@
156 </uni-list-item> 156 </uni-list-item>
157 <uni-list-item> 157 <uni-list-item>
158 <template v-slot:body> 158 <template v-slot:body>
159 - <view class="item-title"><text class="required">*</text><text>过磅总重</text></view> 159 + <view class="item-title"><text class="required">*</text><text>过磅总重(kg)</text></view>
160 </template> 160 </template>
161 <template v-slot:footer> 161 <template v-slot:footer>
162 <uni-easyinput v-model="form.totalGrossWeight" type="digit" :inputBorder="false" placeholder="请输入过磅总重" /> 162 <uni-easyinput v-model="form.totalGrossWeight" type="digit" :inputBorder="false" placeholder="请输入过磅总重" />
@@ -164,13 +164,13 @@ @@ -164,13 +164,13 @@
164 </uni-list-item> 164 </uni-list-item>
165 <uni-list-item> 165 <uni-list-item>
166 <template v-slot:body> 166 <template v-slot:body>
167 - <view class="item-title"><text class="required">*</text><text>实际伙重</text></view> 167 + <view class="item-title"><text class="required">*</text><text>实际伙重(kg)</text></view>
168 </template> 168 </template>
169 <template v-slot:footer> 169 <template v-slot:footer>
170 <uni-easyinput v-model="form.actualImpurityWeight" type="digit" :inputBorder="false" placeholder="请输入实际伙重" /> 170 <uni-easyinput v-model="form.actualImpurityWeight" type="digit" :inputBorder="false" placeholder="请输入实际伙重" />
171 </template> 171 </template>
172 </uni-list-item> 172 </uni-list-item>
173 - <uni-list-item title="货物净重"> 173 + <uni-list-item title="货物净重(kg)">
174 <template v-slot:footer> 174 <template v-slot:footer>
175 <uni-easyinput :value="computedNetWeight" :inputBorder="false" disabled /> 175 <uni-easyinput :value="computedNetWeight" :inputBorder="false" disabled />
176 </template> 176 </template>
@@ -197,7 +197,16 @@ @@ -197,7 +197,16 @@
197 <uni-list> 197 <uni-list>
198 <uni-list-item> 198 <uni-list-item>
199 <template v-slot:body> 199 <template v-slot:body>
200 - <view class="item-title"><text class="required">*</text><text>供应存欠料</text></view> 200 + <view class="item-title"><text>来料类型备注</text></view>
  201 + </template>
  202 + <template v-slot:footer>
  203 + <uni-easyinput class="deduction-remark-input" v-model="form.deductionTypeRemark"
  204 + type="textarea" :inputBorder="false" placeholder="请输入来料类型备注" autoHeight />
  205 + </template>
  206 + </uni-list-item>
  207 + <uni-list-item>
  208 + <template v-slot:body>
  209 + <view class="item-title"><text>供应存欠料</text></view>
201 </template> 210 </template>
202 <template v-slot:footer> 211 <template v-slot:footer>
203 <uni-easyinput v-model="form.supplierStockMaterial" :inputBorder="false" placeholder="请输入供应存欠料" /> 212 <uni-easyinput v-model="form.supplierStockMaterial" :inputBorder="false" placeholder="请输入供应存欠料" />
@@ -205,7 +214,7 @@ @@ -205,7 +214,7 @@
205 </uni-list-item> 214 </uni-list-item>
206 <uni-list-item> 215 <uni-list-item>
207 <template v-slot:body> 216 <template v-slot:body>
208 - <view class="item-title"><text class="required">*</text><text>物流存欠料</text></view> 217 + <view class="item-title"><text>物流存欠料</text></view>
209 </template> 218 </template>
210 <template v-slot:footer> 219 <template v-slot:footer>
211 <uni-easyinput v-model="form.logisticsStockMaterial" :inputBorder="false" placeholder="请输入物流存欠料" /> 220 <uni-easyinput v-model="form.logisticsStockMaterial" :inputBorder="false" placeholder="请输入物流存欠料" />
@@ -272,7 +281,7 @@ @@ -272,7 +281,7 @@
272 281
273 <script> 282 <script>
274 import { weighTicketDetailApi, weighTicketCreateApi } from '@/api/procure-manage/weighTicket.js' 283 import { weighTicketDetailApi, weighTicketCreateApi } from '@/api/procure-manage/weighTicket.js'
275 -import { getDicByCodes, getDicName } from '@/utils/dic.js' 284 +import { getDicByCodes } from '@/utils/dic.js'
276 import upload from '@/utils/upload' 285 import upload from '@/utils/upload'
277 import { uploadFileApi } from '@/api/base.js' 286 import { uploadFileApi } from '@/api/base.js'
278 287
@@ -292,6 +301,7 @@ export default { @@ -292,6 +301,7 @@ export default {
292 totalGrossWeight: '', 301 totalGrossWeight: '',
293 actualImpurityWeight: '', 302 actualImpurityWeight: '',
294 deductionTypes: [], 303 deductionTypes: [],
  304 + deductionTypeRemark: '',
295 supplierStockMaterial: '', 305 supplierStockMaterial: '',
296 logisticsStockMaterial: '', 306 logisticsStockMaterial: '',
297 plateNumber: '', 307 plateNumber: '',
@@ -345,6 +355,14 @@ export default { @@ -345,6 +355,14 @@ export default {
345 if (net === '' || net === null || net === undefined) return '' 355 if (net === '' || net === null || net === undefined) return ''
346 return numberToChineseUpper(net) 356 return numberToChineseUpper(net)
347 }, 357 },
  358 + // 过磅数量合计
  359 + weightQuantityTotal() {
  360 + const total = (this.weighList || []).reduce((sum, item) => {
  361 + const qty = Number(item.quantity)
  362 + return sum + (isNaN(qty) ? 0 : qty)
  363 + }, 0)
  364 + return Math.round(total * 100) / 100
  365 + },
348 // 业务摘要 366 // 业务摘要
349 computedBusinessSummary() { 367 computedBusinessSummary() {
350 const parts = [] 368 const parts = []
@@ -357,10 +375,9 @@ export default { @@ -357,10 +375,9 @@ export default {
357 }) 375 })
358 .filter(text => !!text) 376 .filter(text => !!text)
359 if (weightItems.length) parts.push(weightItems.join('、')) 377 if (weightItems.length) parts.push(weightItems.join('、'))
360 - const deductionNames = (this.form.deductionTypes || [])  
361 - .map(code => getDicName('DEDUCTION_TYPE', code, this.dicOptions.DEDUCTION_TYPE))  
362 - .filter(name => !!name)  
363 - if (deductionNames.length) parts.push(deductionNames.join('、')) 378 + // 来料扣杂类型段落以「来料类型备注」文本为准(用户可自由修改)
  379 + const deductionSegment = (this.form.deductionTypeRemark || '').trim()
  380 + if (deductionSegment) parts.push(deductionSegment)
364 if (this.form.supplierStockMaterial) parts.push(`供应存欠料:${this.form.supplierStockMaterial}`) 381 if (this.form.supplierStockMaterial) parts.push(`供应存欠料:${this.form.supplierStockMaterial}`)
365 if (this.form.logisticsStockMaterial) parts.push(`物流存欠料:${this.form.logisticsStockMaterial}`) 382 if (this.form.logisticsStockMaterial) parts.push(`物流存欠料:${this.form.logisticsStockMaterial}`)
366 if (this.form.plateNumber) parts.push(`车牌号:${this.form.plateNumber}`) 383 if (this.form.plateNumber) parts.push(`车牌号:${this.form.plateNumber}`)
@@ -373,12 +390,21 @@ export default { @@ -373,12 +390,21 @@ export default {
373 return [summary, note].filter(text => !!text).join('\n') 390 return [summary, note].filter(text => !!text).join('\n')
374 } 391 }
375 }, 392 },
  393 + watch: {
  394 + // 来料扣杂类型增减时,同步维护「来料类型备注」文本(保留用户已填写的数字等内容)
  395 + 'form.deductionTypes': {
  396 + deep: true,
  397 + handler(list) {
  398 + this.syncDeductionRemark(list)
  399 + }
  400 + }
  401 + },
376 onLoad(query) { 402 onLoad(query) {
377 this.id = (query && query.id) || '' 403 this.id = (query && query.id) || ''
378 }, 404 },
379 created() { 405 created() {
380 - this.loadDicData()  
381 - this.loadDetail() 406 + // 先加载字典,再回显详情,保证来料类型备注能正确解析
  407 + this.loadDicData().finally(() => this.loadDetail())
382 }, 408 },
383 methods: { 409 methods: {
384 async loadDicData() { 410 async loadDicData() {
@@ -394,6 +420,53 @@ export default { @@ -394,6 +420,53 @@ export default {
394 const found = (this.dicOptions.TYPE || []).find(it => String(it.code) === String(this.form.type)) 420 const found = (this.dicOptions.TYPE || []).find(it => String(it.code) === String(this.form.type))
395 return found ? found.name : '' 421 return found ? found.name : ''
396 }, 422 },
  423 + // 当前已选扣杂类型的名称
  424 + getSelectedDeductionNames() {
  425 + const selected = (this.form.deductionTypes || []).map(code => String(code))
  426 + return this.deductionTypeOptions
  427 + .filter(it => selected.includes(it.value))
  428 + .map(it => it.text)
  429 + .filter(name => !!name)
  430 + },
  431 + // 按所选扣杂类型同步备注文本:移除已取消的类型、补充新增的类型,保留用户已填写的后缀内容
  432 + syncDeductionRemark(list) {
  433 + const selected = (list || []).map(code => String(code))
  434 + const names = this.deductionTypeOptions
  435 + .filter(it => selected.includes(it.value))
  436 + .map(it => it.text)
  437 + .filter(name => !!name)
  438 + const segments = (this.form.deductionTypeRemark || '')
  439 + .split('、')
  440 + .map(text => text.trim())
  441 + .filter(text => !!text)
  442 + // 名称按长度倒序匹配,避免「水」误匹配「水杂」这类前缀相同的情况
  443 + const sortedNames = names.slice().sort((a, b) => b.length - a.length)
  444 + const matched = []
  445 + segments.forEach(text => {
  446 + const name = sortedNames.find(item => text.startsWith(item))
  447 + if (!name) return
  448 + if (!matched.some(item => item.name === name)) matched.push({ name, text })
  449 + })
  450 + const result = names.map(name => {
  451 + const found = matched.find(item => item.name === name)
  452 + return found ? found.text : name
  453 + })
  454 + this.form.deductionTypeRemark = result.join('、')
  455 + },
  456 + // 从已保存的业务摘要中解析来料扣杂类型段落,用于回显来料类型备注
  457 + extractDeductionRemark(businessSummary) {
  458 + const names = this.getSelectedDeductionNames()
  459 + const parts = String(businessSummary || '')
  460 + .split(',')
  461 + .map(text => text.trim())
  462 + .filter(text => !!text)
  463 + const found = parts.find(part => {
  464 + if (part.includes('公斤') || part.includes(':')) return false
  465 + const items = part.split('、').map(text => text.trim()).filter(text => !!text)
  466 + return items.length > 0 && items.every(text => names.some(name => text.startsWith(name)))
  467 + })
  468 + return found || names.join('、')
  469 + },
397 loadDetail() { 470 loadDetail() {
398 if (!this.id) { 471 if (!this.id) {
399 uni.showToast({ title: '缺少单据ID', icon: 'none' }) 472 uni.showToast({ title: '缺少单据ID', icon: 'none' })
@@ -415,11 +488,14 @@ export default { @@ -415,11 +488,14 @@ export default {
415 totalGrossWeight: data.totalGrossWeight == null ? '' : String(data.totalGrossWeight), 488 totalGrossWeight: data.totalGrossWeight == null ? '' : String(data.totalGrossWeight),
416 actualImpurityWeight: data.actualImpurityWeight == null ? '' : String(data.actualImpurityWeight), 489 actualImpurityWeight: data.actualImpurityWeight == null ? '' : String(data.actualImpurityWeight),
417 deductionTypes: data.deductionTypes ? String(data.deductionTypes).split(',').filter(Boolean) : [], 490 deductionTypes: data.deductionTypes ? String(data.deductionTypes).split(',').filter(Boolean) : [],
  491 + deductionTypeRemark: '',
418 supplierStockMaterial: data.supplierStockMaterial || '', 492 supplierStockMaterial: data.supplierStockMaterial || '',
419 logisticsStockMaterial: data.logisticsStockMaterial || '', 493 logisticsStockMaterial: data.logisticsStockMaterial || '',
420 plateNumber: data.plateNumber || '', 494 plateNumber: data.plateNumber || '',
421 specialNote: data.specialNote || '' 495 specialNote: data.specialNote || ''
422 } 496 }
  497 + // 回显来料类型备注:优先取已保存业务摘要中的扣杂段落
  498 + this.form.deductionTypeRemark = this.extractDeductionRemark(data.businessSummary)
423 this.planList = (Array.isArray(data.planLines) ? data.planLines : []).map(it => ({ ...it })) 499 this.planList = (Array.isArray(data.planLines) ? data.planLines : []).map(it => ({ ...it }))
424 // 选中计划行对象(buyout 供 isBuyout 判断,id 供 planIds 提交使用) 500 // 选中计划行对象(buyout 供 isBuyout 判断,id 供 planIds 提交使用)
425 this.selectedPlanRows = this.planList.map(item => ({ 501 this.selectedPlanRows = this.planList.map(item => ({
@@ -519,8 +595,8 @@ export default { @@ -519,8 +595,8 @@ export default {
519 if (f.totalGrossWeight === '' || f.totalGrossWeight == null) return this.tip('请输入过磅总重') 595 if (f.totalGrossWeight === '' || f.totalGrossWeight == null) return this.tip('请输入过磅总重')
520 if (f.actualImpurityWeight === '' || f.actualImpurityWeight == null) return this.tip('请输入实际伙重') 596 if (f.actualImpurityWeight === '' || f.actualImpurityWeight == null) return this.tip('请输入实际伙重')
521 if (!f.deductionTypes || !f.deductionTypes.length) return this.tip('请选择来料扣杂类型') 597 if (!f.deductionTypes || !f.deductionTypes.length) return this.tip('请选择来料扣杂类型')
522 - if (!f.supplierStockMaterial) return this.tip('请输入供应存欠料')  
523 - if (!f.logisticsStockMaterial) return this.tip('请输入物流存欠料') 598 + // if (!f.supplierStockMaterial) return this.tip('请输入供应存欠料')
  599 + // if (!f.logisticsStockMaterial) return this.tip('请输入物流存欠料')
524 if (!f.plateNumber) return this.tip('请输入车牌号') 600 if (!f.plateNumber) return this.tip('请输入车牌号')
525 // 过磅明细:过磅数量必填 601 // 过磅明细:过磅数量必填
526 const weightList = this.weighList || [] 602 const weightList = this.weighList || []
@@ -536,12 +612,24 @@ export default { @@ -536,12 +612,24 @@ export default {
536 uni.showToast({ title: msg, icon: 'none' }) 612 uni.showToast({ title: msg, icon: 'none' })
537 return false 613 return false
538 }, 614 },
  615 + // 过磅数量合计与货物净重不一致时二次确认
  616 + async confirmQuantityMismatch() {
  617 + const net = this.computedNetWeight
  618 + if (net === '' || net === null || net === undefined) return true
  619 + const netNum = Math.round(Number(net) * 100) / 100
  620 + if (this.weightQuantityTotal === netNum) return true
  621 + const res = await new Promise(resolve => {
  622 + uni.showModal({ title: '提示', content: '过磅数量总和货物净重不一致,确定保存吗?', confirmText: '确定', cancelText: '取消', success: resolve })
  623 + })
  624 + return !!(res && res.confirm)
  625 + },
539 async onSubmit() { 626 async onSubmit() {
540 if (!this.validate()) return 627 if (!this.validate()) return
541 const confirmRes = await new Promise(resolve => { 628 const confirmRes = await new Promise(resolve => {
542 uni.showModal({ title: '提示', content: '确定保存复磅单吗?', confirmText: '确定', cancelText: '取消', success: resolve }) 629 uni.showModal({ title: '提示', content: '确定保存复磅单吗?', confirmText: '确定', cancelText: '取消', success: resolve })
543 }) 630 })
544 if (!(confirmRes && confirmRes.confirm)) return 631 if (!(confirmRes && confirmRes.confirm)) return
  632 + if (!(await this.confirmQuantityMismatch())) return
545 const ids = this.fileList.map(it => it.id).filter(Boolean) 633 const ids = this.fileList.map(it => it.id).filter(Boolean)
546 const names = this.fileList.map(it => it.name).filter(Boolean) 634 const names = this.fileList.map(it => it.name).filter(Boolean)
547 const payload = { 635 const payload = {
@@ -904,6 +992,12 @@ function numberToChineseUpper(num) { @@ -904,6 +992,12 @@ function numberToChineseUpper(num) {
904 } 992 }
905 } 993 }
906 994
  995 +// 来料类型备注:textarea 占满剩余宽度
  996 +.deduction-remark-input {
  997 + flex: 1;
  998 + width: 100%;
  999 +}
  1000 +
907 .remark-group { 1001 .remark-group {
908 margin-bottom: 32rpx; 1002 margin-bottom: 32rpx;
909 1003
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 <view class="card-index">第 {{ idx + 1 }} 行</view> 24 <view class="card-index">第 {{ idx + 1 }} 行</view>
25 <view class="row"><text class="label">计划编号</text><text class="value">{{ item.planCode || '-' }}</text></view> 25 <view class="row"><text class="label">计划编号</text><text class="value">{{ item.planCode || '-' }}</text></view>
26 <view class="row"><text class="label">计划品种</text><text class="value">{{ item.productName || '-' }}</text></view> 26 <view class="row"><text class="label">计划品种</text><text class="value">{{ item.productName || '-' }}</text></view>
27 - <view class="row"><text class="label">计划数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 27 + <view class="row"><text class="label">计划数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
28 </view> 28 </view>
29 </view> 29 </view>
30 </view> 30 </view>
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 <view class="row"><text class="label">计划编号</text><text class="value">{{ item.planCode || '-' }}</text></view> 42 <view class="row"><text class="label">计划编号</text><text class="value">{{ item.planCode || '-' }}</text></view>
43 <view class="row"><text class="label">过磅品种</text><text class="value">{{ item.productName || '-' }}</text></view> 43 <view class="row"><text class="label">过磅品种</text><text class="value">{{ item.productName || '-' }}</text></view>
44 <view class="row"><text class="label">开票品名</text><text class="value">{{ item.invoiceProductName || '-' }}</text></view> 44 <view class="row"><text class="label">开票品名</text><text class="value">{{ item.invoiceProductName || '-' }}</text></view>
45 - <view class="row"><text class="label">过磅数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 45 + <view class="row"><text class="label">过磅数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
46 </view> 46 </view>
47 </view> 47 </view>
48 </view> 48 </view>
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 <view v-for="(item, idx) in applyList" :key="'a-' + (item.id || idx)" class="card"> 58 <view v-for="(item, idx) in applyList" :key="'a-' + (item.id || idx)" class="card">
59 <view class="card-index">第 {{ idx + 1 }} 行</view> 59 <view class="card-index">第 {{ idx + 1 }} 行</view>
60 <view class="row"><text class="label">类别</text><text class="value">{{ item.category || '-' }}</text></view> 60 <view class="row"><text class="label">类别</text><text class="value">{{ item.category || '-' }}</text></view>
61 - <view class="row"><text class="label">数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 61 + <view class="row"><text class="label">数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
62 </view> 62 </view>
63 </view> 63 </view>
64 </view> 64 </view>
@@ -70,9 +70,9 @@ @@ -70,9 +70,9 @@
70 </view> 70 </view>
71 <view class="section"> 71 <view class="section">
72 <view class="row"><text class="label">物料名称</text><text class="value">{{ form.materialName || '-' }}</text></view> 72 <view class="row"><text class="label">物料名称</text><text class="value">{{ form.materialName || '-' }}</text></view>
73 - <view class="row"><text class="label">过磅总重</text><text class="value">{{ formatNumber(form.totalGrossWeight) }}</text></view>  
74 - <view class="row"><text class="label">实际伙重</text><text class="value">{{ formatNumber(form.actualImpurityWeight) }}</text></view>  
75 - <view class="row"><text class="label">货物净重</text><text class="value">{{ formatNumber(form.netWeight) }}</text></view> 73 + <view class="row"><text class="label">过磅总重(kg)</text><text class="value">{{ formatNumber(form.totalGrossWeight) }}</text></view>
  74 + <view class="row"><text class="label">实际伙重(kg)</text><text class="value">{{ formatNumber(form.actualImpurityWeight) }}</text></view>
  75 + <view class="row"><text class="label">货物净重(kg)</text><text class="value">{{ formatNumber(form.netWeight) }}</text></view>
76 <view class="row"><text class="label">净重大写</text><text class="value">{{ form.netWeightUpper || '-' }}</text></view> 76 <view class="row"><text class="label">净重大写</text><text class="value">{{ form.netWeightUpper || '-' }}</text></view>
77 <view class="row"><text class="label">来料扣杂类型</text><text class="value">{{ deductionNames }}</text></view> 77 <view class="row"><text class="label">来料扣杂类型</text><text class="value">{{ deductionNames }}</text></view>
78 <view class="row"><text class="label">供应存欠料</text><text class="value">{{ form.supplierStockMaterial || '-' }}</text></view> 78 <view class="row"><text class="label">供应存欠料</text><text class="value">{{ form.supplierStockMaterial || '-' }}</text></view>
@@ -273,8 +273,46 @@ export default { @@ -273,8 +273,46 @@ export default {
273 uni.hideLoading() 273 uni.hideLoading()
274 }) 274 })
275 }, 275 },
276 - // 选择并上传文件(多文件逐个追加) 276 + // 选择上传方式:拍照 / 相册 / 文件
277 selectFile() { 277 selectFile() {
  278 + uni.showActionSheet({
  279 + itemList: ['拍照上传', '从相册选择', '选择文件'],
  280 + success: res => {
  281 + if (res.tapIndex === 0) this.chooseImage(['camera'])
  282 + else if (res.tapIndex === 1) this.chooseImage(['album'])
  283 + else this.chooseFile()
  284 + }
  285 + })
  286 + },
  287 + // 拍照 / 相册上传图片(多张逐个追加)
  288 + chooseImage(sourceType) {
  289 + uni.chooseImage({
  290 + count: 9,
  291 + sizeType: ['original', 'compressed'],
  292 + sourceType,
  293 + success: async res => {
  294 + const paths = (res && res.tempFilePaths) || []
  295 + if (!paths.length) return
  296 + uni.showLoading({ title: '上传中...', mask: true })
  297 + try {
  298 + for (let i = 0; i < paths.length; i++) {
  299 + const path = paths[i]
  300 + const ext = (/\.(\w+)$/.exec(path) || [])[1] || 'jpg'
  301 + const name = `照片_${Date.now()}_${i + 1}.${ext}`
  302 + const r = await upload({ url: '/sw/filebox/uploadFile', filePath: path, name: 'file' })
  303 + const id = getUploadedFileId(r)
  304 + if (id) this.fileList.push({ id, name })
  305 + }
  306 + } catch (e) {
  307 + uni.showToast({ title: '上传失败', icon: 'none' })
  308 + } finally {
  309 + uni.hideLoading()
  310 + }
  311 + }
  312 + })
  313 + },
  314 + // 选择并上传文件(多文件逐个追加)
  315 + chooseFile() {
278 if (typeof uni !== 'undefined' && typeof uni.chooseMessageFile === 'function') { 316 if (typeof uni !== 'undefined' && typeof uni.chooseMessageFile === 'function') {
279 uni.chooseMessageFile({ 317 uni.chooseMessageFile({
280 count: 9, 318 count: 9,
@@ -287,10 +325,7 @@ export default { @@ -287,10 +325,7 @@ export default {
287 for (const f of files) { 325 for (const f of files) {
288 const name = f.name || 'file' 326 const name = f.name || 'file'
289 const r = await upload({ url: '/sw/filebox/uploadFile', filePath: f.path, name: 'file' }) 327 const r = await upload({ url: '/sw/filebox/uploadFile', filePath: f.path, name: 'file' })
290 - const d = r && r.data ? r.data : r  
291 - const id = (d && (d.id || d.fileId || (d.data && (d.data.id || d.data.fileId))))  
292 - ? String(d.id || d.fileId || d.data.id || d.data.fileId)  
293 - : '' 328 + const id = getUploadedFileId(r)
294 if (id) this.fileList.push({ id, name }) 329 if (id) this.fileList.push({ id, name })
295 } 330 }
296 } catch (e) { 331 } catch (e) {
@@ -331,10 +366,7 @@ export default { @@ -331,10 +366,7 @@ export default {
331 const fd = new FormData() 366 const fd = new FormData()
332 fd.append('file', file, name) 367 fd.append('file', file, name)
333 const d = await uploadFileApi(fd) 368 const d = await uploadFileApi(fd)
334 - const data = d && d.data ? d.data : d  
335 - const id = (data && (data.id || data.fileId || (data.data && (data.data.id || data.data.fileId))))  
336 - ? String(data.id || data.fileId || data.data.id || data.data.fileId)  
337 - : '' 369 + const id = getUploadedFileId(d)
338 if (id) this.fileList.push({ id, name }) 370 if (id) this.fileList.push({ id, name })
339 } 371 }
340 } catch (e2) { 372 } catch (e2) {
@@ -397,6 +429,14 @@ export default { @@ -397,6 +429,14 @@ export default {
397 } 429 }
398 } 430 }
399 } 431 }
  432 +
  433 +// 解析上传接口返回的文件ID
  434 +function getUploadedFileId(res) {
  435 + const d = res && res.data ? res.data : res
  436 + if (!d) return ''
  437 + const id = d.id || d.fileId || (d.data && (d.data.id || d.data.fileId))
  438 + return id ? String(id) : ''
  439 +}
400 </script> 440 </script>
401 441
402 <style lang="scss" scoped> 442 <style lang="scss" scoped>
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 <view v-for="(item, idx) in planList" :key="'p-' + (item.id || idx)" class="card"> 23 <view v-for="(item, idx) in planList" :key="'p-' + (item.id || idx)" class="card">
24 <view class="card-index">第 {{ idx + 1 }} 行</view> 24 <view class="card-index">第 {{ idx + 1 }} 行</view>
25 <view class="row"><text class="label">计划品种</text><text class="value">{{ safeText(item.productName) }}</text></view> 25 <view class="row"><text class="label">计划品种</text><text class="value">{{ safeText(item.productName) }}</text></view>
26 - <view class="row"><text class="label">计划数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 26 + <view class="row"><text class="label">计划数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
27 <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(item.planCode) }}</text></view> 27 <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(item.planCode) }}</text></view>
28 </view> 28 </view>
29 </view> 29 </view>
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 <view class="card-index">第 {{ idx + 1 }} 行</view> 41 <view class="card-index">第 {{ idx + 1 }} 行</view>
42 <view class="row"><text class="label">过磅品种</text><text class="value">{{ safeText(item.productName) }}</text></view> 42 <view class="row"><text class="label">过磅品种</text><text class="value">{{ safeText(item.productName) }}</text></view>
43 <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(item.invoiceProductName) }}</text></view> 43 <view class="row"><text class="label">开票品名</text><text class="value">{{ safeText(item.invoiceProductName) }}</text></view>
44 - <view class="row"><text class="label">过磅数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 44 + <view class="row"><text class="label">过磅数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
45 <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(item.planCode) }}</text></view> 45 <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(item.planCode) }}</text></view>
46 </view> 46 </view>
47 </view> 47 </view>
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 <view v-for="(item, idx) in applyList" :key="'a-' + (item.id || idx)" class="card"> 58 <view v-for="(item, idx) in applyList" :key="'a-' + (item.id || idx)" class="card">
59 <view class="card-index">第 {{ idx + 1 }} 行</view> 59 <view class="card-index">第 {{ idx + 1 }} 行</view>
60 <view class="row"><text class="label">类别</text><text class="value">{{ safeText(item.category) }}</text></view> 60 <view class="row"><text class="label">类别</text><text class="value">{{ safeText(item.category) }}</text></view>
61 - <view class="row"><text class="label">数量</text><text class="value">{{ formatNumber(item.quantity) }}</text></view> 61 + <view class="row"><text class="label">数量(kg)</text><text class="value">{{ formatNumber(item.quantity) }}</text></view>
62 </view> 62 </view>
63 </view> 63 </view>
64 </view> 64 </view>
@@ -70,9 +70,9 @@ @@ -70,9 +70,9 @@
70 </view> 70 </view>
71 <view class="section"> 71 <view class="section">
72 <view class="row"><text class="label">物料名称</text><text class="value">{{ safeText(form.materialName) }}</text></view> 72 <view class="row"><text class="label">物料名称</text><text class="value">{{ safeText(form.materialName) }}</text></view>
73 - <view class="row"><text class="label">过磅总重</text><text class="value">{{ formatNumber(form.totalGrossWeight) }}</text></view>  
74 - <view class="row"><text class="label">实际伙重</text><text class="value">{{ formatNumber(form.actualImpurityWeight) }}</text></view>  
75 - <view class="row"><text class="label">货物净重</text><text class="value">{{ formatNumber(form.netWeight) }}</text></view> 73 + <view class="row"><text class="label">过磅总重(kg)</text><text class="value">{{ formatNumber(form.totalGrossWeight) }}</text></view>
  74 + <view class="row"><text class="label">实际伙重(kg)</text><text class="value">{{ formatNumber(form.actualImpurityWeight) }}</text></view>
  75 + <view class="row"><text class="label">货物净重(kg)</text><text class="value">{{ formatNumber(form.netWeight) }}</text></view>
76 <view class="row"><text class="label">净重大写</text><text class="value">{{ safeText(form.netWeightUpper) }}</text></view> 76 <view class="row"><text class="label">净重大写</text><text class="value">{{ safeText(form.netWeightUpper) }}</text></view>
77 <view class="row"><text class="label">来料扣杂类型</text><text class="value">{{ deductionNames }}</text></view> 77 <view class="row"><text class="label">来料扣杂类型</text><text class="value">{{ deductionNames }}</text></view>
78 <view class="row"><text class="label">供应存欠料</text><text class="value">{{ safeText(form.supplierStockMaterial) }}</text></view> 78 <view class="row"><text class="label">供应存欠料</text><text class="value">{{ safeText(form.supplierStockMaterial) }}</text></view>