|
@@ -6,16 +6,21 @@
|
|
|
:option="goodsOptionCrud"
|
|
|
:table-loading="loading"
|
|
|
:page.sync="page"
|
|
|
+ v-model="form"
|
|
|
ref="crud"
|
|
|
+ @row-save="rowSave"
|
|
|
+ @row-del="rowDel"
|
|
|
@on-load="onLoad"
|
|
|
@resetColumn="resetColumn"
|
|
|
@saveColumn="saveColumn"
|
|
|
+ @row-update="(form,index,done,loading)=>{rowSave(form,done)}"
|
|
|
@search-change="searchChange"
|
|
|
@search-criteria-switch="searchCriteriaSwitch">
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
|
<el-button
|
|
|
size="small"
|
|
|
type="text"
|
|
|
+ icon="el-icon-picture-outline"
|
|
|
@click="annexOpen(row, index)"
|
|
|
>附 件
|
|
|
</el-button>
|
|
@@ -24,6 +29,7 @@
|
|
|
<el-dialog
|
|
|
title="附件"
|
|
|
:visible.sync="dialogVisible"
|
|
|
+ :close-on-click-modal="false"
|
|
|
append-to-body
|
|
|
width="80%">
|
|
|
<!-- <c-upload-->
|
|
@@ -38,8 +44,12 @@
|
|
|
class="hide"
|
|
|
list-type="picture-card"
|
|
|
:on-preview="handlePictureCardPreview"
|
|
|
+ :action="action"
|
|
|
:file-list="orderList"
|
|
|
- disabled>
|
|
|
+ :headers="headers"
|
|
|
+ :on-remove="onRemove"
|
|
|
+ :on-success="onSuccess"
|
|
|
+ >
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
<el-dialog :visible.sync="visible" append-to-body>
|
|
@@ -47,7 +57,7 @@
|
|
|
</el-dialog>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false" size="small">取 消</el-button>
|
|
|
-<!-- <el-button type="primary" @click="saveAnnex" size="small" :disabled="form.status===4">保 存</el-button>-->
|
|
|
+ <el-button type="primary" @click="saveAnnex" size="small">保 存</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</basic-container>
|
|
@@ -57,8 +67,12 @@
|
|
|
<script>
|
|
|
import {
|
|
|
driverQueryCollection,
|
|
|
- getAttachment
|
|
|
+ getAttachment,
|
|
|
+ enclosure, antiepidemicSave,remove
|
|
|
} from "@/api/landTransportation/antiepidemic";
|
|
|
+import {getToken} from "@/util/auth";
|
|
|
+import {sharedDeletion} from "@/api/user";
|
|
|
+import {deleteDetails} from "@/api/basicData/configuration";
|
|
|
|
|
|
export default {
|
|
|
name: "index",
|
|
@@ -69,6 +83,8 @@ export default {
|
|
|
key:0,
|
|
|
form: {},
|
|
|
orderList:[],
|
|
|
+ action: "/api/blade-resource/oss/endpoint/put-file",
|
|
|
+ headers: { "Blade-Auth": "Bearer " + getToken() },
|
|
|
dialogVisible: false,
|
|
|
loading: false,
|
|
|
activeName:'',
|
|
@@ -84,11 +100,11 @@ export default {
|
|
|
optionList: {
|
|
|
stripe:true,
|
|
|
index: true,
|
|
|
- addBtn: false,
|
|
|
- delBtn: false,
|
|
|
+ addBtn: true,
|
|
|
+ delBtn: true,
|
|
|
cellBtn: false,
|
|
|
cancelBtn: false,
|
|
|
- editBtn: false,
|
|
|
+ // editBtn: false,
|
|
|
addRowBtn: false,
|
|
|
searchIcon: true,
|
|
|
searchIndex: 2,
|
|
@@ -113,10 +129,31 @@ export default {
|
|
|
search: true,
|
|
|
},{
|
|
|
label: '制单日期',
|
|
|
+ type: "date",
|
|
|
+ searchRange: true,
|
|
|
+ defaultTime: ['00:00:00', '23:59:59'],
|
|
|
+ format: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
prop: 'createTime',
|
|
|
overHidden: true,
|
|
|
+ display:false,
|
|
|
+ search: true,
|
|
|
index: 3,
|
|
|
width: 150
|
|
|
+ },{
|
|
|
+ label: '箱号一',
|
|
|
+ prop: 'ctnOne',
|
|
|
+ overHidden: true,
|
|
|
+ index: 4,
|
|
|
+ search: true,
|
|
|
+ width: 150
|
|
|
+ },{
|
|
|
+ label: '箱号二',
|
|
|
+ prop: 'ctnTwo',
|
|
|
+ overHidden: true,
|
|
|
+ index: 5,
|
|
|
+ search: true,
|
|
|
+ width: 150
|
|
|
}
|
|
|
],
|
|
|
},
|
|
@@ -136,6 +173,65 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //删除
|
|
|
+ rowDel(form,index){
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ return remove({ids:form.id});
|
|
|
+ }).then(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page, {})
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //新增
|
|
|
+ rowSave(form,done,loading){
|
|
|
+ // console.log(this.deepClone(this.form))
|
|
|
+ antiepidemicSave({
|
|
|
+ ...this.deepClone(this.form),
|
|
|
+ fileList:[]
|
|
|
+ }).then(res=>{
|
|
|
+ if (res.data.code === 200){
|
|
|
+ if (this.form.id){
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ }else {
|
|
|
+ this.$message.success("新增成功");
|
|
|
+ }
|
|
|
+ this.onLoad(this.page, {})
|
|
|
+ }
|
|
|
+ done()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //保存修改附件
|
|
|
+ saveAnnex(){
|
|
|
+ enclosure(this.orderList).then(res=>{
|
|
|
+ if (res.data.code === 200){
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.dialogVisible = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSuccess(response, file, fileList) {
|
|
|
+ this.orderList.push({
|
|
|
+ fileName:response.data.originalName,
|
|
|
+ url:response.data.link,
|
|
|
+ pid:this.form.id
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onRemove(file, fileList) {
|
|
|
+ sharedDeletion('/api/blade-client/common-file/remove', file.id).then(res => {
|
|
|
+ if (res.data.success) {
|
|
|
+ this.$message.success("操作成功!");
|
|
|
+ this.orderList = fileList
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
handlePictureCardPreview(file) {
|
|
|
this.dialogImageUrl = file.url;
|
|
|
this.visible = true;
|
|
@@ -166,9 +262,9 @@ export default {
|
|
|
// 获得高度
|
|
|
searchCriteriaSwitch(type) {
|
|
|
if (type) {
|
|
|
- this.goodsOptionCrud.height = this.goodsOptionCrud.height - 230
|
|
|
+ this.goodsOptionCrud.height = this.goodsOptionCrud.height - 51
|
|
|
} else {
|
|
|
- this.goodsOptionCrud.height = this.goodsOptionCrud.height + 230
|
|
|
+ this.goodsOptionCrud.height = this.goodsOptionCrud.height + 51
|
|
|
}
|
|
|
this.$refs.crud.getTableHeight()
|
|
|
},
|
|
@@ -221,9 +317,9 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-::v-deep .hide .el-upload--picture-card {
|
|
|
- display: none;
|
|
|
-}
|
|
|
+//::v-deep .hide .el-upload--picture-card {
|
|
|
+// display: none;
|
|
|
+//}
|
|
|
.home-container {
|
|
|
padding: 0px 5px 5px 5px;
|
|
|
box-sizing: border-box;
|