Commit f13f60422c45f89f283f3a795531ab9d1aa10061

Authored by 史婷婷
2 parents e407775e eb159c49

Merge branch 'cjerp-1.0' of http://gitlab.qgutech.com/zhuyuanliang/erp-mobile into cjerp-1.0

... ... @@ -10,9 +10,12 @@ export const statusStyle = [
10 10
11 11 export const statusMap = {
12 12 '生产中': '#2BA471',
  13 + '审核通过': '#2BA471',
13 14 '审核中': '#3D48A3',
14 15 '已签收': '#E7E7E7',
  16 + '已取消': '#000',
15 17 '已发货': '#D54941',
  18 + '已驳回': '#D54941',
16 19 }
17 20
18 21 const baseUrl = '/contract';
... ... @@ -24,6 +27,15 @@ export function queryApi(params) {
24 27 params
25 28 })
26 29 }
  30 +//取消锁价无规格申请单申请
  31 +export function cancelApi(id) {
  32 + return request({
  33 + url: `${baseUrl}/specLockDelayApplication/cancel`,
  34 + method: 'get',
  35 + params: { id }
  36 + })
  37 +}
  38 +
27 39 // 查询锁价无规格申请单列表
28 40 export function querySpecLockApi(params) {
29 41 return request({
... ...
... ... @@ -39,7 +39,7 @@
39 39 <view class="item-title"><text class="required">*</text><text>生产厂</text></view>
40 40 </template>
41 41 </uni-list-item>
42   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" />
  42 + <ProductRel mode="add" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" />
43 43 <uni-list-item title="合计人民币金额(大写)">
44 44 <template v-slot:footer>
45 45 <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled />
... ...
... ... @@ -40,7 +40,7 @@
40 40 <uni-easyinput v-model="form.unit" :inputBorder="false" disabled />
41 41 </template>
42 42 </uni-list-item>
43   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" />
  43 + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :deliveryDate="form.orderDate" :list="productLineList" @change="onProductsChange" :options="productList" />
44 44 <uni-list-item title="合计人民币金额(大写)">
45 45 <template v-slot:footer>
46 46 <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false"
... ...
... ... @@ -134,7 +134,7 @@
134 134 </uni-list-item>
135 135 <uni-list-item title="发货日期">
136 136 <template v-slot:footer>
137   - <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
  137 + <uni-datetime-picker :start="minDeliveryDate" type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
138 138 </template>
139 139 </uni-list-item>
140 140 </uni-list>
... ... @@ -205,6 +205,7 @@ export default {
205 205 list: { type: Array, default: () => [] },
206 206 max: { type: Number, default: 8 },
207 207 deliveryDateBase: { type: String, default: '' },
  208 + deliveryDate: { type: String, default: '' },
208 209 options: { type: Array, default: () => [] }
209 210 },
210 211 components: { SingleSelectSheet },
... ... @@ -222,6 +223,21 @@ export default {
222 223 label: o.label != null ? o.label : (o.text != null ? o.text : (o.name != null ? o.name : '')),
223 224 value: o.value != null ? o.value : (o.id != null ? o.id : o.productId)
224 225 }))
  226 + },
  227 + minDeliveryDate() {
  228 + const s = this.deliveryDate
  229 + if (!s) return ''
  230 + const parts = String(s).split('-')
  231 + const y = Number(parts[0])
  232 + const m = Number(parts[1])
  233 + const d = Number(parts[2])
  234 + if (!y || !m || !d) return ''
  235 + const dt = new Date(y, m - 1, d)
  236 + dt.setDate(dt.getDate() + 1)
  237 + const yy = dt.getFullYear()
  238 + const mm = String(dt.getMonth() + 1).padStart(2, '0')
  239 + const dd = String(dt.getDate() - 1).padStart(2, '0')
  240 + return `${yy}/${mm}/${dd}`
225 241 }
226 242 },
227 243 watch: {
... ...
... ... @@ -39,7 +39,7 @@
39 39 <view class="item-title"><text class="required">*</text><text>生产厂</text></view>
40 40 </template>
41 41 </uni-list-item>
42   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" />
  42 + <ProductRel mode="add" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" />
43 43 <uni-list-item title="合计人民币金额(大写)">
44 44 <template v-slot:footer>
45 45 <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled />
... ...
... ... @@ -108,7 +108,7 @@
108 108 数量
109 109 </div>
110 110 <div class="total-item-price">
111   - {{ (totalQuantity || 0).toFixed(2) }}t
  111 + {{ (totalQuantity || 0).toFixed(2) }}kg
112 112 </div>
113 113 </div>
114 114 <div class="total-item">
... ...
... ... @@ -41,7 +41,7 @@
41 41 </template>
42 42 </uni-list-item>
43 43
44   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" />
  44 + <ProductRel mode="add" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" />
45 45
46 46 <uni-list-item title="合计人民币金额(大写)">
47 47 <template v-slot:footer>
... ...
... ... @@ -134,7 +134,7 @@
134 134 </uni-list-item>
135 135 <uni-list-item title="发货日期">
136 136 <template v-slot:footer>
137   - <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
  137 + <uni-datetime-picker :start="minDeliveryDate" type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
138 138 </template>
139 139 </uni-list-item>
140 140 </uni-list>
... ... @@ -205,6 +205,7 @@ export default {
205 205 list: { type: Array, default: () => [] },
206 206 max: { type: Number, default: 8 },
207 207 deliveryDateBase: { type: String, default: '' },
  208 + deliveryDate: { type: String, default: '' },
208 209 options: { type: Array, default: () => [] }
209 210 },
210 211 components: { SingleSelectSheet },
... ... @@ -244,6 +245,23 @@ export default {
244 245 this.items = init
245 246 this.recalculateAll()
246 247 },
  248 + computed: {
  249 + minDeliveryDate() {
  250 + const s = this.deliveryDate
  251 + if (!s) return ''
  252 + const parts = String(s).split('-')
  253 + const y = Number(parts[0])
  254 + const m = Number(parts[1])
  255 + const d = Number(parts[2])
  256 + if (!y || !m || !d) return ''
  257 + const dt = new Date(y, m - 1, d)
  258 + dt.setDate(dt.getDate() + 1)
  259 + const yy = dt.getFullYear()
  260 + const mm = String(dt.getMonth() + 1).padStart(2, '0')
  261 + const dd = String(dt.getDate() - 1).padStart(2, '0')
  262 + return `${yy}/${mm}/${dd}`
  263 + }
  264 + },
247 265 methods: {
248 266 defaultItem() {
249 267 return { productId: '', productName: '', industry: '', brand: '', quality: '', thickness: '', thicknessTolPos: '', thicknessTolNeg: '', width: '', widthTolPos: '', widthTolNeg: '', length: '', lengthTolPos: '', lengthTolNeg: '', status: '', quantity: '', unitPrice: '', processingFee: undefined, amountExcludingTax: 0, totalAmount: 0, deliveryDate: '' }
... ...
... ... @@ -39,7 +39,7 @@
39 39 <view class="item-title"><text class="required">*</text><text>生产厂</text></view>
40 40 </template>
41 41 </uni-list-item>
42   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" />
  42 + <ProductRel mode="add" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" />
43 43 <uni-list-item title="合计人民币金额(大写)">
44 44 <template v-slot:footer>
45 45 <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled />
... ...
... ... @@ -41,7 +41,7 @@
41 41 </template>
42 42 </uni-list-item>
43 43
44   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" />
  44 + <ProductRel mode="add" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" />
45 45
46 46 <uni-list-item title="合计人民币金额(大写)">
47 47 <template v-slot:footer>
... ...
... ... @@ -134,7 +134,7 @@
134 134 </uni-list-item>
135 135 <uni-list-item title="发货日期">
136 136 <template v-slot:footer>
137   - <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
  137 + <uni-datetime-picker :start="minDeliveryDate" type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
138 138 </template>
139 139 </uni-list-item>
140 140 </uni-list>
... ... @@ -205,6 +205,7 @@ export default {
205 205 list: { type: Array, default: () => [] },
206 206 max: { type: Number, default: 8 },
207 207 deliveryDateBase: { type: String, default: '' },
  208 + deliveryDate: { type: String, default: '' },
208 209 options: { type: Array, default: () => [] }
209 210 },
210 211 components: { SingleSelectSheet },
... ... @@ -222,6 +223,21 @@ export default {
222 223 label: o.label != null ? o.label : (o.text != null ? o.text : (o.name != null ? o.name : '')),
223 224 value: o.value != null ? o.value : (o.id != null ? o.id : o.productId)
224 225 }))
  226 + },
  227 + minDeliveryDate() {
  228 + const s = this.deliveryDate
  229 + if (!s) return ''
  230 + const parts = String(s).split('-')
  231 + const y = Number(parts[0])
  232 + const m = Number(parts[1])
  233 + const d = Number(parts[2])
  234 + if (!y || !m || !d) return ''
  235 + const dt = new Date(y, m - 1, d)
  236 + dt.setDate(dt.getDate() + 1)
  237 + const yy = dt.getFullYear()
  238 + const mm = String(dt.getMonth() + 1).padStart(2, '0')
  239 + const dd = String(dt.getDate() - 1).padStart(2, '0')
  240 + return `${yy}/${mm}/${dd}`
225 241 }
226 242 },
227 243 watch: {
... ...
... ... @@ -39,7 +39,7 @@
39 39 <view class="item-title"><text class="required">*</text><text>生产厂</text></view>
40 40 </template>
41 41 </uni-list-item>
42   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" :rawToProdRatioList="rawToProdRatioList" />
  42 + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :deliveryDate="form.orderDate" @change="onProductsChange" :options="productList" :rawToProdRatioList="rawToProdRatioList" />
43 43 <uni-list-item title="合计人民币金额(大写)">
44 44 <template v-slot:footer>
45 45 <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled />
... ...
... ... @@ -41,7 +41,7 @@
41 41 </template>
42 42 </uni-list-item>
43 43
44   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" />
  44 + <ProductRel mode="add" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" />
45 45
46 46 <uni-list-item title="合计人民币金额(大写)">
47 47 <template v-slot:footer>
... ...
... ... @@ -140,7 +140,7 @@
140 140 </uni-list-item>
141 141 <uni-list-item title="发货日期">
142 142 <template v-slot:footer>
143   - <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
  143 + <uni-datetime-picker :start="minDeliveryDate" type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
144 144 </template>
145 145 </uni-list-item>
146 146 </uni-list>
... ... @@ -213,6 +213,7 @@ export default {
213 213 max: { type: Number, default: 8 },
214 214 deliveryDateBase: { type: String, default: '' },
215 215 options: { type: Array, default: () => [] },
  216 + deliveryDate: { type: String, default: '' },
216 217 rawToProdRatioList: { type: Array, default: () => [] }
217 218 },
218 219 components: { SingleSelectSheet },
... ... @@ -230,14 +231,28 @@ export default {
230 231 label: o.label != null ? o.label : (o.text != null ? o.text : (o.name != null ? o.name : '')),
231 232 value: o.value != null ? o.value : (o.id != null ? o.id : o.rawProductId)
232 233 }))
233   - }
234   - ,
  234 + },
