| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- <template>
- <div class="app-container calendar-list-container">
- <!-- 查询和其他操作 -->
- <div class="filter-container">
- <el-date-picker v-model="listQuery.startDate" value-format="yyyy-MM-dd" type="date" placeholder="开始日期"
- class="filter-item" style="width:200px">
- </el-date-picker>
- <el-date-picker v-model="listQuery.endDate" value-format="yyyy-MM-dd" type="date" placeholder="结束日期"
- class="filter-item" style="width:200px">
- </el-date-picker>
- <el-select v-model="listQuery.warehouseId" clearable placeholder="仓库" class="filter-item" style="width: 200px">
- <el-option :key="item.id" v-for="item in warehouseList" :label="item.warehouseName" :value="item.id">
- </el-option>
- </el-select>
- <el-select v-model="listQuery.addHandlerId" clearable filterable placeholder="经手人" class="filter-item" style="width: 200px">
- <el-option :key="item.loginId" v-for="item in userSelsctList" :label="item.deptName+'_'+item.userName" :value="item.loginId">
- </el-option>
- </el-select>
- <el-select v-model="listQuery.isRunFinish" clearable placeholder="组装状态" class="filter-item" style="width: 200px">
- <el-option :key="item.type" v-for="item in typeList" :label="item.name" :value="item.type">
- </el-option>
- </el-select>
- <el-input v-model="listQuery.assembleProductName" clearable placeholder="组装商品名称" class="filter-item" style="width: 200px;" >
- </el-input>
- <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
- <el-button class="filter-item" v-waves icon="el-icon-refresh" @click="resetQuery">重置</el-button>
- <el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-plus">添加</el-button>
- <el-button class="filter-item" v-waves icon="el-icon-download"
- @click="handleDownload">导出</el-button>
- <!-- <el-button class="filter-item" type="success" icon="el-icon-takeaway-box" @click="executeAll">批量组装</el-button> -->
- <el-button class="filter-item" type="warning" icon="el-icon-delete" @click="delAll">批量删除</el-button>
- </div>
- <!-- 查询结果 -->
- <el-table size="small" :data="list" @selection-change="handleSelectionChange" v-loading="listLoading"
- element-loading-text="正在查询中。。。" border fit highlight-current-row>
- <el-table-column type="selection" width="55px" align="center"> </el-table-column>
- <el-table-column type="index" label="序号" header-align="center" align="center">
- </el-table-column>
- <el-table-column align="center" min-width="150px" label="包装/组装单号">
- <template slot-scope="scope">
- <router-link :to="{ name: 'assemblyDetail', params: { id: scope.row.id } }">
- <div style="color: #337ab7;cursor: pointer;">{{ scope.row.serialCode }}</div>
- </router-link>
- </template>
- </el-table-column>
- <el-table-column align="center" min-width="100px" label="组装时间" prop="serialDate">
- </el-table-column>
- <el-table-column align="center" min-width="100px" label="仓库" prop="warehouseName">
- </el-table-column>
- <el-table-column align="center" min-width="100px" label="经手人" prop="addHandlerName">
- </el-table-column>
- <el-table-column align="center" min-width="200px" label="组装商品名称" prop="assembleProductName">
- </el-table-column>
- <el-table-column align="center" min-width="200px" label="组装原因" prop="remarks">
- </el-table-column>
- <el-table-column align="center" min-width="100px" label="组装状态">
- <template slot-scope="props">
- <span v-if="props.row.isRunFinish == '0'" style="color: #67C23A;font-weight: bold;">已组装</span>
- <span v-if="props.row.isRunFinish == '1'" style="color: #E6A23C;font-weight: bold;">待组装</span>
- </template>
- </el-table-column>
- <el-table-column align="center" label="操作" width="240px" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button v-if="scope.row.isRunFinish == '1'" type="success" size="small" @click="handleExecute(scope.row)">组装</el-button>
- <el-button v-if="scope.row.isRunFinish == '1'" type="primary" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
- <el-button v-if="scope.row.isRunFinish == '1'" type="danger" size="small" @click="handleDelete(scope.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- 分页 -->
- <div class="pagination-container">
- <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
- :current-page="listQuery.page" :page-sizes="[10, 20, 30, 50]" :page-size="listQuery.limit"
- layout="total, sizes, prev, pager, next, jumper" :total="total">
- </el-pagination>
- </div>
- </div>
- </template>
- <script>
- import { listAssembly, deleteAssembly, executeAssembly } from "@/api/assembly";
- import { warehouseList } from "@/api/warehouse";
- import { allUserList } from "@/api/public";
- import waves from "@/directive/waves"; // 水波纹指令
- export default {
- directives: { waves },
- data() {
- return {
- warehouseList: [],
- userSelsctList:[],
- typeList: [
- {
- type: '0',
- name: "已组装",
- },
- {
- type: '1',
- name: "待组装",
- },
- ],
- list: [
- ],
- delarr: [],
- multipleSelection: [],
- total: 0,
- listLoading: false,
- listQuery: {
- page: 1,
- limit: 10,
- startDate: '',
- endDate: '',
- warehouseId: '',
- addHandlerId: '',
- isRunFinish: '',
- assembleProductName:'',
- },
- }
- },
- created() {
- this.getStoreList();
- this.getAllUserList();
- this.getList();
- },
- methods: {
- /** 获取仓库列表数据 */
- getStoreList() {
- warehouseList().then(response => {
- this.warehouseList = response.data.data;
- }).catch(() => { });
- },
- /** 获取人员列表数据 */
- getAllUserList() {
- allUserList().then(response => {
- this.userSelsctList = response.data.data;
- }).catch(() => { });
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.listQuery = {
- page: 1,
- limit: 10,
- startDate: '',
- endDate: '',
- warehouseId: '',
- addHandlerId: '',
- isRunFinish: '',
- assembleProductName:'',
- },
- this.getList()
- },
- handleDownload() {
- window.location.href = process.env.BASE_API + '/warehouse-assembly/export';
- },
- handleCreate() {
- this.$router.push({
- name: 'assemblyAdd',
- // params: { callback: this.getList }
- })
- },
- getList() {
- this.listLoading = true
- listAssembly(this.listQuery).then(response => {
- this.list = response.data.data.items
- this.total = response.data.data.total
- this.listLoading = false
- }).catch(() => {
- this.list = []
- this.total = 0
- this.listLoading = false
- })
- },
- handleFilter() {
- this.listQuery.page = 1
- this.getList()
- },
- handleSizeChange(val) {
- this.listQuery.limit = val
- this.getList()
- },
- handleCurrentChange(val) {
- this.listQuery.page = val
- this.getList()
- },
- handleUpdate(row) {
- this.$router.push({
- name: 'assemblyEdit',
- params: { id: row.id }
- })
- },
- handleExecute(row) {
- this.$confirm('确认组装吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- executeAssembly({ ids: row.id }).then(response => {
- this.$notify({
- title: '成功',
- message: '组装成功',
- type: 'success',
- duration: 2000
- })
- this.getList()
- })
- }).catch(() => { })
- },
- executeAll() {
- const length = this.multipleSelection.length;
- if (length > 0) {
- this.$confirm("确认组装吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- for (let i = 0; i < length; i++) {
- this.delarr.push(this.multipleSelection[i].id);
- }
- const ids = this.delarr.join(",");
- executeAssembly({ ids: ids }).then(() => {
- this.$notify({
- title: "成功",
- message: "组装成功",
- type: "success",
- duration: 2000,
- });
- this.getList();
- })
- })
- } else {
- this.$notify({
- title: "提示",
- message: "请选择要组装的信息!",
- type: "warning",
- });
- }
- },
- handleDelete(row) {
- this.$confirm('确认删除吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- deleteAssembly({ ids: row.id }).then(response => {
- this.$notify({
- title: '成功',
- message: '删除成功',
- type: 'success',
- duration: 2000
- })
- this.getList()
- })
- }).catch(() => { })
- },
- delAll() {
- const length = this.multipleSelection.length;
- if (length > 0) {
- this.$confirm("确认删除吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- for (let i = 0; i < length; i++) {
- this.delarr.push(this.multipleSelection[i].id);
- }
- const ids = this.delarr.join(",");
- deleteAssembly({ ids: ids }).then(() => {
- this.$notify({
- title: "成功",
- message: "删除成功",
- type: "success",
- duration: 2000,
- });
- this.getList();
- })
- })
- } else {
- this.$notify({
- title: "提示",
- message: "请选择要删除的信息!",
- type: "warning",
- });
- }
- },
- handleSelectionChange(val) {
- this.multipleSelection = val;
- },
- }
- }
- </script>
|