Commit 83dfe960 by LJM

取消发货

parent 6f937fdc
......@@ -124,7 +124,6 @@
source_type: this.formInline.source_type,
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
......
......@@ -43,37 +43,21 @@
<el-table-column prop="create_name" label="创建人" min-width="100"></el-table-column>
<el-table-column prop="purchase_name" label="订单人员" min-width="100"></el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]"
:total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page">
</el-pagination>
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div>
</div>
<Menu />
<Menu/>
</section>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {
Form,
FormItem,
Select,
Option,
Input,
Button,
Table,
TableColumn,
Message,
Dialog,
Pagination,
Autocomplete
} from 'element-ui'
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Autocomplete, Button, Dialog, Form, FormItem, Input, Message, Option, Pagination, Select, Table, TableColumn} from 'element-ui'
Vue.prototype.$message = Message;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination);
Vue.use(TableColumn).use(Table).use(Autocomplete);
export default {
Vue.prototype.$message = Message;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination);
Vue.use(TableColumn).use(Table).use(Autocomplete);
export default {
name: "orderTrackInvoice",
data() {
return {
......@@ -103,10 +87,8 @@
brand_name: this.formInline.brand_name,
goods_name: this.formInline.goods_name,
status: this.formInline.status,
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
......@@ -134,41 +116,60 @@
},
//取消发货
cancelSend() {
if (this.multipleSelection.length == 0) {
this.$message({
message: "请选择一条数据进行操作",
type: 'warning'
});
return
}
if (this.multipleSelection.length != 1) {
if (this.multipleSelection.length <= 0) {
this.$message({
message: "只能单条操作",
message: "请勾选数据进行操作",
type: 'warning'
});
return
}
var obj_ = {
"supplier_id": this.multipleSelection[0].supplier_id, //供应商id
"cancelStockInList": [{
"stock_in_id": this.multipleSelection[0].stock_in_id, //发货单id
"purchase_uid": this.multipleSelection[0].purchase_uid //采购员id
}]
}
this.$http('post', "/open/yunXin/cancelSupDelivery", obj_).then(res => {
let stock_in_ids = [];
stock_in_ids = this.multipleSelection.map(obj => {
return obj.stock_in_id;
})
let source_arr = [];
let status_arr = [];
source_arr = this.multipleSelection.map(obj => {
return obj.source;
})
status_arr = this.multipleSelection.map(obj => {
return obj.status;
})
let source = source_arr.every(ele => ele === 2)
if (source) {
let status = status_arr.every(ele => ele === 2)
if (status) {
this.$http('POST', "/api/purchase/cancelSupDelivery", {stock_in_ids: stock_in_ids.join(',')}).then(res => {
if (res.code == 0) {
this.$message({
message: "操作成功",
type: 'success'
});
type: 'success',
duration: 2000,
onClose() {
this.getData();
}
});
} else {
this.$message({
message: res.msg,
message: '请选择作废待入库状态',
type: 'error'
});
}
})
} else {
this.$message({
message: '请选择云芯系统的发货单',
type: 'warning'
});
}
} else {
this.$message({
message: '请选择云芯系统的发货单',
type: 'warning'
});
}
},
//型号
querySearchAsync(queryString, cb) {
......@@ -216,8 +217,8 @@
components: {
Menu
}
};
};
</script>
<style scoped>
@import "../../assets/css/goods/goods.min.css";
@import "../../assets/css/goods/goods.min.css";
</style>
\ No newline at end of file
......@@ -43,7 +43,7 @@
</div>
</el-form>
<div class="data-box th-all">
<el-table :data="purOrderDetail.purchase_item_list" border max-height="600" :row-class-name="tableRowClassName" @selection-change="handleSelectionChange" @select="onRowClick">
<el-table :data="purOrderDetail.purchase_item_list" border max-height="600" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="37"></el-table-column>
<el-table-column prop="goods_name" label="型号" min-width="15%"></el-table-column>
<el-table-column prop="brand_name" label="品牌" min-width="15%"></el-table-column>
......@@ -78,7 +78,6 @@ export default {
purOrderDetail: {},//基本信息,发货信息
purchase_uid: '',
multipleSelection: [],//选中的数据
currentRowIndex: [],//选中数据的索引
rules: {
shipping_id: [{
required: true,
......@@ -141,15 +140,6 @@ export default {
handleSelectionChange(val) {
this.multipleSelection = val;
},
tableRowClassName({row, rowIndex}) {
row.row_index = rowIndex
},
onRowClick(row) {
this.currentRowIndex = []
for (var i = 0; i < row.length; i++) {
this.currentRowIndex.push(row[i].row_index)
}
},
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
......@@ -161,10 +151,18 @@ export default {
return false;
}
this.formParam.itemlist = JSON.stringify(this.itemlist);
let filterArr = [];
for (let i = 0; i < this.multipleSelection.length; i++) {
if (this.multipleSelection[i].purchase_item_id == this.itemlist[i].purchase_item_id) {
filterArr.push(this.itemlist[i])
}
}
this.formParam.itemlist = filterArr;
this.$http('POST', "/api/purchase/addSupDelivery", this.formParam).then(res => {
if (res.code === 0) {
this.$router.push({
path: "/orderTrackGoods",
})
} else {
this.$message({
message: res.msg,
......
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 sign in to comment