235 235 ratioOptions() {
236 236 const list = Array.isArray(this.rawToProdRatioList) ? this.rawToProdRatioList : []
237 237 return list.map(o => ({
238 238 label: o.label != null ? o.label : (o.text != null ? o.text : (o.name != null ? o.name : '')),
239 239 value: o.value != null ? o.value : (o.id != null ? o.id : o.code)
240 240 }))
  241 + },
  242 + minDeliveryDate() {
  243 + const s = this.deliveryDate
  244 + if (!s) return ''
  245 + const parts = String(s).split('-')
  246 + const y = Number(parts[0])
  247 + const m = Number(parts[1])
  248 + const d = Number(parts[2])
  249 + if (!y || !m || !d) return ''
  250 + const dt = new Date(y, m - 1, d)
  251 + dt.setDate(dt.getDate() + 1)
  252 + const yy = dt.getFullYear()
  253 + const mm = String(dt.getMonth() + 1).padStart(2, '0')
  254 + const dd = String(dt.getDate() - 1).padStart(2, '0')
  255 + return `${yy}/${mm}/${dd}`
241 256 }
242 257 },
243 258 watch: {
... ...
... ... @@ -39,7 +39,7 @@
39 39 <view class="item-title"><text class="required">*</text><text>生产厂</text></view>
40 40 </template>
41 41 </uni-list-item>
42   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" />
  42 + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :deliveryDate="form.orderDate" @change="onProductsChange" :options="productList" />
43 43 <uni-list-item title="合计人民币金额(大写)">
44 44 <template v-slot:footer>
45 45 <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled />
... ...
... ... @@ -41,7 +41,7 @@
41 41 </template>
42 42 </uni-list-item>
43 43
44   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" />
  44 + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :deliveryDate="form.orderDate" :list="productLineList" @change="onProductsChange" :options="productList" />
45 45
46 46 <uni-list-item title="合计人民币金额(大写)">
47 47 <template v-slot:footer>
... ...
... ... @@ -129,7 +129,7 @@
129 129 </uni-list-item>
130 130 <uni-list-item title="发货日期">
131 131 <template v-slot:footer>
132   - <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
  132 + <uni-datetime-picker :start="minDeliveryDate" type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
133 133 </template>
134 134 </uni-list-item>
135 135 </uni-list>
... ... @@ -200,6 +200,7 @@ export default {
200 200 list: { type: Array, default: () => [] },
201 201 max: { type: Number, default: 8 },
202 202 deliveryDateBase: { type: String, default: '' },
  203 + deliveryDate: { type: String, default: '' },
203 204 options: { type: Array, default: () => [] }
204 205 },
205 206 components: { SingleSelectSheet },
... ... @@ -217,6 +218,21 @@ export default {
217 218 label: o.label != null ? o.label : (o.text != null ? o.text : (o.name != null ? o.name : '')),
218 219 value: o.value != null ? o.value : (o.id != null ? o.id : o.productId)
219 220 }))
  221 + },
  222 + minDeliveryDate() {
  223 + const s = this.deliveryDate
  224 + if (!s) return ''
  225 + const parts = String(s).split('-')
  226 + const y = Number(parts[0])
  227 + const m = Number(parts[1])
  228 + const d = Number(parts[2])
  229 + if (!y || !m || !d) return ''
  230 + const dt = new Date(y, m - 1, d)
  231 + dt.setDate(dt.getDate() + 1)
  232 + const yy = dt.getFullYear()
  233 + const mm = String(dt.getMonth() + 1).padStart(2, '0')
  234 + const dd = String(dt.getDate() - 1).padStart(2, '0')
  235 + return `${yy}/${mm}/${dd}`
220 236 }
221 237 },
222 238 watch: {
... ...
... ... @@ -39,7 +39,7 @@
39 39 <view class="item-title"><text class="required">*</text><text>生产厂</text></view>
40 40 </template>
41 41 </uni-list-item>
42   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" />
  42 + <ProductRel mode="add" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" />
43 43 <uni-list-item title="合计人民币金额(大写)">
44 44 <template v-slot:footer>
45 45 <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled />
... ...
... ... @@ -41,7 +41,7 @@
41 41 </template>
42 42 </uni-list-item>
43 43
44   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" />
  44 + <ProductRel mode="add" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" />
45 45
46 46 <uni-list-item title="合计人民币金额(大写)">
47 47 <template v-slot:footer>
... ...
... ... @@ -129,7 +129,7 @@
129 129 </uni-list-item>
130 130 <uni-list-item title="发货日期">
131 131 <template v-slot:footer>
132   - <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
  132 + <uni-datetime-picker :start="minDeliveryDate" type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
133 133 </template>
134 134 </uni-list-item>
135 135 </uni-list>
... ... @@ -200,6 +200,7 @@ export default {
200 200 list: { type: Array, default: () => [] },
201 201 max: { type: Number, default: 8 },
202 202 deliveryDateBase: { type: String, default: '' },
  203 + deliveryDate: { type: String, default: '' },
203 204 options: { type: Array, default: () => [] }
204 205 },
205 206 components: { SingleSelectSheet },
... ... @@ -217,6 +218,22 @@ export default {
217 218 label: o.label != null ? o.label : (o.text != null ? o.text : (o.name != null ? o.name : '')),
218 219 value: o.value != null ? o.value : (o.id != null ? o.id : o.productId)
219 220 }))
  221 + },
  222 +
  223 + minDeliveryDate() {
  224 + const s = this.deliveryDate
  225 + if (!s) return ''
  226 + const parts = String(s).split('-')
  227 + const y = Number(parts[0])
  228 + const m = Number(parts[1])
  229 + const d = Number(parts[2])
  230 + if (!y || !m || !d) return ''
  231 + const dt = new Date(y, m - 1, d)
  232 + dt.setDate(dt.getDate() + 1)
  233 + const yy = dt.getFullYear()
  234 + const mm = String(dt.getMonth() + 1).padStart(2, '0')
  235 + const dd = String(dt.getDate() - 1).padStart(2, '0')
  236 + return `${yy}/${mm}/${dd}`
220 237 }
221 238 },
222 239 watch: {
... ...
... ... @@ -25,7 +25,7 @@
25 25
26 26 <script>
27 27 import DetailButtons from '@/components/detail-buttons/index.vue'
28   -import { getSpecDetailApi } from '@/api/contract.js'
  28 +import { getSpecDetailApi, cancelApi } from '@/api/contract.js'
29 29
30 30 export default {
31 31 components: { DetailButtons },
... ... @@ -35,14 +35,24 @@ export default {
35 35 form: {
36 36 id: '', contractCode: '', customerName: '', deptName: '', workshopName: '', contractType: '', contractDocumentDate: '', applicationCount: '', totalQuantity: '', specLockDate: '', delayReason: '', orderDate: ''
37 37
38   - }
  38 + },
  39 + buttons: [
  40 + { text: '编辑', variant: 'outline', visible: true, event: 'edit' },
  41 + { text: '审核', variant: 'outline', visible: true, event: 'audit' },
  42 + { text: '审核详情', variant: 'outline', visible: true, event: 'auditDetail' },
  43 + { text: '取消', variant: 'danger', visible: true, event: 'cancel' },
  44 + ]
39 45 }
40 46 },
41 47 computed: {
42 48 displayButtons() {
  49 + const s = this.form.approvalStatus || false
  50 + const e = this.form.showExamine || false
43 51 return [
44   - // { text: '删除', variant: 'danger' },
45   - { text: '编辑', variant: 'outline' }
  52 + { ...this.buttons[0], visible: (s === 'REFUSE' && this.$auth.hasPermi('contract-manage:unlocked-operation-application:modify')) },
  53 + { ...this.buttons[1], visible: (s === 'AUDIT' && e && this.$auth.hasPermi('contract-manage:unlocked-operation-application:approve')) },
  54 + { ...this.buttons[2], visible: (s !== 'REFUSE' && this.$auth.hasPermi('contract-manage:unlocked-operation-application:review')) },
  55 + { ...this.buttons[3], visible: (s === 'REFUSE' && this.$auth.hasPermi('contract-manage:unlocked-operation-application:cancel')) },
46 56 ]
47 57 }
48 58 },
... ... @@ -60,6 +70,7 @@ export default {
60 70 const m = d || {}
61 71 const yesNo = m.hasFrameworkAgreement === 'Y' || m.hasFrameworkAgreement === true
62 72 this.form = {
  73 + ...res.data || {},
63 74 id: m.id || '',
64 75 contractCode: m.contractCode || '',
65 76 customerName: m.customerName || (m.customer && m.customer.name) || '',
... ... @@ -75,13 +86,52 @@ export default {
75 86 }
76 87 })
77 88 },
  89 + onEdit() {
  90 + if (!this.form.id) return
  91 + uni.navigateTo({ url: `/pages/contract_unlocked_operation/modify?id=${this.form.id}` })
  92 + },
  93 + onAudit(id, type) {
  94 + const CACHE_KEY = 'sourceBusinessId'
  95 + // const TYPE = 'contractType'
  96 + // uni.setStorageSync(TYPE, type)
  97 + uni.setStorageSync(CACHE_KEY, id)
  98 + uni.navigateTo({ url: '/pages/flow/audit' })
  99 + },
  100 + onAuditDetail(id, type) {
  101 + console.log(id,'id')
  102 + const CACHE_KEY = 'sourceBusinessId'
  103 + // const TYPE = 'contractType'
  104 + // uni.setStorageSync(TYPE, type)
  105 + uni.setStorageSync(CACHE_KEY, id)
  106 + uni.navigateTo({ url: '/pages/flow/audit_detail' })
  107 + },
  108 + onCancel(id) {
  109 + uni.showModal({
  110 + title: '确认取消吗?',
  111 + success: (res) => {
  112 + if (res.confirm) {
  113 + uni.showLoading({ title: '取消中...' })
  114 + cancelApi(id).then(res => {
  115 + uni.hideLoading()
  116 + if (res.code === 200) {
  117 + uni.showToast({ title: '取消成功' })
  118 + this.loadDetail()
  119 + } else {
  120 + uni.showToast({ title: res.msg || '取消失败' })
  121 + }
  122 + })
  123 + }
  124 + }
  125 + })
  126 + },
