|
@@ -18,7 +18,7 @@
|
|
|
option-filter-prop="children"
|
|
|
v-model="form.supplierName"
|
|
|
>
|
|
|
- <a-select-option v-for="item in supplierList" :key="item.id" :value="item.id">
|
|
|
+ <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn">
|
|
|
{{ item.name }}
|
|
|
</a-select-option>
|
|
|
</a-select>
|
|
@@ -30,9 +30,10 @@
|
|
|
allowClear
|
|
|
placeholder="请选择关联客户"
|
|
|
option-filter-prop="children"
|
|
|
+ @change="storeChange"
|
|
|
v-model="form.storeName"
|
|
|
>
|
|
|
- <a-select-option v-for="item in storeList" :key="item.id" :value="item.id">
|
|
|
+ <a-select-option v-for="item in storeList" :key="item.storeSn" :value="item.storeSn">
|
|
|
{{ item.name }}
|
|
|
</a-select-option>
|
|
|
</a-select>
|
|
@@ -54,9 +55,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {
|
|
|
- SettlementRecordsDetailsList
|
|
|
-} from '@/api/FinancialManagement'
|
|
|
+import { supplierStoreBind } from '@/api/storeManagement.js'
|
|
|
export default {
|
|
|
props: {
|
|
|
openStoreBindModal: {
|
|
@@ -95,11 +94,29 @@ export default {
|
|
|
computed: {
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 关联客户选择修改
|
|
|
+ storeChange (val) {
|
|
|
+ console.log(val, 'vvvvvvv')
|
|
|
+ if (val) {
|
|
|
+ const has = this.storeList.find(item => item.storeSn == val)
|
|
|
+ this.form.storeAddress = has ? has.addrProvinceName + has.addrCityName + has.addrDistrictName + has.addrDetail : ''
|
|
|
+ }
|
|
|
+ },
|
|
|
// 提交
|
|
|
submitForm (formName) {
|
|
|
this.$refs[formName].validate(valid => {
|
|
|
if (valid) {
|
|
|
- alert('submit!')
|
|
|
+ const params = {
|
|
|
+ supplierSn: this.form.supplierName,
|
|
|
+ storeSn: this.form.storeName
|
|
|
+ }
|
|
|
+ supplierStoreBind(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.$emit('refresh')
|
|
|
+ this.cancel()
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
console.log('error submit!!')
|
|
|
return false
|
|
@@ -118,9 +135,9 @@ export default {
|
|
|
},
|
|
|
isshow (val) {
|
|
|
if (!val) {
|
|
|
+ this.$refs['ruleForm'].resetFields()
|
|
|
this.$emit('close')
|
|
|
} else {
|
|
|
- this.$refs['ruleForm'].resetFields()
|
|
|
}
|
|
|
},
|
|
|
settleId (newValue, oldValue) {
|