|
@@ -9,21 +9,28 @@
|
|
|
class="change-form"
|
|
|
>
|
|
|
<el-form-item label="订单" prop="order_id" class="change-form-item">
|
|
|
- <el-input
|
|
|
- v-model="goodsExchangeAddForm.order_id"
|
|
|
- :disabled="type === 'detail' || type === 'audit'"
|
|
|
- ref="order"
|
|
|
- @blur="blurUsername()"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
+ <span>
|
|
|
+ <el-input
|
|
|
+ v-model="goodsExchangeAddForm.order_id"
|
|
|
+ :disabled="type === 'detail' || type === 'audit'"
|
|
|
+ ref="order"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <el-button @click="blurUsername()">搜索</el-button>
|
|
|
+ <el-button @click="orderBtn">订单列表</el-button>
|
|
|
+ </span>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="warehouse_id" label="入库仓库" class="change-form-item">
|
|
|
+ <el-form-item
|
|
|
+ prop="warehouse_id"
|
|
|
+ label="入库仓库"
|
|
|
+ class="change-form-item"
|
|
|
+ >
|
|
|
<el-select
|
|
|
v-model="goodsExchangeAddForm.warehouse_id"
|
|
|
clearable
|
|
|
:disabled="type === 'detail' || type === 'audit'"
|
|
|
>
|
|
|
- <!-- @change="handleChangeWareHouse" -->
|
|
|
+ <!--@blur="" @change="handleChangeWareHouse" -->
|
|
|
<el-option
|
|
|
v-for="item in warehouseList"
|
|
|
:key="item.id"
|
|
@@ -105,35 +112,33 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="条码">
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- {{ scope.row.bar_code }} -->
|
|
|
<span v-if="id">{{ scope.row.product_vo.bar_code }}</span>
|
|
|
- <span v-else>{{ scope.row.bar_code }}</span>
|
|
|
+ <span v-else>{{ scope.row.bar_code }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="序列号">
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- {{ scope.row.sn_code }} -->
|
|
|
<span v-if="id">{{ scope.row.product_vo.sn_code }}</span>
|
|
|
- <span v-else>{{ scope.row.sn_code }}</span>
|
|
|
+ <span v-else>{{ scope.row.sn_code }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="规格型号" v-if="id">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.product_vo.spec_name.join('/') }}
|
|
|
+ {{ scope.row.product_vo.spec_name.join("/") }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="规格型号" v-else>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.spec_name.join('/') }}
|
|
|
+ {{ scope.row.spec_name.join("/") }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="单位">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="id">{{ scope.row.product_vo.unit }}</span>
|
|
|
- <span v-else>{{ scope.row.unit }}</span>
|
|
|
+ <span v-if="id">{{ scope.row.product_vo.unit }}</span>
|
|
|
+ <span v-else>{{ scope.row.unit }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column label="订单数量">
|
|
|
+ <!-- <el-table-column label="订单数量">
|
|
|
|
|
|
</el-table-column> -->
|
|
|
<el-table-column label="入库数量">
|
|
@@ -166,10 +171,7 @@
|
|
|
size="mini"
|
|
|
type="danger"
|
|
|
@click="
|
|
|
- goodsExchangeAddForm.product_list.splice(
|
|
|
- scope.$index,
|
|
|
- 1
|
|
|
- )
|
|
|
+ goodsExchangeAddForm.product_list.splice(scope.$index, 1)
|
|
|
"
|
|
|
>删除</el-button
|
|
|
>
|
|
@@ -269,30 +271,110 @@
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
<el-table-column prop="" label="商品编号">
|
|
|
<template slot-scope="scope">
|
|
|
- {{scope.row.goods_vo.sn}}
|
|
|
+ {{ scope.row.goods_vo.sn }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="bar_code" label="商品条码">
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column prop="bar_code" label="商品条码"> </el-table-column>
|
|
|
<el-table-column prop="bar_code" label="序列号"></el-table-column>
|
|
|
<el-table-column prop="" label="商品名称">
|
|
|
<template slot-scope="scope">
|
|
|
- {{scope.row.goods_vo.name}}
|
|
|
+ {{ scope.row.goods_vo.name }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="goods_style" label="规格型号">
|
|
|
<template slot-scope="scope">
|
|
|
- {{scope.row.spec_name.join('/')}}
|
|
|
+ {{ scope.row.spec_name.join("/") }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="unit" label="单位"> </el-table-column>
|
|
|
<!-- <el-table-column prop="product_list.stock_num" label="库存数量"> </el-table-column> -->
|
|
|
</el-table>
|
|
|
+ <!-- <el-pagination
|
|
|
+ slot="pagination"
|
|
|
+ @size-change="handlePageSizeChange"
|
|
|
+ @current-change="handlePageCurrentChange"
|
|
|
+ :current-page="goodsData.page_no"
|
|
|
+ :page-sizes="[10, 20, 50, 100]"
|
|
|
+ :page-size="goodsData.page_size"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="goodsData.data_total"
|
|
|
+ >
|
|
|
+ </el-pagination> -->
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="closeGoosData">取 消</el-button>
|
|
|
<el-button type="primary" @click="submitGoosData()">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="订单列表"
|
|
|
+ :visible.sync="orderVisible"
|
|
|
+ width="1000px"
|
|
|
+ @close="closeGoosData"
|
|
|
+ >
|
|
|
+ <el-table
|
|
|
+ :data="orderList.data"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
+ <el-table-column prop="" label="订单编号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.sn }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+<!-- <el-table-column prop="member_id" label="客户">
|
|
|
+ <template slot-scope="scope">{{
|
|
|
+ memberType(scope.row.member_id)
|
|
|
+ }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ --> <el-table-column prop="order_time" label="下单时间">
|
|
|
+ <template slot-scope="scope">{{
|
|
|
+ scope.row.order_time | unixToDate
|
|
|
+ }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="" label="仓库名称">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ warehouseName(scope.row.warehouse_id) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="" label="配送方式">
|
|
|
+ <template slot-scope="scope">{{
|
|
|
+ deliveryType(scope.row.send_type)
|
|
|
+ }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column prop="pay_type" label="付款方式">
|
|
|
+ <template slot-scope="scope">{{
|
|
|
+ payType(scope.row.pay_type)
|
|
|
+ }}</template>
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column prop="" label="实付金额">
|
|
|
+ <template slot-scope="scope">{{
|
|
|
+ "¥" + scope.row.pay_price
|
|
|
+ }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column prop="" label="订单状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ typeName(scope.row.status) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ </el-table>
|
|
|
+ <el-pagination
|
|
|
+
|
|
|
+ @size-change="handlePageSizeChange"
|
|
|
+ @current-change="handlePageCurrentChange"
|
|
|
+ :current-page="orderList.page_no"
|
|
|
+ :page-sizes="[10, 20, 50, 100]"
|
|
|
+ :page-size="orderList.page_size"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="orderList.data_total"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="closeOrder">取 消</el-button>
|
|
|
+ <el-button type="primary">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -306,6 +388,7 @@ import * as API_Erp from "@/api/erp";
|
|
|
import * as API_Auth from "@/api/auth";
|
|
|
import * as API_order from "@/api/order";
|
|
|
import * as API_Goods from "@/api/goods";
|
|
|
+import * as API_CollectingAccount from "@/api/collectingAccount";
|
|
|
export default {
|
|
|
name: "goodsExchangeAdd",
|
|
|
data() {
|
|
@@ -321,8 +404,13 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
return {
|
|
|
+ //分页
|
|
|
+ params: {
|
|
|
+ page_no: 1,
|
|
|
+ page_size: 10,
|
|
|
+ },
|
|
|
typeList: [
|
|
|
- /* {
|
|
|
+ /* {
|
|
|
real_name: "采购入库",
|
|
|
id: "采购入库",
|
|
|
},
|
|
@@ -427,6 +515,18 @@ export default {
|
|
|
goodsData: [],
|
|
|
// 暂存已勾选商品
|
|
|
goodsList: [],
|
|
|
+ //订单列表
|
|
|
+ orderVisible: false,
|
|
|
+ deliveryTypeList: [
|
|
|
+ {
|
|
|
+ code: "express",
|
|
|
+ name: "快递配送",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: "self_pick",
|
|
|
+ name: "门店自提",
|
|
|
+ },
|
|
|
+ ],
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -481,29 +581,122 @@ export default {
|
|
|
...mapGetters(["user"]),
|
|
|
},
|
|
|
methods: {
|
|
|
- /* 入库类型回显 */
|
|
|
+ orderBtn() {
|
|
|
+ API_order.getOrderList(this.params).then((res) => {
|
|
|
+ this.orderList = res;
|
|
|
+ this.orderVisible = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ closeOrder(){
|
|
|
+ this.orderVisible = false;
|
|
|
+ },
|
|
|
+ /** 分页大小发生改变 */
|
|
|
+ handlePageSizeChange(size) {
|
|
|
+ this.params.page_size = size;
|
|
|
+ API_order.getOrderList(this.params).then((res) => {
|
|
|
+ this.orderList = res;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 分页页数发生改变 */
|
|
|
+ handlePageCurrentChange(page) {
|
|
|
+ this.params.page_no = page;
|
|
|
+ API_order.getOrderList(this.params).then((res) => {
|
|
|
+ this.orderList = res;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /* 订单客户信息 */
|
|
|
+ memberType(val) {
|
|
|
+ let name = "";
|
|
|
+ API_BasicSetting.customer(this.params).then((response) => {
|
|
|
+ response.data.map((el) => {
|
|
|
+ if (el.id == val) {
|
|
|
+ return (name = el.name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return name;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //获取仓库名称
|
|
|
+ warehouseName(val) {
|
|
|
+ let name = "";
|
|
|
+ this.warehouseList.map((el) => {
|
|
|
+ if (el.id == val) {
|
|
|
+ return (name = el.name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return name;
|
|
|
+ },
|
|
|
+ //配送方式名称
|
|
|
+ deliveryType(val) {
|
|
|
+ let name = "";
|
|
|
+ this.deliveryTypeList.map((el) => {
|
|
|
+ if (el.code == val) {
|
|
|
+ return (name = el.name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return name;
|
|
|
+ },
|
|
|
+ //获取付款方式
|
|
|
+ payType(val) {
|
|
|
+ let name = "";
|
|
|
+ API_CollectingAccount.getList({
|
|
|
+ page_no: 1,
|
|
|
+ page_size: -1,
|
|
|
+ enable_flag: true,
|
|
|
+ }).then((response) => {
|
|
|
+ response.data.map((el) => {
|
|
|
+ if (el.id == val) {
|
|
|
+ return (name = el.name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return name;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //获取订单状态大小写转换.toUpperCase()
|
|
|
+ typeName(val) {
|
|
|
+ let name = "";
|
|
|
+ this.$nextTick(() => {
|
|
|
+ API_Setting.getPage({ dictType: "order_status" }).then((res) => {
|
|
|
+ res.data.map((el) => {
|
|
|
+ if (el.value == val) {
|
|
|
+ name = el.label;
|
|
|
+ console.log(name);
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
+ });
|
|
|
+ },
|
|
|
// 根据条码 序列号查询商品
|
|
|
- blurCode(){
|
|
|
- if(this.scanGoodsForm.bar_code!==undefined || this.scanGoodsForm.sn_code!==undefined){
|
|
|
+ blurCode() {
|
|
|
+ if (
|
|
|
+ this.scanGoodsForm.bar_code !== undefined ||
|
|
|
+ this.scanGoodsForm.sn_code !== undefined
|
|
|
+ ) {
|
|
|
// 通过列表查询商品详细信息
|
|
|
- API_Goods.getGoodsList({barcode:this.scanGoodsForm.bar_code,sncode:this.scanGoodsForm.sn_code}).then(res=>{
|
|
|
+ API_Goods.getGoodsList({
|
|
|
+ barcode: this.scanGoodsForm.bar_code,
|
|
|
+ sncode: this.scanGoodsForm.sn_code,
|
|
|
+ }).then((res) => {
|
|
|
console.log(res);
|
|
|
- this.goodsExchangeAddForm.contract_product_list=res.data
|
|
|
- this.scanDialogVisible=false
|
|
|
- })
|
|
|
+ this.goodsExchangeAddForm.contract_product_list = res.data;
|
|
|
+ this.scanDialogVisible = false;
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
// 查询订单编号
|
|
|
- blurUsername(){
|
|
|
- if(this.goodsExchangeAddForm.sn!==undefined){
|
|
|
- API_order.getOrderList({sn:this.goodsExchangeAddForm.order_id}).then(res=>{
|
|
|
- console.log(res.data);
|
|
|
- if(res.data.length!==0) return
|
|
|
- this.goodsExchangeAddForm.order_id= Number(res.data[0].id)
|
|
|
- this.goodsExchangeAddForm.contract_product_list=res.data
|
|
|
- })
|
|
|
- }/* else{
|
|
|
+ blurUsername() {
|
|
|
+ if (this.goodsExchangeAddForm.sn !== undefined) {
|
|
|
+ API_order.getOrderList({ sn: this.goodsExchangeAddForm.order_id }).then(
|
|
|
+ (res) => {
|
|
|
+ console.log(res.data);
|
|
|
+ if (res.data.length !== 0) return;
|
|
|
+ this.goodsExchangeAddForm.order_id = Number(res.data[0].id);
|
|
|
+ this.goodsExchangeAddForm.contract_product_list = res.data;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ } /* else{
|
|
|
this.$message.error("请填写订单编号")
|
|
|
} */
|
|
|
},
|
|
@@ -539,10 +732,9 @@ export default {
|
|
|
console.log(res);
|
|
|
|
|
|
}) */
|
|
|
- this.goodsExchangeAddForm.product_list = this.goodsList;
|
|
|
- console.log(this.goodsExchangeAddForm.product_list);
|
|
|
- this.goodsVisible = false;
|
|
|
-
|
|
|
+ this.goodsExchangeAddForm.product_list = this.goodsList;
|
|
|
+ console.log(this.goodsExchangeAddForm.product_list);
|
|
|
+ this.goodsVisible = false;
|
|
|
} else {
|
|
|
this.$message.error("请选择商品信息");
|
|
|
}
|
|
@@ -658,20 +850,22 @@ export default {
|
|
|
API_BasicSetting.getWarehouseListAll().then((response) => {
|
|
|
this.warehouseList = response;
|
|
|
});
|
|
|
- API_Setting.getPage({dictType:"warehouse_entry_type"}).then(res=>{
|
|
|
- this.typeList=res.data
|
|
|
- })
|
|
|
+ API_Setting.getPage({ dictType: "warehouse_entry_type" }).then((res) => {
|
|
|
+ this.typeList = res.data;
|
|
|
+ });
|
|
|
},
|
|
|
//保存
|
|
|
- savegoodsExchangeAddForm(){
|
|
|
+ savegoodsExchangeAddForm() {
|
|
|
this.$refs["goodsExchangeAddForm"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
const { id } = this.goodsExchangeAddForm;
|
|
|
const params = this.MixinClone(this.goodsExchangeAddForm);
|
|
|
params.handled_by = this.deptListAll;
|
|
|
- API_order.getOrderList({sn:this.goodsExchangeAddForm.sn}).then(res=>{
|
|
|
- params.order_id= Number(res.data[0].id)
|
|
|
- })
|
|
|
+ API_order.getOrderList({ sn: this.goodsExchangeAddForm.sn }).then(
|
|
|
+ (res) => {
|
|
|
+ params.order_id = Number(res.data[0].id);
|
|
|
+ }
|
|
|
+ );
|
|
|
params.staff_name = this.goodsExchangeAddForm.distribution_name;
|
|
|
if (params.warehouse_id) {
|
|
|
params.warehouse_name = this.warehouseList.find(
|
|
@@ -685,22 +879,27 @@ export default {
|
|
|
}
|
|
|
params.change_time = Math.floor(params.change_time / 1000);
|
|
|
//类型
|
|
|
- params.save_or_submit="save"
|
|
|
+ params.save_or_submit = "save";
|
|
|
if (!params.product_list.length) {
|
|
|
this.$message.error("请选择商品!");
|
|
|
return;
|
|
|
}
|
|
|
if (this.$route.name === "editInventory") {
|
|
|
- API_GoodsExchange.editWarehouseEntry(id,params).then((response) => {
|
|
|
- this.$message.success("修改成功!");
|
|
|
- const { callback } = this.$route.params;
|
|
|
- if (typeof callback === "function") callback();
|
|
|
- this.$store.dispatch("delCurrentViews", {
|
|
|
- view: this.$route,
|
|
|
- $router: this.$router,
|
|
|
- });
|
|
|
- this.$router.push({ name: "goodsExchange",params: { type: "second" }, });
|
|
|
- });
|
|
|
+ API_GoodsExchange.editWarehouseEntry(id, params).then(
|
|
|
+ (response) => {
|
|
|
+ this.$message.success("修改成功!");
|
|
|
+ const { callback } = this.$route.params;
|
|
|
+ if (typeof callback === "function") callback();
|
|
|
+ this.$store.dispatch("delCurrentViews", {
|
|
|
+ view: this.$route,
|
|
|
+ $router: this.$router,
|
|
|
+ });
|
|
|
+ this.$router.push({
|
|
|
+ name: "goodsExchange",
|
|
|
+ params: { type: "second" },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
} else if (this.$route.name === "addInventory") {
|
|
|
// 新增入库
|
|
|
API_GoodsExchange.warehouseEntry(params).then(() => {
|
|
@@ -711,7 +910,10 @@ export default {
|
|
|
view: this.$route,
|
|
|
$router: this.$router,
|
|
|
});
|
|
|
- this.$router.push({ name: "goodsExchange",params: { type: "second" }, });
|
|
|
+ this.$router.push({
|
|
|
+ name: "goodsExchange",
|
|
|
+ params: { type: "second" },
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -724,10 +926,12 @@ export default {
|
|
|
const { id } = this.goodsExchangeAddForm;
|
|
|
const params = this.MixinClone(this.goodsExchangeAddForm);
|
|
|
params.handled_by = this.deptListAll;
|
|
|
- API_order.getOrderList({sn:this.goodsExchangeAddForm.sn}).then(res=>{
|
|
|
+ API_order.getOrderList({ sn: this.goodsExchangeAddForm.sn }).then(
|
|
|
+ (res) => {
|
|
|
console.log(res.data);
|
|
|
- params.order_id= Number(res.data[0].id)
|
|
|
- })
|
|
|
+ params.order_id = Number(res.data[0].id);
|
|
|
+ }
|
|
|
+ );
|
|
|
params.staff_name = this.goodsExchangeAddForm.distribution_name;
|
|
|
if (params.warehouse_id) {
|
|
|
params.warehouse_name = this.warehouseList.find(
|
|
@@ -740,13 +944,13 @@ export default {
|
|
|
).real_name;
|
|
|
}
|
|
|
params.change_time = Math.floor(params.change_time / 1000);
|
|
|
- params.save_or_submit="submit"
|
|
|
+ params.save_or_submit = "submit";
|
|
|
if (!params.product_list.length) {
|
|
|
this.$message.error("请选择商品!");
|
|
|
return;
|
|
|
}
|
|
|
- /* */ if (this.$route.name === "editInventory") {
|
|
|
- /* params.contract_product_list.map(el=>{
|
|
|
+ /* */ if (this.$route.name === "editInventory") {
|
|
|
+ /* params.contract_product_list.map(el=>{
|
|
|
el.product_id=el.id
|
|
|
el.goods_id=el.id
|
|
|
})
|
|
@@ -754,16 +958,21 @@ export default {
|
|
|
el.product_id=el.id
|
|
|
el.goods_id=el.id
|
|
|
}) */
|
|
|
- API_GoodsExchange.editWarehouseEntry(id,params).then((response) => {
|
|
|
- this.$message.success("修改成功!");
|
|
|
- const { callback } = this.$route.params;
|
|
|
- if (typeof callback === "function") callback();
|
|
|
- this.$store.dispatch("delCurrentViews", {
|
|
|
- view: this.$route,
|
|
|
- $router: this.$router,
|
|
|
- });
|
|
|
- this.$router.push({ name: "goodsExchange",params: { type: "second" }, });
|
|
|
- });
|
|
|
+ API_GoodsExchange.editWarehouseEntry(id, params).then(
|
|
|
+ (response) => {
|
|
|
+ this.$message.success("修改成功!");
|
|
|
+ const { callback } = this.$route.params;
|
|
|
+ if (typeof callback === "function") callback();
|
|
|
+ this.$store.dispatch("delCurrentViews", {
|
|
|
+ view: this.$route,
|
|
|
+ $router: this.$router,
|
|
|
+ });
|
|
|
+ this.$router.push({
|
|
|
+ name: "goodsExchange",
|
|
|
+ params: { type: "second" },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
} else if (this.$route.name === "addInventory") {
|
|
|
// 新增入库
|
|
|
API_GoodsExchange.warehouseEntry(params).then(() => {
|
|
@@ -774,7 +983,10 @@ export default {
|
|
|
view: this.$route,
|
|
|
$router: this.$router,
|
|
|
});
|
|
|
- this.$router.push({ name: "goodsExchange",params: { type: "second" }, });
|
|
|
+ this.$router.push({
|
|
|
+ name: "goodsExchange",
|
|
|
+ params: { type: "second" },
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -817,24 +1029,24 @@ export default {
|
|
|
// 选择出库单
|
|
|
async handleSelectWarehouseEntryBatch() {
|
|
|
if (!this.goodsExchangeAddForm.warehouse_id) {
|
|
|
- this.$message.error('请先选择仓库!')
|
|
|
- return
|
|
|
+ this.$message.error("请先选择仓库!");
|
|
|
+ return;
|
|
|
}
|
|
|
- API_GoodsExchange.getGoodsInfo().then((res) => {
|
|
|
- let item={}
|
|
|
- res.map(el=>{
|
|
|
- item.sn=el.goods_vo.sn
|
|
|
- item.name=el.goods_vo.name
|
|
|
+ API_GoodsExchange.getGoodsInfo(this.params).then((res) => {
|
|
|
+ let item = {};
|
|
|
+ res.map((el) => {
|
|
|
+ item.sn = el.goods_vo.sn;
|
|
|
+ item.name = el.goods_vo.name;
|
|
|
/* item. */
|
|
|
- return item
|
|
|
- })
|
|
|
+ return item;
|
|
|
+ });
|
|
|
this.goodsData = res;
|
|
|
this.goodsVisible = true;
|
|
|
});
|
|
|
- /*// if (!this.goodsExchangeAddForm.warehouse_id) {
|
|
|
- // this.$message.error('请先选择仓库!')
|
|
|
- // return
|
|
|
- // }
|
|
|
+ /* if (!this.goodsExchangeAddForm.warehouse_id) {
|
|
|
+ this.$message.error('请先选择仓库!')
|
|
|
+ return
|
|
|
+ }
|
|
|
const goodsData = await this.$EnwarehouseEntryBatch({
|
|
|
goodsApi: "/admin/erp/goods",
|
|
|
warehouseList: this.warehouseList,
|
|
@@ -850,7 +1062,6 @@ export default {
|
|
|
this.goodsExchangeAddForm.warehouse_id = goodsData.warehouse_id;
|
|
|
this.goodsExchangeAddForm.product_list = goodsData.purchasePlans.map(
|
|
|
(item) => {
|
|
|
- //
|
|
|
item.amount = item.entry_price;
|
|
|
item.product_sn = item.product_sn;
|
|
|
item.product_name = item.product_name;
|
|
@@ -927,7 +1138,7 @@ export default {
|
|
|
);
|
|
|
this.goodsExchangeAddForm.distribution_name = response.staff_name;
|
|
|
this.goodsExchangeAddForm.product_list =
|
|
|
- response.product_list/* .map((item) => {
|
|
|
+ response.product_list; /* .map((item) => {
|
|
|
//change_list
|
|
|
item.name=item.goods_do.name
|
|
|
item.sn=item.goods_do.sn
|
|
@@ -939,7 +1150,7 @@ export default {
|
|
|
item.warehouse_entry_sn = item.stock_sn;
|
|
|
return item;
|
|
|
}); */
|
|
|
- /* this.goodsExchangeAddForm.return_list = response.return_list.map(
|
|
|
+ /* this.goodsExchangeAddForm.return_list = response.return_list.map(
|
|
|
(item) => {
|
|
|
item.product_price = item.amount;
|
|
|
item.product_specification = item.specification;
|