78 127 handleButtonClick(btn) {
79   - if (btn && btn.text === '编辑') {
80   - return uni.navigateTo({ url: `/pages/contract_unlocked_operation/modify?id=${this.id}` })
81   - }
82   - // if (btn && btn.text === '删除') {
83   - // uni.showToast({ title: '暂未接入删除接口', icon: 'none' })
84   - // }
  128 + if (!btn || btn.disabled) return
  129 + if (typeof btn.onClick === 'function') return btn.onClick(this.form, btn.params)
  130 + const e = btn.event || ''
  131 + if (e === 'edit') return this.onEdit(btn && btn.params)
  132 + if (e === 'audit') return this.onAudit(this.form.id || '')
  133 + if (e === 'auditDetail') return this.onAuditDetail(this.form.id || '')
  134 + if (e === 'cancel') return this.onCancel(this.form.id || '')
85 135 }
86 136 }
87 137 }
... ...
... ... @@ -6,7 +6,7 @@
6 6 cancelButton="none" bgColor="#F3F3F3" textColor="rgba(0,0,0,0.4)" @confirm="search" @input="onSearchInput" />
7 7 <view class="tool-icons">
8 8 <!-- <image class="tool-icon" src="/static/images/dev_manage/add_icon.png" @click="onAdd" /> -->
9   - <!-- <image class="tool-icon" src="/static/images/dev_manage/filter_icon.png" @click="openFilter" /> -->
  9 + <image class="tool-icon" src="/static/images/dev_manage/filter_icon.png" @click="openFilter" />
