Commit 16c2a58d by LJM

寄售召回

parent ac2d99bf
*SKUID,*ٻ
*SKUID,*ٻ
......@@ -36,8 +36,8 @@ const ConsignmentApplication = resolve => require(['@/views/consignmentManagemen
const ConsignmentApplicationDetail = resolve => require(['@/views/consignmentManagement/consignmentApplicationDetail.vue'], resolve);
const ConsignmentReplenishment = resolve => require(['@/views/consignmentManagement/consignmentReplenishment.vue'], resolve);
const ConsignmentRecall = resolve => require(['@/views/consignmentManagement/consignmentRecall.vue'], resolve);
const BatchRecall = resolve => require(['@/views/consignmentManagement/batchRecall.vue'], resolve);
const ConsignmentRecallDetail = resolve => require(['@/views/consignmentManagement/consignmentRecallDetail.vue'], resolve);
const BatchRecall = resolve => require(['@/views/consignmentManagement/batchRecall.vue'], resolve);
const ConsignmentContract = resolve => require(['@/views/consignmentManagement/consignmentContract.vue'], resolve);
const InOutStockLog = resolve => require(['@/views/consignmentManagement/inOutStockLog.vue'], resolve);
......@@ -75,6 +75,7 @@ const routes = [
{path: '/consignmentApplicationDetail', name: 'consignmentApplicationDetail', meta: {title: '寄售申请单详情'}, component: ConsignmentApplicationDetail},
{path: '/consignmentReplenishment', name: 'consignmentReplenishment', meta: {title: '寄售补货'}, component: ConsignmentReplenishment},
{path: '/consignmentRecall', name: 'consignmentRecall', meta: {title: '寄售召回'}, component: ConsignmentRecall},
{path: '/consignmentRecallDetail', name: 'consignmentRecallDetail', meta: {title: '寄售召回单详情'}, component: ConsignmentRecallDetail},
{path: '/batchRecall', name: 'batchRecall', meta: {title: '批量召回'}, component: BatchRecall},
{path: '/consignmentRecallDetail', name: 'consignmentRecallDetail', meta: {title: '寄售召回单详情'}, component: ConsignmentRecallDetail},
{path: '/consignmentContract', name: 'consignmentContract', meta: {title: '寄售合同'}, component: ConsignmentContract},
......
......@@ -44,7 +44,7 @@ export default {
*
* @param arr
*/
isPurchasesValid : function (arr) {
isPurchasesValid: function (arr) {
return arr.every((item, index, array) =>
index === 0 ? true : item.purchases > array[index - 1].purchases
);
......
......@@ -4,133 +4,141 @@
<!--操作区-->
<div class="operation-area row verCenter bothSide">
<div class="operation-button row verCenter">
<el-button type="primary" @click="$router.push('/batchRecall')">上传文件</el-button>
<el-upload action="/api/consignmentRecall/batchRecallUpload" :on-success="handleUploadSuccess" :on-error="handleUploadError" accept=".csv" :show-file-list="false">
<el-button size="small" type="primary">上传文件</el-button>
</el-upload>
<a href="/批量召回.csv" download style="text-decoration: none;margin-left: 10px;">
<el-button type="primary">下载模板</el-button>
</a>
</div>
<div class="text-tip row verCenter">
<i class="el-icon-warning"></i>
<span>上传需召回的商品后,点击【提交】可将状态为"成功"的全部数据生成寄售召回单</span>
</div>
</div>
<!--列表区-->
<div class="data-box">
<el-table :data="list" border max-height="600" @selection-change="handleSelectionChange">
<el-table :data="list" border max-height="600">
<el-table-column type="index" label="序号" width="50" align="center" fixed></el-table-column>
<el-table-column prop="msg_type" label="文件名字" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="msg_type" label="状态" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="msg_type" label="导入方式" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="id" label="导入成功" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="id" label="导入失败" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="create_time" label="上传时间" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="sku_id" label="SKUID" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="goods_name" label="型号" width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="brand_name" label="品牌" width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="useable_num" label="可用库存数量" width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="recall_num" label="申请召回数量" width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="status" label="状态" width="160" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope">
<span :style="{ color: scope.row.status === 0 ? '#F56C6C' : '' }">{{ scope.row.status_val }}</span>
</template>
</el-table-column>
<el-table-column prop="remark" label="说明" width="250" :show-overflow-tooltip="true" align="center"></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>
</div>
<div v-if="is_flag" style="margin-top: 20px;">
<el-button size="small" type="primary" @click="batchRecallSubmit">提交</el-button>
<el-button size="small" type="primary" @click="batchRecallExportFailed">导出失败数据</el-button>
<el-button size="small" @click="$router.push({path: '/consignmentRecall'})">取 消</el-button>
</div>
</div>
<Menu></Menu>
<Menu ref="menu"></Menu>
</div>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui'
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip, Upload} from 'element-ui'
Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(Button).use(Link).use(Form).use(Upload).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "consignmentRecall",
name: "batchRecall",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
status: '',
date: ''
}
recall_upload_sn: '',//上传编号
is_flag: true
};
},
created() {
this.getData()
},
methods: {
getData() {
var params = Object.assign({}, this.formParam,
{page: this.page, limit: this.limit},
{start_time: this.formParam.date ? this.formParam.date[0] : ''},
{end_time: this.formParam.date ? this.formParam.date[1] : ''}
);
this.$http('GET', "/api/message/getMsgList", params).then(res => {
/**
* 上传成功
* @param res
* @param file
* @param fileList
*/
handleUploadSuccess(res, file, fileList) {
if (res.code === 0) {
this.$message.success('上传成功');
if (res.data.list.length > 0) {
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]);
return;
}
this.$http('GET', "/api/search/getspu", {spu_name: queryString}).then(res => {
if (res.code == 0 && res.data.list?.length) {
const arr = res.data.list.map(item => ({
value: item.spu_name
}));
cb(arr);
} else {
cb([]);
this.$message.error(res.msg || '上传失败');
}
}).catch(() => {
cb([]);
});
},
/**
* 搜索
* 上传失败
* @param err
* @param file
* @param fileList
*/
onSubmit() {
this.page = 1;
this.getData();
handleUploadError(err, file, fileList) {
this.$message.error('上传失败,请重试');
},
/**
* 重置表单
* @param formName
* 批量召回-提交
*/
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
batchRecallSubmit() {
this.recall_upload_sn = this.list.filter(item => item.status === 1).map(item => item.recall_upload_sn);
this.$http('POST', "/api/consignmentRecall/batchRecallSubmit", {recall_upload_sn: this.recall_upload_sn}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.$refs.menu.closetab(this.$route.path);
setTimeout(() => {
if (this.$route.path !== '/consignmentRecall') {
this.$router.push({path: '/consignmentRecall'}).catch(err => {
if (err.name !== 'NavigationDuplicated') {
throw err;
}
});
}
}, 0);
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
},
/**
* chebox 选择监听
* @param val
* 批量召回-导出失败数据
*/
handleSelectionChange(val) {
this.multipleSelection = val;
batchRecallExportFailed() {
this.recall_upload_sn = this.list.filter(item => item.status === 0).map(item => item.recall_upload_sn);
this.$http('POST', "/api/consignmentRecall/batchRecallExportFailed", {recall_upload_sn: this.recall_upload_sn}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
}
},
components: {
......
......@@ -39,7 +39,7 @@
<el-table-column type="selection" width="40" align="center" fixed></el-table-column>
<el-table-column prop="msg_sn" label="寄售召回单号" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope">
<el-link type="primary" :underline="false" @click="$router.push({path: '/consignmentApplicationDetail', query: {consignment_id: scope.row.consignment_id}})" style="font-size: 12px;">{{ scope.row.recall_sn }}</el-link>
<el-link type="primary" :underline="false" @click="$router.push({path: '/consignmentRecallDetail', query: {recall_id: scope.row.recall_id}})" style="font-size: 12px;">{{ scope.row.recall_sn }}</el-link>
</template>
</el-table-column>
<el-table-column prop="recall_status_val" label="订单状态" :show-overflow-tooltip="true" align="center"></el-table-column>
......
<template>
<div class="pagex">
<div class="section-page">
<!--搜索区-->
<el-form :inline="true" :model="formParam" ref="formParam" label-width="96px">
<el-form-item label="寄售召回单号" prop="sku_id">
<el-input v-model="formParam.sku_id" placeholder="请输入寄售召回单号" @keyup.enter.native="submit" clearable></el-input>
</el-form-item>
<el-form-item label="型号" prop="goods_name">
<el-autocomplete v-model="formParam.goods_name" :trigger-on-focus="false" @keyup.enter.native="onSubmit" :fetch-suggestions="querySearchAsync" placeholder="请输入型号" clearable></el-autocomplete>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="formParam.status" placeholder="全部" clearable>
<el-option label="全部" value=""></el-option>
<el-option label="待提审" value="1"></el-option>
<el-option label="待审核" value="2"></el-option>
<el-option label="待退货出库" value="3"></el-option>
<el-option label="完成" value="4"></el-option>
<el-option label="作废" value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">搜索</el-button>
<el-button @click="resetForm('formParam')">重置</el-button>
</el-form-item>
</el-form>
<!--操作区-->
<div class="operation-area row verCenter bothSide">
<div class="operation-button row verCenter">
<el-button type="primary">批量召回</el-button>
<el-button type="primary">提交审核</el-button>
<el-button type="primary">作废</el-button>
<el-button type="danger">收货信息</el-button>
</div>
</div>
<el-row v-if="detailData.recall_id" style="margin-bottom: 15px;">
<el-col :span="4">
<div style="font-weight: bold">{{ detailData.recall_sn }}{{ detailData.recall_status_val }}</div>
</el-col>
<el-col :span="4">
<div>订单人员:{{ detailData.order_uname }}</div>
</el-col>
<el-col :span="4">
<div>收货人:{{ detailData.supplier_address.contact }}</div>
</el-col>
<el-col :span="4">
<div>收货人电话:{{ detailData.supplier_address.mobile }}</div>
</el-col>
<el-col :span="10" style="margin-top: 5px">
<div>收货地址:{{ detailData.supplier_address.province }}{{ detailData.supplier_address.city }}{{ detailData.supplier_address.district }}{{ detailData.supplier_address.detail }}</div>
</el-col>
</el-row>
<!--列表区-->
<div class="data-box">
<el-table :data="list" border max-height="600" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="40" align="center" fixed></el-table-column>
<el-table-column prop="msg_sn" label="单号" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope">
<el-link type="primary" @click="$router.push('/consignmentImportDetail')">{{ scope.row.id }}</el-link>
</template>
</el-table-column>
<el-table-column prop="msg_type" label="文件名字" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="msg_type" label="状态" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="msg_type" label="导入方式" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="id" label="导入成功" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="id" label="导入失败" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="create_time" label="上传时间" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column type="index" label="序号" width="50" align="center" fixed></el-table-column>
<el-table-column prop="recall_item_id" label="明细ID" width="100" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="sku_id" label="SKUID" width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="goods_name" label="型号" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="brand_name" label="品牌" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="recall_num" label="申请召回数量" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="stock_out_num" label="退货出库总数" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="date_code" label="批次" width="160" :show-overflow-tooltip="true" align="center"></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>
</div>
......@@ -58,17 +39,19 @@
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui'
import {Autocomplete, Button, Col, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Row, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui'
Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider).use(Row).use(Col);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "consignmentRecall",
name: "consignmentRecallDetail",
data() {
return {
multipleSelection: [],
recall_id: '',
detailData: {},
total: 0,
page: 1,
limit: 10,
......@@ -80,24 +63,18 @@ export default {
};
},
created() {
this.recall_id = this.$route.query.recall_id;
this.getData()
},
methods: {
getData() {
var params = Object.assign({}, this.formParam,
{page: this.page, limit: this.limit},
{start_time: this.formParam.date ? this.formParam.date[0] : ''},
{end_time: this.formParam.date ? this.formParam.date[1] : ''}
);
this.$http('GET', "/api/message/getMsgList", params).then(res => {
this.$http('GET', "/api/consignmentRecall/getConsignmentRecallDetail", {recall_id: this.recall_id, page: this.page, limit: this.limit}).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
this.detailData = res.data;
this.list = res.data.items.list;
this.total = res.data.items.total || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
this.$message.error(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