|
|
@@ -78,6 +78,7 @@
|
|
|
</template>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <credit-config-dialog ref="creditDialog" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -89,9 +90,13 @@ import {
|
|
|
addCredit,
|
|
|
deleteCredit
|
|
|
} from './api'
|
|
|
+import CreditConfigDialog from './components/CreditConfigDialog'
|
|
|
|
|
|
export default {
|
|
|
name: 'StockAssign',
|
|
|
+ components: {
|
|
|
+ CreditConfigDialog
|
|
|
+ },
|
|
|
data () {
|
|
|
const auditTypeOptions = [
|
|
|
{ value: 1, label: '图片' },
|
|
|
@@ -110,7 +115,8 @@ export default {
|
|
|
condition: { auditType: void 0 },
|
|
|
list: this.getTenantCredits,
|
|
|
buttons: [
|
|
|
- { type: 'add', label: '分配', on: this.onAdd }
|
|
|
+ { type: 'add', label: '分配', on: this.onAdd },
|
|
|
+ { label: '阈值配置', on: this.onConfig }
|
|
|
],
|
|
|
filters: [
|
|
|
{ key: 'auditType', type: 'select', placeholder: '全部类型', options: auditTypeOptions }
|
|
|
@@ -205,7 +211,7 @@ export default {
|
|
|
this.$refs.stockDialog.show()
|
|
|
},
|
|
|
onChoosen ({ value, done }) {
|
|
|
- const { auditType, initialAmount, allocatedAmount } = value
|
|
|
+ const { auditType, initialAmount, allocatedAmount, effectiveDate, expiryDate } = value
|
|
|
if (initialAmount - allocatedAmount < 1) {
|
|
|
this.$message({
|
|
|
type: 'warning',
|
|
|
@@ -216,8 +222,8 @@ export default {
|
|
|
this.fromCredit = value
|
|
|
this.credit = {
|
|
|
auditType,
|
|
|
- initialAmount: 1,
|
|
|
- date: ''
|
|
|
+ initialAmount: this.remaining,
|
|
|
+ date: [effectiveDate, expiryDate]
|
|
|
}
|
|
|
done()
|
|
|
this.$refs.addDialog.show()
|
|
|
@@ -248,6 +254,9 @@ export default {
|
|
|
deleteCredit(credit).then(() => {
|
|
|
this.$refs.table.decrease(1)
|
|
|
})
|
|
|
+ },
|
|
|
+ onConfig () {
|
|
|
+ this.$refs.creditDialog.show(this.group.path)
|
|
|
}
|
|
|
}
|
|
|
}
|