10 10 </view>
11 11 </view>
12 12
... ... @@ -39,22 +39,19 @@
39 39 </card-list>
40 40 </view>
41 41 <!-- 筛选弹框 -->
42   - <!-- <filter-modal :visible.sync="filterVisible" :value.sync="filterForm" title="筛选" @reset="onFilterReset"
  42 + <filter-modal :visible.sync="filterVisible" :value.sync="filterForm" title="筛选" @reset="onFilterReset"
43 43 @confirm="onFilterConfirm">
44 44 <template v-slot="{ model }">
45 45 <view class="filter-form">
46 46 <view class="form-item">
47   - <view class="label">品种</view>
  47 + <view class="label">审核状态</view>
48 48 <uni-data-checkbox mode="tag" :multiple="false" :value-field="'value'" :text-field="'text'"
49   - v-model="model.materialTypeId" @change="onMaterialTypeChange" :localdata="materialTypeOptions" />
50   - </view>
51   - <view class="form-item">
52   - <view class="label">授权截止时间</view>
53   - <uni-datetime-picker type="daterange" v-model="model.dateRange" start="2023-01-01" />
  49 + v-model="model.approvalStatus" @change="onApprovalStatusChange" :localdata="auditStatusOptions" />
54 50 </view>
  51 +
55 52 </view>
56 53 </template>
57   - </filter-modal> -->
  54 + </filter-modal>
