| | |
| | | <div class="top"> |
| | | <SearchCommonView |
| | | :add-title="'新建'" |
| | | :placeholder="'请输入单号'" |
| | | :placeholder="'请输入单号/来源单据'" |
| | | :amount-view="false" |
| | | @addCommonClick="addBtnClick" |
| | | @searchClick="getList" |
| | |
| | | </div> |
| | | </div> |
| | | <!-- 新建/编辑 --> |
| | | <AddOverviewDialog v-if="editConfig.visible" :edit-common-config="editConfig" /> |
| | | <AddOverviewDialog |
| | | v-if="editConfig.visible" |
| | | :work-type="workType" |
| | | :edit-common-config="editConfig" |
| | | :add-name="this.$route.params.name" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getProductList } from "@/api/product/product" |
| | | import { getOperation } from "@/api/overview/overview" |
| | | // import DetailProduct from "@/views/productManage/product/DetailProduct" |
| | | import AddOverviewDialog from "@/views/overview/AddOverviewDialog" |
| | | |
| | |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: {} |
| | | } |
| | | }, |
| | | workType: this.$route.params.workType, |
| | | keyword: "", |
| | | params: {} |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | var paramsData = sessionStorage.getItem("paramsData") |
| | | let params = {} |
| | | if (paramsData) { |
| | | params = JSON.parse(sessionStorage.getItem("paramsData")) |
| | | } else { |
| | | params = this.$route.params |
| | | sessionStorage.setItem("paramsData", JSON.stringify(params)) |
| | | } |
| | | this.params = params |
| | | this.getData() |
| | | // console.log(this.$route.params.workType) |
| | | }, |
| | | // 页面销毁之前 |
| | | beforeDestroy() { |
| | | sessionStorage.removeItem("paramsData") |
| | | }, |
| | | methods: { |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | selectBox: true, |
| | | selectBox: false, |
| | | selectIndex: true, |
| | | showcol: this.showcol, |
| | | allcol: [], |
| | | tableColumn: this.setTableColumn(this.showcol) |
| | |
| | | let tableColumn = [ |
| | | { |
| | | label: "单号", |
| | | prop: "id", |
| | | prop: "number", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "从", |
| | | prop: "deviceName", |
| | | prop: "from", |
| | | isShowColumn: showcol.includes("从"), |
| | | default: false |
| | | }, |
| | | { |
| | | label: "至", |
| | | prop: "id", |
| | | prop: "to", |
| | | isShowColumn: showcol.includes("至"), |
| | | default: false |
| | | }, |
| | | { |
| | | label: "联系人", |
| | | prop: "deviceId", |
| | | prop: "companyName", |
| | | isShowColumn: showcol.includes("联系人"), |
| | | default: false |
| | | }, |
| | | { |
| | | label: "负责人", |
| | | prop: "shopName", |
| | | prop: "contacterName", |
| | | isShowColumn: showcol.includes("负责人"), |
| | | default: false |
| | | }, |
| | | { |
| | | label: "日期", |
| | | prop: "preTime", |
| | | prop: "operationDate", |
| | | isShowColumn: showcol.includes("日期"), |
| | | default: false, |
| | | date: true |
| | | }, |
| | | { |
| | | label: "产品可用性", |
| | | prop: "status", |
| | | isShowColumn: showcol.includes("产品可用性"), |
| | | default: false |
| | | }, |
| | | { |
| | | label: "截止日期", |
| | | prop: "faultTime", |
| | | isShowColumn: showcol.includes("截止日期"), |
| | | default: false |
| | | }, |
| | | { |
| | | label: "实际日期", |
| | | prop: "shopName", |
| | | isShowColumn: showcol.includes("实际日期"), |
| | | default: false |
| | | }, |
| | | // { |
| | | // label: "产品可用性", |
| | | // prop: "status", |
| | | // isShowColumn: showcol.includes("产品可用性"), |
| | | // default: false |
| | | // }, |
| | | // { |
| | | // label: "截止日期", |
| | | // prop: "faultTime", |
| | | // isShowColumn: showcol.includes("截止日期"), |
| | | // default: false |
| | | // }, |
| | | // { |
| | | // label: "实际日期", |
| | | // prop: "shopName", |
| | | // isShowColumn: showcol.includes("实际日期"), |
| | | // default: false |
| | | // }, |
| | | { |
| | | label: "来源单据", |
| | | prop: "faultLevel", |
| | | prop: "sourceNumber", |
| | | isShowColumn: showcol.includes("来源单据"), |
| | | default: false |
| | | }, |
| | | { |
| | | label: "欠单", |
| | | prop: "status", |
| | | isShowColumn: showcol.includes("欠单"), |
| | | default: false |
| | | }, |
| | | // { |
| | | // label: "欠单", |
| | | // prop: "status", |
| | | // isShowColumn: showcol.includes("欠单"), |
| | | // default: false |
| | | // }, |
| | | { |
| | | label: "入库类型", |
| | | prop: "faultTime", |
| | | prop: "operationTypeName", |
| | | isShowColumn: showcol.includes("入库类型"), |
| | | default: false |
| | | }, |
| | |
| | | width: 120, |
| | | isShowColumn: showcol.includes("状态"), |
| | | default: false, |
| | | status: true |
| | | 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 getOperation({ |
| | | number: this.keyword, |
| | | operationTypeId: this.params.id, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | if (res.data.code === 200) { |
| | | const list = res.data.data.list.map((item) => { |
| | | console.log(res.data) |
| | | 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) { |
| | | console.log(val) |
| | | this.keyword = val |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row) { |
| | | console.log(row) |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.operationTypeId = this.$route.params.id |
| | | this.editConfig.infomation = { ...row } |
| | | }, |
| | | // 新建 |
| | | addBtnClick() { |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "新建" |
| | | this.editConfig.operationTypeId = this.$route.params.id |
| | | this.editConfig.infomation = {} |
| | | }, |
| | | // 状态 |
| | | getStatus(val) { |
| | | return val === 1 ? "草稿" : val === 3 ? "就绪" : "完成" |
| | | } |
| | | } |
| | | } |