|
@@ -110,6 +110,13 @@
|
|
|
>{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
+ icon="el-icon-upload"
|
|
|
+ type="text"
|
|
|
+ :disabled="disabled || checkDisabled"
|
|
|
+ @click="annexOpen(row, index)"
|
|
|
+ >附件</el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
icon="el-icon-delete"
|
|
|
type="text"
|
|
|
@click="rowDel(row, index)"
|
|
@@ -212,6 +219,24 @@
|
|
|
reportName="交接单"
|
|
|
@onClose="onClose()"
|
|
|
/>
|
|
|
+ <el-dialog
|
|
|
+ title="附件"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ append-to-body
|
|
|
+ width="70%">
|
|
|
+ <c-upload
|
|
|
+ typeUpload="PC"
|
|
|
+ :basic="true"
|
|
|
+ deleteUrl="/api/blade-client/common-file/remove"
|
|
|
+ :data="orderList"
|
|
|
+ :disabled="upLoadForm.status >= 2"
|
|
|
+ :enumerationValue="124"
|
|
|
+ ></c-upload>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false" size="small">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="saveAnnex" size="small" :disabled="upLoadForm.status >= 2">保 存</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -230,7 +255,13 @@ import { getCurrentDate } from "@/util/date";
|
|
|
import { contrastObj, contrastList } from "@/util/contrastData";
|
|
|
import check from "@/components/check/check";
|
|
|
import checkSchedule from "@/components/check/checkSchedule";
|
|
|
-import {dataDetail, typeSave, removeGoods, pleaseCheck} from "@/api/standAlone/handoverSheet";
|
|
|
+import {
|
|
|
+ dataDetail,
|
|
|
+ typeSave,
|
|
|
+ removeGoods,
|
|
|
+ pleaseCheck,
|
|
|
+ saveAttached,
|
|
|
+ getAttachment} from "@/api/standAlone/handoverSheet";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
|
|
|
export default {
|
|
@@ -349,6 +380,10 @@ export default {
|
|
|
checkDialog: false,
|
|
|
checkScheduleDialog: false,
|
|
|
checkData: {},
|
|
|
+ dialogVisible: false,
|
|
|
+ orderList: [],
|
|
|
+ upLoadForm: {},
|
|
|
+ rowIndex: null, //暂存明细下标
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
@@ -436,6 +471,9 @@ export default {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
this.$set(this.form, 'itemList', this.dataList)
|
|
|
+ this.form.itemList.forEach(item => {
|
|
|
+ item.fileList = item.fileList? item.fileList: [];
|
|
|
+ })
|
|
|
this.btnLoading = true;
|
|
|
typeSave(this.form).then(res => {
|
|
|
this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
|
|
@@ -585,6 +623,40 @@ export default {
|
|
|
onClose(val) {
|
|
|
this.switchDialog = val;
|
|
|
},
|
|
|
+ //打开附件
|
|
|
+ annexOpen(row, index) {
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.upLoadForm = row
|
|
|
+ if (row.id) {
|
|
|
+ getAttachment({id: row.id}).then(res => {
|
|
|
+ this.orderList = res.data.data? res.data.data: [];
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$set(row, 'fileList', row.fileList? row.fileList: []); // 新数据默认插入空
|
|
|
+ this.orderList = [...row.fileList];
|
|
|
+ this.rowIndex = index;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //保存
|
|
|
+ saveAnnex() {
|
|
|
+ if (this.upLoadForm.id) {
|
|
|
+ this.orderList.forEach(item => this.$set(item, 'pid', this.upLoadForm.id))
|
|
|
+ saveAttached(this.orderList).then(res => {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.rowIndex = null;
|
|
|
+ this.orderList = [];
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.dataList[this.rowIndex].fileList = [...this.orderList];
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.rowIndex = null;
|
|
|
+ this.orderList = [];
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|