58 55 </view>
59 56 </template>
60 57
... ... @@ -74,13 +71,14 @@ export default {
74 71 // 批量选择
75 72 batchMode: false,
76 73 // 给到 card 的筛选值
77   - query: { materialTypeId: '', dateRange: [] },
  74 + query: { materialTypeId: '', dateRange: [], approvalStatus: '' },
78 75 extraParams: {},
79 76
80 77 // 筛选弹框
81 78 filterVisible: false,
82   - filterForm: { materialTypeId: '', dateRange: [] },
  79 + filterForm: { materialTypeId: '', dateRange: [], approvalStatus: '' },
83 80 materialTypeOptions: [],
  81 + auditStatusOptions: [],
84 82 statusMap
85 83 }
86 84
... ... @@ -93,6 +91,7 @@ export default {
93 91 },
94 92 created() {
95 93 this.getProductVariety();
  94 + this.loadAuditStatusOptions();
96 95 },
97 96 // 页面触底兜底:当页面自身滚动到底部时,转调卡片组件加载更多
98 97 onReachBottom() {
... ... @@ -162,6 +161,9 @@ export default {
162 161 },
163 162 onFilterConfirm(payload) {
164 163 // 合并筛选值
  164 + if ((payload.approvalStatus === '' || payload.approvalStatus == null) && this.filterForm.approvalStatus !== '') {
  165 + payload.approvalStatus = this.filterForm.approvalStatus
  166 + }
165 167 this.query = { ...this.query, ...payload }
166 168 },
167 169 onMaterialTypeChange(e) {
... ... @@ -198,6 +200,22 @@ export default {
198 200 }))
199 201 })
200 202 },
  203 + async loadAuditStatusOptions() {
  204 + try {
  205 + const dicCodes = ['AUDIT_STATUS']
  206 + const results = await getDicByCodes(dicCodes)
  207 + const option = (results.AUDIT_STATUS && results.AUDIT_STATUS.data) || []
  208 + this.auditStatusOptions = option.map(it => ({ value: it.code, text: it.name }))
  209 + } catch (e) {
  210 + this.auditStatusOptions = []
  211 + }
  212 + },
  213 + onApprovalStatusChange(e) {
  214 + const raw = e && e.detail && e.detail.value !== undefined
  215 + ? e.detail.value
  216 + : (e && e.value !== undefined ? e.value : '')
  217 + this.filterForm.approvalStatus = raw
  218 + },
