|
@@ -12,6 +12,29 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <div class="f-box">
|
|
|
+ <el-form
|
|
|
+ :inline="true"
|
|
|
+ class="demo-form-inline"
|
|
|
+ label-width="80px"
|
|
|
+ >
|
|
|
+ <el-form-item label="父级单位">
|
|
|
+ <el-autocomplete
|
|
|
+ class="inline-input"
|
|
|
+ v-model="stateSupplier"
|
|
|
+ :fetch-suggestions="querySearchSupplier"
|
|
|
+ placeholder="请输入父级单位名称(非必填)"
|
|
|
+ :trigger-on-focus="false"
|
|
|
+ @select="handleSelectSupplier"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ item }">
|
|
|
+ <div class="name">{{ item.supplierName }}</div>
|
|
|
+ </template>
|
|
|
+ </el-autocomplete>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="button-box">
|
|
|
<el-button @click="onClickCancel">返回</el-button>
|
|
|
<el-button type="primary" @click="onClickConfirm">确认</el-button>
|
|
@@ -21,12 +44,18 @@
|
|
|
|
|
|
<script>
|
|
|
import PageTitle from "@/components/Page/Title";
|
|
|
-import { sjTime,isNumber } from "@/utils/sharedJsFile";
|
|
|
export default {
|
|
|
components: { PageTitle },
|
|
|
data() {
|
|
|
return {
|
|
|
form1: {},
|
|
|
+ //发货单位名称
|
|
|
+ supplierName: "",
|
|
|
+ //发货单位id
|
|
|
+ supplierId: null,
|
|
|
+ restaurantsSupplier:null,
|
|
|
+ stateSupplier:null,
|
|
|
+ farName: "",
|
|
|
};
|
|
|
},
|
|
|
|
|
@@ -35,8 +64,32 @@ export default {
|
|
|
this.information();
|
|
|
},
|
|
|
methods: {
|
|
|
+ //发货单位弹出层
|
|
|
+ handleSelectSupplier(item){
|
|
|
+ console.log("enter")
|
|
|
+ this.supplierId = item.supplierId
|
|
|
+ item.supplierName = this.supplierName
|
|
|
+ },
|
|
|
+ //以下是发货单位边输边查搜索
|
|
|
+ querySearchSupplier(queryString, cb) {
|
|
|
+ this.axios.post('/api/v1/uc/getSupplierMesByLike?index='+this.stateSupplier).then((res)=>{
|
|
|
+ if(res.data.code == "200"){
|
|
|
+ var restaurantsSupplier = res.data.data
|
|
|
+ var results = queryString ? restaurantsSupplier.filter(this.createFilterSupplier(queryString)) :restaurantsSupplier;
|
|
|
+ // 调用 callback 返回建议列表的数据
|
|
|
+ cb(results);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ createFilterSupplier(queryString) {
|
|
|
+ return (restaurantsSupplier) => {
|
|
|
+ return (restaurantsSupplier.value.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //以上是发货单位边输边查搜索
|
|
|
+
|
|
|
information() {
|
|
|
- console.log("supplierId",this.$router.params);
|
|
|
+ console.log("supplierIds",this.$router.params);
|
|
|
//编辑
|
|
|
this.axios
|
|
|
.post(
|
|
@@ -44,13 +97,10 @@ export default {
|
|
|
this.$route.params.supplierId
|
|
|
)
|
|
|
.then((res) => {
|
|
|
- console.log(res)
|
|
|
- res.data.data.forEach((e) => {
|
|
|
- this.form1 = e;
|
|
|
- console.log(e);
|
|
|
- console.log(this.form1);
|
|
|
- console.log(this.$route.params.supplierId);
|
|
|
- });
|
|
|
+ this.form1 = res.data.data[0];
|
|
|
+ this.stateSupplier = res.data.data[0].farName;
|
|
|
+ this.supplierId = res.data.data[0].shipperId;
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
// 返回
|
|
@@ -61,13 +111,15 @@ export default {
|
|
|
onClickConfirm() {
|
|
|
console.log(this.form1)
|
|
|
let RmsSupplier={
|
|
|
- supplierId: this.form1.supplierId,
|
|
|
+ supplierOfId: this.form1.supplierId,
|
|
|
supplierName: this.form1.supplierName,
|
|
|
supplierAddress: this.form1.supplierAddress,
|
|
|
- supplierRegisterDate: sjTime(this.form1.supplierRegisterDate),
|
|
|
+ supplierRegisterDate: this.form1.supplierRegisterDate,
|
|
|
supplierContactsName: this.form1.supplierContactsName,
|
|
|
- supplierContactNumber: this.form1.supplierContactNumber
|
|
|
+ supplierContactNumber: this.form1.supplierContactNumber,
|
|
|
+ supplierIds: this.supplierId
|
|
|
};
|
|
|
+ console.log("RmsSupplier",RmsSupplier)
|
|
|
if(
|
|
|
RmsSupplier.supplierName==null
|
|
|
)this.$message.error("存在空值!");
|
|
@@ -95,4 +147,7 @@ export default {
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
}
|
|
|
+ .f-box{
|
|
|
+ margin-left: 36%;
|
|
|
+ }
|
|
|
</style>
|