|
@@ -111,7 +111,11 @@
|
|
|
prop="attach"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
- ></el-table-column>
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{ scope.row.attach }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
label="有效期"
|
|
@@ -274,15 +278,15 @@
|
|
|
</el-form-item></el-col
|
|
|
>
|
|
|
</el-row>
|
|
|
- <!-- <el-form-item label="上传提货人附件">
|
|
|
- <el-upload action="#" class="upload-demo" :on-success="handlefile">
|
|
|
- <el-button size="small" type="info">点击上传</el-button>
|
|
|
- </el-upload>
|
|
|
- </el-form-item> -->
|
|
|
+ <el-form-item label="上传提货人附件" prop="fileUrl">
|
|
|
+ <fileUpload :fileList="fileList" />
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="cancelFn">取 消</el-button>
|
|
|
- <el-button type="primary" @click="addDataFn">确 定</el-button>
|
|
|
+ <el-button v-if="showOK" type="primary" @click="addDataFn"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -298,9 +302,15 @@ import {
|
|
|
} from "@/api/basic_data/taker";
|
|
|
import { getDealerList } from "@/api/basic_data/dealer";
|
|
|
import { downloadFiles } from "@/utils/util";
|
|
|
+import fileUpload from "@/components/Common/file-upload.vue";
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ fileUpload,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ baseURL: process.env.VUE_APP_BASE_API,
|
|
|
+ fileList: [],
|
|
|
listLoading: false, // 列表加载loading
|
|
|
currentPage: 1, // 当前页码
|
|
|
pageSize: 10, // 每页数量
|
|
@@ -315,6 +325,7 @@ export default {
|
|
|
expireTime: "",
|
|
|
code: "",
|
|
|
},
|
|
|
+
|
|
|
rules: {
|
|
|
customerId: [
|
|
|
{ required: true, message: "请选择经销商", trigger: "blur" },
|
|
@@ -374,6 +385,7 @@ export default {
|
|
|
},
|
|
|
dealerList: [],
|
|
|
id: "", //重建之前的Id
|
|
|
+ showOK: true,
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
@@ -383,6 +395,7 @@ export default {
|
|
|
methods: {
|
|
|
//重建
|
|
|
rebuild(data) {
|
|
|
+ this.showOK = true;
|
|
|
this.id = data.id;
|
|
|
this.addForm = {
|
|
|
customerId: data.customerId,
|
|
@@ -394,6 +407,7 @@ export default {
|
|
|
expireTime: "",
|
|
|
code: "",
|
|
|
};
|
|
|
+ this.fileList = [];
|
|
|
this.dialogForm = true;
|
|
|
},
|
|
|
//删除
|
|
@@ -404,8 +418,9 @@ export default {
|
|
|
},
|
|
|
//查看
|
|
|
seeFn(data) {
|
|
|
- console.log(data);
|
|
|
+ this.showOK = false;
|
|
|
this.addForm = data;
|
|
|
+ this.fileList = [];
|
|
|
this.dialogForm = true;
|
|
|
},
|
|
|
|
|
@@ -483,15 +498,25 @@ export default {
|
|
|
},
|
|
|
//新增
|
|
|
async addDataFn() {
|
|
|
+ console.log(this.fileList);
|
|
|
await this.$refs.addForm.validate();
|
|
|
|
|
|
const res = this.dealerList.filter(
|
|
|
(v) => v.id === this.addForm.customerId
|
|
|
)[0];
|
|
|
console.log(res);
|
|
|
- await addDataList({ ...this.addForm, orgNumber: res.useOrgNumber });
|
|
|
- await deleDataList({ ids: this.id });
|
|
|
+ await addDataList({
|
|
|
+ ...this.addForm,
|
|
|
+ orgNumber: res.useOrgNumber,
|
|
|
+
|
|
|
+ attach: this.fileList[0].url,
|
|
|
+ });
|
|
|
+ if (this.id) {
|
|
|
+ await deleDataList({ ids: this.id });
|
|
|
+ }
|
|
|
+
|
|
|
this.$message.success("新增成功");
|
|
|
+ this.id = "";
|
|
|
// this.addForm = {
|
|
|
// customerId: "",
|
|
|
// takerName: "",
|
|
@@ -516,6 +541,8 @@ export default {
|
|
|
expireTime: "",
|
|
|
code: "",
|
|
|
};
|
|
|
+ this.fileList = [];
|
|
|
+ this.showOK = true;
|
|
|
this.dialogForm = true;
|
|
|
},
|
|
|
},
|