201 219 }
202 220 }
203 221 </script>
... ...
... ... @@ -39,7 +39,7 @@
39 39 <view class="item-title"><text class="required">*</text><text>生产厂</text></view>
40 40 </template>
41 41 </uni-list-item>
42   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" />
  42 + <ProductRel mode="add" :deliveryDate="form.orderDate" :deliveryDateBase="form.deliveryDate" @change="onProductsChange" :options="productList" />
43 43 <uni-list-item title="合计人民币金额(大写)">
44 44 <template v-slot:footer>
45 45 <uni-easyinput v-model="form.totalAmountCapital" placeholder="自动计算" :inputBorder="false" disabled />
... ...
... ... @@ -41,7 +41,7 @@
41 41 </template>
42 42 </uni-list-item>
43 43
44   - <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :list="productLineList" @change="onProductsChange" :options="productList" />
  44 + <ProductRel mode="add" :deliveryDateBase="form.deliveryDate" :deliveryDate="form.orderDate" :list="productLineList" @change="onProductsChange" :options="productList" />
45 45
46 46 <uni-list-item title="合计人民币金额(大写)">
47 47 <template v-slot:footer>
... ...
... ... @@ -129,7 +129,7 @@
129 129 </uni-list-item>
130 130 <uni-list-item title="发货日期">
131 131 <template v-slot:footer>
132   - <uni-datetime-picker type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
  132 + <uni-datetime-picker :start="minDeliveryDate" type="date" v-model="item.deliveryDate" @change="onDateChange(idx, $event)" />
