Commit 9576f458 authored by Marcus's avatar Marcus
parent 465c89da
......@@ -515,6 +515,19 @@ export function warehousePictureList(data){
data
})
}
export function warehousePictureCreate(data){
return request({
url: '/order/warehouse-picture/create',
method: 'post',
data
})
}
export function warehousePictureDelete(id){
return request({
url: '/order/warehouse-picture/delete?id=' + id,
method: 'delete'
})
}
// 获得部门订单分页
export function deptOrderPage(params){
......
......@@ -45,7 +45,7 @@
<script>
import { getToken } from "@/utils/auth";
import { number } from 'echarts/lib/export'
import {warehousePictureCreate} from "@/api/ecw/order";
export default {
props: {
......@@ -69,6 +69,10 @@ export default {
type: {
type: Number,
default: undefined
},
id: {
type: Number,
default: undefined
}
},
data() {
......@@ -122,10 +126,9 @@ export default {
methods: {
// 删除图片
handleRemove(index) {
// todo
console.log(index)
this.fileList.splice(index, 1);
this.$emit("input", this.listToString(this.fileList));
this.$emit("delete", index);
},
// 上传成功回调
handleUploadSuccess(res) {
......@@ -135,10 +138,15 @@ export default {
this.fileList = this.fileList.concat(this.uploadList);
this.uploadList = [];
this.number = 0;
// todo
console.log(res.data)
warehousePictureCreate({
"bizId": this.id,
"type": this.type,
"url": res.data
}).then(() => {
this.$emit("input", this.listToString(this.fileList));
this.$emit("refresh");
this.$modal.closeLoading();
})
}
}else {
this.handleUploadError();
......
......@@ -164,7 +164,15 @@
<span style="font-size: 18px">{{$t('入仓影像')}}</span>
</div>
<div>
<image-and-video-upload :fileSize="50" :isShowTip="true" v-model="form.urls" :type="1"></image-and-video-upload>
<image-and-video-upload
:fileSize="50"
:isShowTip="true"
v-model="form.urls"
:type="1"
:id="orderId"
@delete="handleDeleteImage"
@refresh="getWarehousePictureList"
></image-and-video-upload>
</div>
</el-card>
<div style="text-align: center;margin-top: 15px" v-if="!(order.status !== 3 && isEdit)">
......@@ -222,7 +230,7 @@ import {
getOrderWarehouseIn,
getSpecialListByOrderId, listByOrderId,
orderWarehouseInFinish, orderWarehouseInUpdateLabel,
rollbackDelete, warehousePictureList
rollbackDelete, warehousePictureDelete, warehousePictureList
} from '@/api/ecw/order'
import orderBaseInfo from "@/components/OrderBaseInfo"
import WarehouseAreaDialog from '@/components/WarehouseAreaDialog'
......@@ -284,6 +292,8 @@ export default {
sumVolume: '',
sumWeight: '',
},
// form.urls的完整数据
urlsObject: [],
currencyList:[],
order: {},
orderId: undefined,
......@@ -320,6 +330,12 @@ export default {
},
methods: {
// 删除了入仓影像
handleDeleteImage(index) {
warehousePictureDelete(this.urlsObject[index].id).then(() => {
this.urlsObject.splice(index, 1);
})
},
getOrderItemList(){
this.orderItemList = []
return getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data)
......@@ -333,7 +349,8 @@ export default {
bizId: this.order.orderId,
type: 1
}).then(r =>{
this.form.urls = r.data.map(i =>i.url)
this.form.urls = r.data.map(i =>i.url).reverse()
this.urlsObject = r.data.reverse()
})
},
include(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment