| | |
| | | { id: 2, name: "待入库" }, |
| | | { id: 3, name: "已入库" }, |
| | | { id: 4, name: "已完成" }, |
| | | { id: 5, name: "已取消" } |
| | | { id: 5, name: "已取消" }, |
| | | { id: 6, name: "待收货" }, |
| | | { id: 7, name: "部分收货" }, |
| | | { id: 8, name: "待质检" }, |
| | | ] |
| | | // 收货状态 |
| | | const receiveStatus = [ |
| | | { id: 1, name: "待确认" }, |
| | | { id: 2, name: "待入库" }, |
| | | { id: 3, name: "就绪" }, |
| | | { id: 3, name: "已入库" }, |
| | | { id: 4, name: "已完成" }, |
| | | { id: 5, name: "已取消" } |
| | | { id: 5, name: "已取消" }, |
| | | { id: 6, name: "待收货" }, |
| | | { id: 7, name: "部分收货" }, |
| | | { id: 8, name: "待质检" }, |
| | | ] |
| | | // 质检单状态 |
| | | const qualityStatus = [ |
| | |
| | | data |
| | | }) |
| | | } |
| | | // 确认采购单 |
| | | export function newSubmitPurchase(data) { |
| | | return request({ |
| | | url: "/api/purchase/newSubmit/"+data, |
| | | method: "get", |
| | | data |
| | | }) |
| | | } |
| | | // 新建采购类型 |
| | | export function savePurchaseType(data) { |
| | | return request({ |
| | |
| | | data |
| | | }) |
| | | } |
| | | // 获取确认列表信息 |
| | | export function getPurchaseProductConfirmInfo(data) { |
| | | return request({ |
| | | url: "/api/purchase/getPurchaseProductConfirmInfo/" + data, |
| | | method: "get", |
| | | data |
| | | }) |
| | | } |
| | | // 确认收货 |
| | | export function savePurchaseProductConfirm(data) { |
| | | return request({ |
| | | url: "/api/purchase/savePurchaseProductConfirm", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 获取质检列表信息 |
| | | export function getPurchaseQualityInspectionInfo(data) { |
| | | return request({ |
| | | url: "/api/purchase/getPurchaseQualityInspectionInfo", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 批量合格入库 |
| | | export function savePurchaseQualityInspectionInfo(data) { |
| | | return request({ |
| | | url: "/api/purchase/savePurchaseQualityInspectionInfo", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | |
| | | const loginPathMap = { |
| | | prod:`//${window.location.hostname}:9080`, |
| | | test:`//192.168.20.119:9080`, |
| | | dev: `//192.168.8.107:8080` |
| | | dev: `//192.168.20.158:8080` |
| | | } |
| | | return loginPathMap[environmentType()] |
| | | } |
| | |
| | | prod: `//${window.location.hostname}:9080`, |
| | | test: `//192.168.20.119:9080`, |
| | | // 想跳到本地启动的登录页的话需要把dev改成你本地项目路径 |
| | | dev: `//192.168.8.107:8080` |
| | | dev: `//192.168.20.158:8080` |
| | | } |
| | | return loginPathMap[this.environmentType()] |
| | | }, |
| | |
| | | <el-form ref="form" :model="tableList" :show-message="false" label-position="right"> |
| | | <el-table |
| | | ref="fromTable" |
| | | :border="isBoder" |
| | | :data="tableList.tableData" |
| | | :show-summary="showSummary.show" |
| | | :summary-method="getSummaries" |
| | |
| | | @selection-change="handleSelectionChange" |
| | | :row-key="(row) => row.productId" |
| | | > |
| | | <el-table-column v-if="selectBox" type="selection" :reserve-selection="true" width="40" align="center"> |
| | | <el-table-column v-if="selectBox" type="selection" :reserve-selection="true" width="40" align="center"> |
| | | |
| | | </el-table-column> |
| | | <el-table-column v-if="tableList.isReturn" type="index" label="#" width="50" align="center"></el-table-column> |
| | | <el-table-column |
| | |
| | | <template slot="header"> |
| | | <span v-if="item.isRequird" style="color: #f56c6c">*</span> |
| | | <span>{{ item.label }}</span> |
| | | <FilterPopover @toFiltering="toFiltering" class="margin_left_3px" v-if="item.isFilter" |
| | | :layout="item.prop" :isFilterList="item.isFilterList" |
| | | :selectedListDefault="item.selectedListDefault"></FilterPopover> |
| | | </template> |
| | | <!-- column样式 --> |
| | | <template slot-scope="scope"> |
| | | <template v-if="!detailEnter || isOperate"> |
| | | |
| | | <el-form-item |
| | | v-if="item.input" |
| | | label=" " |
| | |
| | | " |
| | | ></el-input> |
| | | </el-form-item> |
| | | <span v-else-if="item.compute">{{ calculateDifference(scope.row) }}</span> |
| | | |
| | | <el-form-item |
| | | v-else-if="item.productName" |
| | | label=" " |
| | |
| | | " |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span> |
| | | <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span> |
| | | |
| | | </template> |
| | | <!-- <template slot-scope="scope" v-if="item.compute"> |
| | | </template> --> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="剩余收货数量"> |
| | | </el-table-column> --> |
| | | <el-table-column label="操作" width="40" v-if="!detailEnter" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" :disabled="!isOperate" @click="deleteClick(scope)">删除</el-button> |
| | |
| | | <script> |
| | | import { getProductListFromGrpc, getProductList } from "@/api/productManage/product" |
| | | import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" |
| | | import FilterPopover from "@/components/makepager/FilterPopover"; |
| | | export default { |
| | | name: "CommmonFormTableView", |
| | | components: { SelectCommonDialog }, |
| | | components: { SelectCommonDialog ,FilterPopover}, |
| | | props: { |
| | | detailEnter: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | isBoder:{ |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | calculateDifference(row) { |
| | | if (row.notReceiveAmount !== null && row.nowReceiveAmount !== null) { |
| | | row.surplusReceiveAmount=row.notReceiveAmount - row.nowReceiveAmount; |
| | | return row.surplusReceiveAmount |
| | | } else { |
| | | return 0; |
| | | } |
| | | }, |
| | | toFiltering(event){ |
| | | this.$emit("toFiltering", event); |
| | | }, |
| | | getTableInfo() { |
| | | this.tableList = this.productTableList |
| | | }, |
New file |
| | |
| | | <template> |
| | | <span class="filter-popover"> |
| | | <el-popover |
| | | ref="popoverRef" |
| | | placement="bottom" |
| | | :width="popoverWidth" |
| | | trigger="click" |
| | | v-model="popoverVisible" |
| | | > |
| | | <!--多选--> |
| | | <div class="popover-content"> |
| | | <el-checkbox |
| | | v-if="isFilterList.length" |
| | | v-model="checkAll" |
| | | :indeterminate="isIndeterminate" |
| | | @change="toSelectedAllList" |
| | | >全选</el-checkbox> |
| | | <el-checkbox-group |
| | | v-if="isFilterList.length" |
| | | v-model="selectedList" |
| | | @change="toSelectedList" |
| | | > |
| | | <el-checkbox |
| | | v-for="item in isFilterList" |
| | | :key="item.name" |
| | | :label="item.id" |
| | | >{{ item.name }}</el-checkbox> |
| | | </el-checkbox-group> |
| | | </div> |
| | | <div class="btn"> |
| | | <el-button size="mini" @click.stop="btnReset">重置</el-button> |
| | | <el-button size="mini" type="primary" @click.stop="toFiltering">确定</el-button> |
| | | </div> |
| | | <svg slot="reference" class="filter-icon icon" t="1711007988136" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4239" width="200" height="200"><path d="M855.342766 151.46262c-6.056949-11.851932-18.984377-19.393699-33.219589-19.393699L101.903901 132.068921c-14.360056 0-27.412326 7.704472-33.396621 19.744693-5.988388 12.015661-3.845585 26.157753 5.520737 36.192294l255.896134 274.308483 0 309.339324c0 12.847609 7.895831 24.602328 20.389376 30.328749l189.116195 86.432535c5.154393 2.371 10.771321 3.515057 16.33913 3.515057 6.541997 0 13.090133-1.607614 18.926048-4.797259 10.718109-5.945409 17.427928-16.503882 17.809621-28.037567l12.957103-396.767536 245.078765-274.90507C859.543438 177.316451 861.425298 163.313529 855.342766 151.46262zM520.773827 804.275693l-117.384477-53.647851L403.38935 483.628836l127.858016 0L520.773827 804.275693zM550.774095 416.986019c-1.963725-0.299829-3.761674-1.090844-5.809309-1.090844L383.519814 415.895175 181.938726 199.803605l562.427506 0L550.774095 416.986019zM685.454494 524.008498l273.392624 0 0 59.759035-273.392624 0 0-59.759035ZM685.454494 654.104485l273.392624 0 0 59.759035-273.392624 0 0-59.759035ZM685.454494 773.618463l273.392624 0 0 59.759035-273.392624 0 0-59.759035Z" fill="#272636" p-id="4240"></path></svg> |
| | | </el-popover> |
| | | </span> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "PagerView", |
| | | props: { |
| | | isFilterList: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | layout:{ |
| | | type:[Number,String], |
| | | default:'' |
| | | }, |
| | | popoverWidth:{ |
| | | type:[Number,String], |
| | | default:100 |
| | | }, |
| | | //默认值 |
| | | selectedListDefault: { |
| | | type: [Array, String, Number], |
| | | default: null |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | // 多选框中全选框选中与否的标识 |
| | | checkAll: false, |
| | | // 表示 checkbox 的不确定状态,一般用于实现全选的效果 |
| | | isIndeterminate: false, |
| | | // 筛选弹窗多选列表选中数据 |
| | | selectedList: [], |
| | | popoverVisible:false, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.selectedList = this.selectedListDefault |
| | | this.toSelectedList() |
| | | }, |
| | | watch:{ |
| | | selectedListDefault(){ |
| | | this.selectedList = this.selectedListDefault |
| | | this.toSelectedList() |
| | | } |
| | | }, |
| | | methods: { |
| | | // 多选框全选操作 |
| | | toSelectedAllList(val) { |
| | | this.selectedList = val ? this.isFilterList.map(s => s.id) : [] |
| | | if(val){ |
| | | this.checkAll = true |
| | | }else{ |
| | | this.checkAll = false |
| | | } |
| | | this.isIndeterminate = false |
| | | }, |
| | | // 多选框选择操作 |
| | | toSelectedList() { |
| | | if (this.selectedList.length == 0) { |
| | | this.checkAll = false |
| | | this.isIndeterminate = false |
| | | } else if(this.selectedList.length == this.isFilterList.length){ |
| | | this.checkAll = true |
| | | this.isIndeterminate = false |
| | | } else { |
| | | this.isIndeterminate = true |
| | | this.checkAll = false |
| | | } |
| | | }, |
| | | //重置 |
| | | btnReset() { |
| | | // 移除多选框的全选状态 |
| | | this.checkAll = false |
| | | this.isIndeterminate = false |
| | | this.selectedList =[] |
| | | this.popoverVisible=false; |
| | | this.$emit('toFiltering', { |
| | | filterVal: this.selectedList||[], |
| | | layout: this.layout || '' |
| | | }) |
| | | }, |
| | | // 确定筛选 |
| | | toFiltering() { |
| | | this.popoverVisible=false; |
| | | this.$emit('toFiltering', { |
| | | filterVal: this.selectedList||[], |
| | | layout: this.layout || '' |
| | | }) |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .filter-popover{ |
| | | width:17px; |
| | | height:17px; |
| | | margin:0; |
| | | margin-top:3px; |
| | | float:right; |
| | | display:inline-block; |
| | | .filter-icon{ |
| | | width:17px; |
| | | height:17px; |
| | | display:inline-block; |
| | | } |
| | | } |
| | | .popover-content{ |
| | | max-height:130px; |
| | | margin-bottom:5px; |
| | | overflow-y:auto; |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="add-quotation"> |
| | | <el-dialog title="到货确认" :visible.sync="editConfig.visible" width="50%" :before-close="handleClose" append-to-body |
| | | custom-class="iframe-dialog"> |
| | | <el-form ref="form" :model="editConfig.infomation" label-position="right" label-width="130px" size="mini" |
| | | style="height: 60vh; overflow-x: hidden"> |
| | | <!-- 信息 --> |
| | | <div class="basic-info"> |
| | | <div class="product-view"> |
| | | <CommonFormTableView :isBoder="true" :detailEnter="true" :recalculateShow="false" :addTypeIdMultiple="true" |
| | | :product-table-list="productTableList" sign="purchase" @rowClick="rowClick" /> |
| | | </div> |
| | | <!-- <div class="btn-box"> |
| | | </div> --> |
| | | </div> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button size="small" v-if="this.editConfig.title != '查看'" @click="editConfig.visible = false">取消</el-button> |
| | | <el-button type="primary" size="small" |
| | | @click="saveClick('form')">确认收货</el-button> |
| | | <!-- <el-button type="primary" size="small" |
| | | @click="saveOkClickAll('form')">全部合格入库</el-button> --> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getPurchaseProductConfirmInfo, |
| | | savePurchaseProductConfirm |
| | | } from "@/api/purchaseManage/purchase" |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView" |
| | | export default { |
| | | name: "ArrivalConfirmation", |
| | | components: { CommonFormTableView }, |
| | | props: { |
| | | editCommonConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | visible: false, |
| | | infomation: {} |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | editConfig: this.editCommonConfig, |
| | | productTableList: {}, |
| | | editSelectSupplierConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | }, |
| | | tableData: [], |
| | | productIndex: 0, |
| | | productId: "", |
| | | isNoProduct: true, |
| | | clientList: [], |
| | | plcBrandList: [], |
| | | editRow: { |
| | | isDefault: "pin" |
| | | }, |
| | | total: 0, |
| | | totalTwo: 0, |
| | | productListIdx: 0, |
| | | lacks: [], |
| | | pickerOptions: { |
| | | disabledDate(time) { |
| | | return time.getTime() < Date.now() - 8.64e7 |
| | | } |
| | | }, |
| | | pickerOptionsBefore: { |
| | | disabledDate(time) { |
| | | return time.getTime() > Date.now() |
| | | } |
| | | }, |
| | | receiveWhouseList: [] // 收货仓库列表 |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTableForm() |
| | | this.getPurchaseProductConfirmInfo(this.editConfig.infomation.number) |
| | | }, |
| | | computed: { |
| | | // calculateDifference() { |
| | | // return this.productTableList.tableData.map(row => ({ |
| | | // ...row, |
| | | // surplusReceiveAmount: row.notReceiveAmount - row.nowReceiveAmount |
| | | // })); |
| | | // } |
| | | }, |
| | | watch: { |
| | | "editCommonConfig.visible": { |
| | | immediate: true, |
| | | handler: function () { |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | // 确认收货 |
| | | async saveClick() { |
| | | let pipeline=false // 是否有大于0的收货数量 |
| | | // let rule1=false // 本次收货是否大于未收货数量 |
| | | let arr=[] |
| | | this.productTableList.tableData.map((item)=>{ |
| | | if(item.nowReceiveAmount>0&&item.nowReceiveAmount<=item.notReceiveAmount){ |
| | | pipeline=true |
| | | arr.push(item) |
| | | } |
| | | }) |
| | | if(pipeline){ |
| | | await savePurchaseProductConfirm(arr).then((res)=>{ |
| | | if(res.code===200){ |
| | | this.editConfig.visible=false |
| | | this.$parent.getData() |
| | | this.$message.success("确认收货成功!") |
| | | } |
| | | }) |
| | | }else{ |
| | | this.$message.warning("本次收货数量不能为0且不能超出未收货数量 ") |
| | | } |
| | | }, |
| | | // 全部合格入库 |
| | | saveOkClickAll(){ |
| | | |
| | | }, |
| | | saveParams() { |
| | | let data = JSON.parse(JSON.stringify(this.editConfig.infomation)) |
| | | |
| | | let params = { |
| | | productList: this.tableData, |
| | | purchase: { |
| | | } |
| | | } |
| | | if (data.id) { |
| | | params.purchase.id = data.id |
| | | } |
| | | return params |
| | | }, |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | | setTableForm() { |
| | | this.productTableList = { |
| | | tableProductList: [], |
| | | tableData: this.tableData, |
| | | disabled: this.editConfig.isDisabled, |
| | | isReturn: true, |
| | | tableColumn: [ |
| | | { label: "产品名称", prop: "productName" }, |
| | | { label: "产品编号", prop: "productId" }, |
| | | { label: "采购数量", prop: "amount" }, |
| | | { label: "已收货数量", prop: "overReceiveAmount" }, |
| | | { label: "未收货数量", prop: "notReceiveAmount" }, |
| | | { |
| | | label: "本次收货数量", |
| | | prop: "nowReceiveAmount", |
| | | inputFloat: true, |
| | | isRequird: true, |
| | | }, |
| | | { label: "剩余收货数量", prop: "surplusReceiveAmount",compute:true} |
| | | ] |
| | | } |
| | | this.toal = this.editConfig.infomation.realTotalPrice |
| | | }, |
| | | //选择行 |
| | | rowClick(row) { |
| | | console.log(row, "xuanze") |
| | | this.productListIdx = row.productIndex |
| | | }, |
| | | // 到货确认列表 |
| | | getPurchaseProductConfirmInfo(params){ |
| | | getPurchaseProductConfirmInfo(params).then((res)=>{ |
| | | console.log(res,"res9") |
| | | this.productTableList.tableData=res.data |
| | | }) |
| | | }, |
| | | // 剩余收货计算 |
| | | calculateDifference(row) { |
| | | if (row.col1 !== null && row.col2 !== null) { |
| | | return row.col1 - row.col2; |
| | | } else { |
| | | return 0; // 或者返回你想要的默认值 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .table-bottom { |
| | | width: 500px; |
| | | float: right; |
| | | margin-right: 20px; |
| | | margin-top: 10px; |
| | | height: auto; |
| | | line-height: 30px; |
| | | font-size: 14px; |
| | | font-weight: 700; |
| | | margin-bottom: 20px; |
| | | color: #333; |
| | | |
| | | .table-bottom-item { |
| | | width: 100%; |
| | | text-align: right; |
| | | |
| | | .table-bottom-l { |
| | | width: 250px; |
| | | float: left; |
| | | } |
| | | |
| | | .table-bottom-r { |
| | | width: calc(100% - 250px); |
| | | float: right; |
| | | } |
| | | } |
| | | } |
| | | |
| | | ::v-deep { |
| | | .iframe-dialog .el-dialog__body { |
| | | .basic-info { |
| | | overflow: hidden; |
| | | margin-top: 20px; |
| | | } |
| | | } |
| | | .el-dialog__header,.el-dialog__body,.el-dialog__footer{ |
| | | padding: 0 20px; |
| | | } |
| | | .el-dialog__header{ |
| | | height: 50px; |
| | | line-height: 50px; |
| | | } |
| | | .dialog-footer { |
| | | text-align: right !important; |
| | | } |
| | | .el-table tr { |
| | | background-color: #fff; |
| | | } |
| | | .el-table th.el-table__cell.is-leaf{ |
| | | background-color: #F1F3F8 !important; |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="add-quotation"> |
| | | <el-dialog :visible.sync="editConfig.visible" width="70%" append-to-body custom-class="iframe-dialog"> |
| | | <el-header> |
| | | <el-button type="primary" v-if="this.editConfig.title != '查看'" size="small" |
| | | @click="saveClick()">批量合格入库</el-button> |
| | | <el-button type="primary" v-if="this.editConfig.title != '查看'" size="small" |
| | | @click="saveNoClick()">批量不合格</el-button> |
| | | </el-header> |
| | | <el-form ref="form" :model="editConfig.infomation" label-position="right" label-width="130px" size="mini" |
| | | style="height: 60vh; overflow-x: hidden"> |
| | | <div class="basic-info"> |
| | | <div class="product-view"> |
| | | <CommonFormTableView :isBoder="true" :selectBox="true" :detailEnter="true" :recalculateShow="false" |
| | | :addTypeIdMultiple="true" :product-table-list="productTableList" sign="purchase" @rowClick="rowClick" |
| | | @getSelectArray="getSelectArray" @toFiltering="toFiltering"> |
| | | |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="120" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" @click="saveClick(scope.row)" |
| | | style="margin-right: 5px">合格</el-button> |
| | | <el-button type="text" size="small" @click="saveNoClick(scope.row)" |
| | | style="margin-right: 5px">不合格</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </CommonFormTableView> |
| | | </div> |
| | | </div> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button size="small" @click="editConfig.visible = false">关闭</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getPurchaseQualityInspectionInfo, |
| | | savePurchaseQualityInspectionInfo |
| | | } from "@/api/purchaseManage/purchase" |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView" |
| | | export default { |
| | | name: "ArrivalConfirmation", |
| | | components: { CommonFormTableView }, |
| | | props: { |
| | | editCommonConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | visible: false, |
| | | infomation: {} |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | editConfig: this.editCommonConfig, |
| | | productTableList: {}, |
| | | editSelectSupplierConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | }, |
| | | tableData: [], |
| | | productIndex: 0, |
| | | productId: "", |
| | | isNoProduct: true, |
| | | clientList: [], |
| | | plcBrandList: [], |
| | | editRow: { |
| | | isDefault: "pin" |
| | | }, |
| | | total: 0, |
| | | totalTwo: 0, |
| | | productListIdx: 0, |
| | | lacks: [], |
| | | pickerOptions: { |
| | | disabledDate(time) { |
| | | return time.getTime() < Date.now() - 8.64e7 |
| | | } |
| | | }, |
| | | pickerOptionsBefore: { |
| | | disabledDate(time) { |
| | | return time.getTime() > Date.now() |
| | | } |
| | | }, |
| | | receiveWhouseList: [], // 收货仓库列表 |
| | | timeList: [], |
| | | statusList: [ |
| | | { id: 7, name: "部分收货" }, |
| | | { id: 8, name: "待质检" } |
| | | ], |
| | | thatStatus: [], |
| | | thatTimes: [], |
| | | selectList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTableForm() |
| | | this.getPurchaseQualityInspectionInfo({ |
| | | purchaseNumber: this.editConfig.infomation.number, |
| | | status: this.thatStatus, |
| | | times: this.thatTimes |
| | | }) |
| | | }, |
| | | computed: { |
| | | |
| | | }, |
| | | watch: { |
| | | "editCommonConfig.visible": { |
| | | immediate: true, |
| | | handler: function () { |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | // 合格入库 |
| | | saveClick(row) { |
| | | if (row) { |
| | | this.savePurchaseQualityInspectionInfo({ |
| | | purchaseId: Number(this.editConfig.infomation.id), |
| | | ids: [Number(row.id)], |
| | | status: 2, |
| | | }) |
| | | |
| | | } else { |
| | | this.savePurchaseQualityInspectionInfo({ |
| | | purchaseId: Number(this.editConfig.infomation.id), |
| | | ids: this.selectList, |
| | | status: 2, |
| | | }) |
| | | } |
| | | }, |
| | | // 不合格 |
| | | saveNoClick(row){ |
| | | if (row) { |
| | | this.savePurchaseQualityInspectionInfo({ |
| | | purchaseId: Number(this.editConfig.infomation.id), |
| | | ids: [Number(row.id)], |
| | | status: 3, |
| | | }) |
| | | |
| | | } else { |
| | | this.savePurchaseQualityInspectionInfo({ |
| | | purchaseId: Number(this.editConfig.infomation.id), |
| | | ids: this.selectList, |
| | | status: 3, |
| | | }) |
| | | } |
| | | }, |
| | | async savePurchaseQualityInspectionInfo(params) { |
| | | await savePurchaseQualityInspectionInfo(params).then((res) => { |
| | | if (res.code === 200) { |
| | | this.editConfig.visible = false |
| | | if(params.status===2){ |
| | | this.$message.success("质检合格!") |
| | | }else if(params.status===3){ |
| | | this.$message.success("已设置为不合格!") |
| | | |
| | | } |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | }, |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | | setTableForm() { |
| | | this.productTableList = { |
| | | tableProductList: [], |
| | | tableData: this.tableData, |
| | | disabled: this.editConfig.isDisabled, |
| | | isReturn: true, |
| | | tableColumn: [ |
| | | { |
| | | label: "收货时间", prop: "createTime", |
| | | isFilter: true, |
| | | isFilterList: this.timeList, |
| | | selectedListDefault: this.getSelectedOperateStatus([], this.timeList), |
| | | }, |
| | | { label: "收货人", prop: "principal" }, |
| | | { label: "产品名称", prop: "productName" }, |
| | | { label: "产品编码", prop: "productId" }, |
| | | { label: "规格", prop: "specs" }, |
| | | { label: "数量", prop: "amount" }, |
| | | { label: "单位", prop: "unit" }, |
| | | { |
| | | label: "状态", prop: "status", |
| | | isFilter: true, |
| | | isFilterList: this.statusList, |
| | | selectedListDefault: this.getSelectedOperateStatus([], this.statusList), |
| | | }, |
| | | ] |
| | | } |
| | | this.toal = this.editConfig.infomation.realTotalPrice |
| | | }, |
| | | //选择行 |
| | | rowClick(row) { |
| | | console.log(row, "xuanze") |
| | | this.productListIdx = row.productIndex |
| | | }, |
| | | // 多选框 |
| | | getSelectArray(val) { |
| | | console.log(val, "val") |
| | | this.selectList = [] |
| | | val.map((item) => { |
| | | this.selectList.push(Number(item.id)) |
| | | }) |
| | | }, |
| | | // 获取质检列表信息 |
| | | async getPurchaseQualityInspectionInfo(params) { |
| | | await getPurchaseQualityInspectionInfo(params).then((res) => { |
| | | this.timeList = [] |
| | | res.data.map((item) => { |
| | | this.timeList.push({ id: item.createTime, name: item.createTime }) |
| | | }) |
| | | this.setTableForm() |
| | | this.productTableList.tableData = res.data |
| | | }) |
| | | }, |
| | | // 表头筛选项列表 |
| | | getSelectedOperateStatus(selectArr, allArr) { |
| | | let arr = selectArr |
| | | if (selectArr.length == 0) { |
| | | arr = [] |
| | | for (let i in allArr) { |
| | | arr.push(allArr[i].id) |
| | | } |
| | | } else { |
| | | arr = [selectArr.join(',')] |
| | | } |
| | | console.log(arr, "arr") |
| | | return arr; |
| | | }, |
| | | // 表头筛选事件 |
| | | async toFiltering(obj) { |
| | | console.log(obj, "obj") |
| | | if (obj.layout == 'createTime') { |
| | | this.thatTimes = obj.filterVal |
| | | } else if (obj.layout == 'status') { |
| | | this.thatStatus = obj.filterVal |
| | | } |
| | | await getPurchaseQualityInspectionInfo({ |
| | | purchaseNumber: this.editConfig.infomation.number, |
| | | status: this.thatStatus, |
| | | times: this.thatTimes |
| | | }).then((res) => { |
| | | this.timeList = [] |
| | | res.data.map((item) => { |
| | | this.timeList.push({ id: item.createTime, name: item.createTime }) |
| | | }) |
| | | this.productTableList.tableData = res.data |
| | | }) |
| | | |
| | | }, |
| | | // 合格 |
| | | trueClick(row) { |
| | | console.log(row, "row") |
| | | |
| | | }, |
| | | falseClick(row) { |
| | | console.log(row, "row") |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .table-bottom { |
| | | width: 500px; |
| | | float: right; |
| | | margin-right: 20px; |
| | | margin-top: 10px; |
| | | height: auto; |
| | | line-height: 30px; |
| | | font-size: 14px; |
| | | font-weight: 700; |
| | | margin-bottom: 20px; |
| | | color: #333; |
| | | |
| | | .table-bottom-item { |
| | | width: 100%; |
| | | text-align: right; |
| | | |
| | | .table-bottom-l { |
| | | width: 250px; |
| | | float: left; |
| | | } |
| | | |
| | | .table-bottom-r { |
| | | width: calc(100% - 250px); |
| | | float: right; |
| | | } |
| | | } |
| | | } |
| | | |
| | | ::v-deep { |
| | | .iframe-dialog .el-dialog__body { |
| | | padding: 0px 20px; |
| | | |
| | | .basic-info { |
| | | overflow: hidden; |
| | | } |
| | | } |
| | | |
| | | .el-header { |
| | | padding: 0; |
| | | height: 50px; |
| | | line-height: 50px; |
| | | } |
| | | |
| | | .el-dialog__header { |
| | | display: none; |
| | | } |
| | | |
| | | .dialog-footer { |
| | | text-align: right !important; |
| | | padding: 0px 20px; |
| | | } |
| | | |
| | | .el-table tr { |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .el-table th.el-table__cell.is-leaf { |
| | | background-color: #F1F3F8 !important; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <el-button type="text" size="small" @click="btnLook(scope.row)" style="margin-right: 5px" |
| | | >查看</el-button |
| | | > |
| | | <!-- <el-button type="text" size="small" @click="btnLook(scope.row)" style="margin-right: 5px" |
| | | <el-button |
| | | v-if="scope.row.status === 6||scope.row.status === 7" type="text" size="small" @click="confirmation(scope.row)" style="margin-right: 5px" |
| | | >到货确认</el-button |
| | | > |
| | | <el-button type="text" size="small" @click="btnLook(scope.row)" style="margin-right: 5px" |
| | | <el-button v-if="scope.row.status === 7||scope.row.status === 8" type="text" size="small" @click="TestingAllClick(scope.row)" style="margin-right: 5px" |
| | | >去质检</el-button |
| | | > --> |
| | | > |
| | | <el-button |
| | | v-if="scope.row.status === 1" |
| | | type="text" |
| | |
| | | > |
| | | 收货信息 |
| | | </div> |
| | | <div |
| | | class="tab-pane" |
| | | @click="getTab(2)" |
| | | :style="{ |
| | | background: TabsIndex == 2 ? '#2a78fb' : '#F1F3F8', |
| | | color: TabsIndex == 2 ? '#fff' : '#666' |
| | | }" |
| | | > |
| | | 入库信息 |
| | | </div> |
| | | </div> |
| | | <div class="list-view"> |
| | | <TableCommonView :loading="loading" :table-list="productTableList" @selTableCol="selBottomTableCol"> |
| | |
| | | <DetailSupplier v-if="commonDetail.visible" :common-detail="commonDetail" /> |
| | | <!-- 新建/编辑 --> |
| | | <AddPurchase ref="addDialog" v-if="editConfig.visible" :edit-common-config="editConfig" /> |
| | | <!-- 到货通知 --> |
| | | <ArrivalConfirmation v-if="editAffirmConfig.visible" :edit-common-config="editAffirmConfig" /> |
| | | <!-- 批量质检 --> |
| | | <TestingAll v-if="editTestingAllConfig.visible" :edit-common-config="editTestingAllConfig" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { |
| | | getPurchaseList, |
| | | getPurchaseInfo, |
| | | submitPurchase, |
| | | newSubmitPurchase, |
| | | deletePurchase, |
| | | getOperationInfo |
| | | } from "@/api/purchaseManage/purchase" |
| | | import DetailSupplier from "@/views/purchaseManage/purchase/DetailSupplier" |
| | | import AddPurchase from "@/views/purchaseManage/purchase/components/AddPurchase" |
| | | import ArrivalConfirmation from"@/views/purchaseManage/purchase/components/ArrivalConfirmation" |
| | | import TestingAll from"@/views/purchaseManage/purchase/components/TestingAll" |
| | | import { getSupplierList } from "@/api/supplierManage/supplier" |
| | | import { getDataByType } from "@/api/data" |
| | | export default { |
| | | name: "SupplierManage", |
| | | props: {}, |
| | | components: { DetailSupplier, AddPurchase }, |
| | | components: { DetailSupplier, AddPurchase,ArrivalConfirmation,TestingAll }, |
| | | mixins: [pageMixin], |
| | | computed: {}, |
| | | data() { |
| | |
| | | ] |
| | | // 收货信息 |
| | | const recriveColumn = [ |
| | | { label: "收货时间", prop: "operationNumber", default: true }, |
| | | { label: "收货人", prop: "principal" }, |
| | | { label: "产品名称", prop: "name" }, |
| | | { label: "产品编码", prop: "number" }, |
| | | { label: "规格", prop: "warehouseName" }, |
| | | { label: "数量", prop: "amount" }, |
| | | { label: "单位", prop: "overTime" }, |
| | | { label: "状态", prop: "status", isCallMethod: true, getCallMethod: this.getreceiveStatusStatus } |
| | | ] |
| | | // 入库信息 |
| | | const inLibraryColumn = [ |
| | | { label: "入库单号", prop: "operationNumber", default: true }, |
| | | { label: "收货仓库", prop: "warehouseName" }, |
| | | { label: "产品名称", prop: "name" }, |
| | |
| | | detailEnter: false, |
| | | infomation: { |
| | | supplierList: [] |
| | | } |
| | | }, |
| | | editAffirmConfig: { |
| | | visible: false, |
| | | isDisabled: false, |
| | | detailEnter: false, |
| | | infomation: { |
| | | |
| | | // supplierList: [] |
| | | } |
| | | }, |
| | | editTestingAllConfig:{ |
| | | visible: false, |
| | | isDisabled: false, |
| | | detailEnter: false, |
| | | infomation: { |
| | | |
| | | } |
| | | }, |
| | | tableColumn: [ |
| | |
| | | ], |
| | | // 收货信息 |
| | | recriveColumn: recriveColumn, |
| | | showReceiveCol: ["入库单号", "收货仓库", "产品名称", "产品编码", "数量", "入库时间", "收货人", "状态"], |
| | | // 入库信息 |
| | | inLibraryColumn:inLibraryColumn, |
| | | showReceiveCol: ["收货时间", "收货人", "产品名称", "产品编码", "规格", "数量", "单位", "状态"], |
| | | inLibraryCol: ["入库单号", "收货仓库", "产品名称", "产品编码", "数量", "入库时间", "收货人", "状态"], |
| | | loading: false, |
| | | selectRow: {} |
| | | } |
| | |
| | | if (!row.supplierName) { |
| | | this.btnEdit(row) |
| | | } else { |
| | | submitPurchase({ id: Number(row.id), status: 2 }).then((response) => { |
| | | newSubmitPurchase(row.id).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("提交成功") |
| | | this.getData() |
| | |
| | | type: "warning" |
| | | }).then( |
| | | () => { |
| | | submitPurchase({ id: Number(row.id), status: 5 }).then((response) => { |
| | | newSubmitPurchase(Number(row.id)).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("已取消") |
| | | this.getData() |
| | |
| | | setTimeout(() => { |
| | | this.tableLoading = false |
| | | }, 3000) |
| | | }, |
| | | // 到货确认 |
| | | confirmation(row){ |
| | | console.log(row,"row") |
| | | this.editAffirmConfig.infomation=row |
| | | this.editAffirmConfig.visible=true |
| | | }, |
| | | // 去质检 |
| | | TestingAllClick(row){ |
| | | this.editTestingAllConfig.infomation=row |
| | | this.editTestingAllConfig.visible=true |
| | | }, |
| | | // 详情 |
| | | selCommonClick(row) { |
| | |
| | | this.showBottomCol = this.showReceiveCol |
| | | this.setBottomList() |
| | | this.getProductInventoryInfo(this.selectRow) |
| | | } else if (this.TabsIndex == 2) { |
| | | // 入库信息列表 |
| | | this.tableBottomColumn = this.inLibraryColumn |
| | | this.showBottomCol = this.inLibraryCol |
| | | this.setBottomList() |
| | | this.getProductInventoryInfo(this.selectRow) |
| | | } |
| | | }, |
| | | // 状态 |
| | | getStatus(val) { |
| | | return val === 1 ? "待确认" : val === 2 ? "待出库" : val === 3 ? "出库完成" : val === 4 ? "已关闭" : "--" |
| | | return val === 1 ? "待确认" : val === 2 ? "待入库" : val === 3 ? "已入库" : val === 4 ? "已完成" : val === 5 ? "已取消" :val === 6 ? "待收货" :val === 7 ? "部分收货" :val === 8 ? "待质检" : "--" |
| | | }, |
| | | // 获取产品/收货信息 |
| | | async getProductInventoryInfo(row) { |
| | |
| | | |
| | | // target: "http://192.168.20.118:8889", // http://192.168.20.119:8002 http://fai365.com:30150/ |
| | | // target: "http://192.168.20.120:8004", |
| | | // target: "http://192.168.20.119:8004", // http://192.168.20.119:8004 http://fai365.com:30150/ |
| | | target: "http://192.168.20.119:8004", // http://192.168.20.119:8004 http://fai365.com:30150/ |
| | | ws: true, |
| | | changeOrigin: true |