133 133 </template>
134 134 </uni-list-item>
135 135 </uni-list>
... ... @@ -200,6 +200,7 @@ export default {
200 200 list: { type: Array, default: () => [] },
201 201 max: { type: Number, default: 8 },
202 202 deliveryDateBase: { type: String, default: '' },
  203 + deliveryDate: { type: String, default: '' },
203 204 options: { type: Array, default: () => [] }
204 205 },
205 206 components: { SingleSelectSheet },
... ... @@ -217,6 +218,21 @@ export default {
217 218 label: o.label != null ? o.label : (o.text != null ? o.text : (o.name != null ? o.name : '')),
218 219 value: o.value != null ? o.value : (o.id != null ? o.id : o.productId)
219 220 }))
  221 + },
  222 + minDeliveryDate() {
  223 + const s = this.deliveryDate
  224 + if (!s) return ''
  225 + const parts = String(s).split('-')
  226 + const y = Number(parts[0])
  227 + const m = Number(parts[1])
  228 + const d = Number(parts[2])
  229 + if (!y || !m || !d) return ''
  230 + const dt = new Date(y, m - 1, d)
  231 + dt.setDate(dt.getDate() + 1)
  232 + const yy = dt.getFullYear()
  233 + const mm = String(dt.getMonth() + 1).padStart(2, '0')
  234 + const dd = String(dt.getDate() - 1).padStart(2, '0')
  235 + return `${yy}/${mm}/${dd}`
220 236 }
221 237 },
222 238 watch: {
... ...