| | |
| | | :table-list="tableList" |
| | | :show-checkcol="false" |
| | | @tableRowClick="tableRowClick" |
| | | ></TableCommonView> |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column fixed="right" label="操作" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="examineClick(scope.row)" type="text" size="small">查看</el-button> |
| | | <el-button type="text" v-if="scope.row.status != 4" size="small" @click="editClick(scope.row)" |
| | | >编辑</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </TableCommonView> |
| | | </div> |
| | | <div class="btn-pager"> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | | </div> |
| | | <!-- 新建/编辑 --> |
| | | <AddScrapDialog v-if="editConfig.visible" :edit-common-config="editConfig" /> |
| | | <AddScrapDialog v-if="editConfig.visible" :editCommonConfig="editConfig" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getProductList } from "@/api/product/product" |
| | | import { getDisuseList } from "@/api/operate/scrap" |
| | | // import DetailProduct from "@/views/productManage/product/DetailProduct" |
| | | import AddScrapDialog from "@/views/operate/scrap/AddScrapDialog" |
| | | |
| | |
| | | editConfig: { |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: {} |
| | | } |
| | | infomation: {}, |
| | | showEdit: false |
| | | }, |
| | | keyword: "" |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | // 查看 |
| | | examineClick(row) { |
| | | this.editConfig.title = "查看" |
| | | this.editConfig.infomation = { ...row } |
| | | this.editConfig.visible = true |
| | | }, |
| | | editClick(row) { |
| | | console.log(row, "编辑") |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.infomation = { ...row } |
| | | this.editConfig.visible = true |
| | | }, |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | selectBox: true, |
| | | selectBox: false, |
| | | selectIndex: true, |
| | | showcol: this.showcol, |
| | | allcol: [], |
| | | tableColumn: this.setTableColumn(this.showcol) |
| | |
| | | console.log(showcol) |
| | | let tableColumn = [ |
| | | { |
| | | label: "单号", |
| | | prop: "id", |
| | | label: "报废单号", |
| | | prop: "number", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "日期", |
| | | prop: "deviceName", |
| | | prop: "operationDate", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "产品", |
| | | prop: "id", |
| | | prop: "productName", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "数量", |
| | | prop: "deviceId", |
| | | prop: "amount", |
| | | isShowColumn: true, |
| | | default: false |
| | | }, |
| | | { |
| | | label: "计量单位", |
| | | prop: "shopName", |
| | | prop: "unit", |
| | | isShowColumn: true, |
| | | default: false |
| | | }, |
| | | { |
| | | label: "源位置", |
| | | prop: "preTime", |
| | | prop: "from", |
| | | isShowColumn: true, |
| | | default: false |
| | | }, |
| | | { |
| | | label: "报废位置", |
| | | prop: "status", |
| | | prop: "to", |
| | | isShowColumn: true, |
| | | default: false |
| | | }, |
| | |
| | | prop: "status", |
| | | width: 120, |
| | | isShowColumn: true, |
| | | default: true, |
| | | status: true |
| | | default: false, |
| | | status: true, |
| | | isCallMethod: true, |
| | | getCallMethod: this.getStatus |
| | | } |
| | | ] |
| | | return tableColumn |
| | |
| | | this.tableList.tableColumn = this.setTableColumn(val) |
| | | }, |
| | | // 请求数据 |
| | | async getData(val, content) { |
| | | await getProductList({ |
| | | [val]: content, |
| | | async getData() { |
| | | await getDisuseList({ |
| | | number: this.keyword, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | if (res.data.code === 200) { |
| | | const list = res.data.data.list.map((item) => { |
| | | if (res.code === 200) { |
| | | const list = res.data.map((item) => { |
| | | return { |
| | | ...item, |
| | | supplierNumber: item.supplier.number, |
| | | status: "草稿", |
| | | preTime: "2023-09-04 11:20:00" |
| | | from: item.fromLocation.name, |
| | | to: item.toLocation.name |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.data.total |
| | | this.pagerOptions.totalCount = res.total |
| | | } |
| | | }) |
| | | }, |
| | | // 搜索 |
| | | getList(val) { |
| | | this.keyword = val |
| | | console.log(val) |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row) { |
| | | console.log(row) |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "编辑" |
| | | // this.editConfig.visible = true; |
| | | // this.editConfig.title = "编辑"; |
| | | this.editConfig.infomation = { ...row } |
| | | }, |
| | | // 新建 |
| | | addBtnClick() { |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "新建" |
| | | this.editConfig.infomation = {} |
| | | }, |
| | | // 状态 |
| | | getStatus(val) { |
| | | return val === 1 ? "草稿" : val === 3 ? "就绪" : "完成" |
| | | } |
| | | } |
| | | } |