src/api/business/finishedProductSampling.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/components/Table/lims-table.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/business/finishedProductSampling/components/addQuarterItem.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/business/finishedProductSampling/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/api/business/finishedProductSampling.js
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,35 @@ // æåæ½æ ·è¯¦æ 页é¢ç¸å ³æ¥å£ import request from '@/utils/request' // åæææ ¹æ®idæ¥æ£ export function getIfsStock(query) { return request({ url: '/finishProductSpotCheck/getIfsStock', method: 'post', data: query }) } // å£åº¦æ½æ£æ¥ç详æ export function getQuarter(query) { return request({ url: '/finishProductSpotCheck/getQuarter', method: 'get', params: query }) } // æäº¤å£åº¦æ½æ · export function addQuarter(query) { return request({ url: '/finishProductSpotCheck/addQuarter', method: 'post', data: query }) } // ç¼è¾å£åº¦æ£éª export function updateQuarterOnOrder(query) { return request({ url: '/finishProductSpotCheck/updateQuarterOnOrder', method: 'post', data: query }) } src/components/Table/lims-table.vue
@@ -64,7 +64,8 @@ <!-- æé® --> <div v-else-if="item.dataType == 'action'"> <template v-for="(o, key) in item.operation"> <el-button v-if="o.type != 'upload'" size="mini" v-show="o.showHide ? o.showHide(scope.row) : true" <el-button v-show="o.type != 'upload'" size="mini" v-if="o.showHide ? o.showHide(scope.row) : true" :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="iconFn(o)" :plain="o.plain" :style="{ color: o.name === 'å é¤' ? '#f56c6c' : o.color }" :type="o.type | typeFn(scope.row)" @click="o.clickFun(scope.row)" :key="key"> @@ -79,7 +80,8 @@ :disabled="o.disabled ? o.disabled(scope.row) : false" :accept="o.accept ? o.accept : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' " v-if="o.type == 'upload'" style="display: inline-block; width: 50px" " v-if="o.type == 'upload'" style="display: inline-block; width: 50px" v-show="o.showHide ? o.showHide(scope.row) : true" :headers="uploadHeader" :on-error="onError" src/views/business/finishedProductSampling/components/addQuarterItem.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,296 @@ <template> <div> <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="quarterSampleDia" title="å£åº¦æ½æ ·" width="90%" @close="quarterSampleDia = false"> <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px"> <div style="width: 30%;display: flex;align-items: center;" > <span style="width: 50px">ç¼å·ï¼</span> <el-input v-model="quarterSampleForm.quarterNo" :disabled="operationType !== 'add'" size="small"></el-input> </div> <div v-if="operationType === 'add'"> <el-button size="small" type="primary" @click="addQuarter">æ·»å </el-button> <el-button size="small" type="danger" @click="clearTable">æ¸ ç©º</el-button> </div> </div> <div> <el-table v-loading="tableLoading" :data="quarterItems" border height="420" style="width: 100%"> <el-table-column label="产åç±»å" prop="productType" width="200"> <template slot-scope="{row}"> <template> <el-input v-model="row.productType" size="small"/> </template> </template> </el-table-column> <el-table-column label="责任人" prop="dutyUser" width="100"></el-table-column> <el-table-column label="åå·" prop="productModel" width="120"> <template slot-scope="{row}"> <template> <el-input v-model="row.productModel" size="small" :disabled="operationType === 'view'"/> </template> </template> </el-table-column> <el-table-column label="æ½æ ·æ°é" min-width="340" prop="spotCheckNumber"> <template slot-scope="{row}"> <template> <el-input v-model="row.spotCheckNumber" size="small" :disabled="operationType === 'view'"/> </template> </template> </el-table-column> <el-table-column v-if="operationType === 'add'" label="æ°é" min-width="120" prop="number"> <template slot-scope="{row}"> <template> <el-input v-model="row.number" size="small" :disabled="operationType === 'view'"/> </template> </template> </el-table-column> <el-table-column v-if="operationType !== 'add'" label="æ½æ ·æ¶é´" prop="spotCheckTime" width="160"> <template slot-scope="{row}"> <template> <el-date-picker v-model="row.spotCheckTime" format="yyyy-MM-dd" :disabled="operationType === 'view'" placeholder="éæ©æ¥æ" size="small" clearable style="width:100%" type="date" value-format="yyyy-MM-dd"> </el-date-picker> </template> </template> </el-table-column> <el-table-column v-if="operationType !== 'add'" label="è¯æ ·ç»è®º" prop="result" width="130"> <template v-slot="scope"> <el-select v-model="scope.row.result" placeholder="è¯·éæ©" size="small" clearable :disabled="operationType === 'view'"> <el-option label="åæ ¼" value="åæ ¼"></el-option> <el-option label="ä¸åæ ¼" value="ä¸åæ ¼"></el-option> </el-select> </template> </el-table-column> <el-table-column v-if="operationType !== 'add'" label="åæ ·äººå" prop="samplingUser" width="120"> <template slot-scope="{row}"> <template> <el-input v-model="row.samplingUser" size="small" :disabled="operationType === 'view'"/> </template> </template> </el-table-column> <el-table-column label="夿³¨" prop="itemRemark" width="200"> <template slot-scope="{row}"> <template> <el-input v-model="row.itemRemark" size="small" :disabled="operationType === 'view'"/> </template> </template> </el-table-column> <el-table-column v-if="operationType !== 'view'" fixed="right" label="æä½" width="100"> <template slot-scope="scope"> <el-button size="small" style="color: #f56c6c" type="text" @click="deleteScope(scope.$index)">å é¤</el-button> </template> </el-table-column> </el-table> </div> <div style="display: flex;align-items: center;margin: 10px 0"> <span style="width: 70px">夿³¨ï¼</span> <el-input v-model="quarterSampleForm.remark" :disabled="operationType === 'view'" size="small" style="width: 43%" type="textarea"></el-input> </div> <div v-if="operationType !== 'add'"> <el-form ref="form" :model="editForm" label-width="70px"> <el-col :span="12"> <el-form-item label="ç¼å¶äººï¼"> <el-select v-model="editForm.writeUser" :disabled="operationType !=='edit'" placeholder="è¯·éæ©" size="small" style="width: 100%"> <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="ä¼ç¾äººï¼"> <el-select v-model="editForm.countersignUser" :disabled="operationType !=='edit'" multiple placeholder="è¯·éæ©" size="small" style="width: 100%"> <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="å®¡æ ¸äººï¼"> <el-select v-model="editForm.examineUser" :disabled="operationType !=='edit'" placeholder="è¯·éæ©" size="small" style="width: 100%"> <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="æ¹å人ï¼"> <el-select v-model="editForm.ratifyUser" :disabled="operationType !=='edit'" placeholder="è¯·éæ©" size="small" style="width: 100%"> <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> </el-select> </el-form-item> </el-col> </el-form> </div> <span v-if="operationType !== 'view'" slot="footer" class="dialog-footer"> <el-button v-if="operationType !== 'add'" @click="quarterSampleDia = false">å æ¶</el-button> <el-button v-if="operationType === 'add'" @click="quarterSampleDia = false">ä¿ å</el-button> <el-button type="primary" @click="handleSample">ç¡® å®</el-button> </span> </el-dialog> </div> </template> <script> import {addQuarter, getQuarter, updateQuarterOnOrder} from "@/api/business/finishedProductSampling"; import {selectUserCondition} from "@/api/business/inspectionTask"; import {mapGetters} from "vuex"; export default { name: "addQuarterItem", // import å¼å ¥çç»ä»¶éè¦æ³¨å ¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ components: {}, data() { // è¿éåæ¾æ°æ® return { tableLoading: false, quarterSampleDia: false, // å£åº¦æ½æ ·å¼¹æ¡ quarterSampleForm: { quarterNo: '', // ç¼å· }, quarterItems: [], quarterTemItems: [], operationType: '', editForm: { quarterId: '', writeUser: '', // ç¼å¶äºº countersignUser: [], // ä¼ç¾äºº examineUser: '', // å®¡æ ¸äºº ratifyUser: '', // æ¹å人 }, userList: [], quarterRow: {}, } }, computed: { ...mapGetters(["nickName"]), }, mounted() { this.getUserList() }, // æ¹æ³éå methods: { openDia (quarterTemItems, type) { this.quarterSampleDia = true this.operationType = type if (type === 'add') { if (quarterTemItems.length > 0) { this.quarterItems = quarterTemItems } this.quarterSampleForm.quarterNo = getCurrentMonthTwoDigits() } else { this.tableLoading = true this.quarterRow = quarterTemItems getQuarter({quarterId: quarterTemItems.quarterId}).then(res => { this.tableLoading = false if (res.code === 200) { this.quarterItems = res.data.quarterItems this.quarterSampleForm.quarterNo = res.data.quarterNo this.quarterSampleForm.remark = res.data.remark this.editForm.quarterId = res.data.quarterId this.editForm.writeUser = res.data.writeUser this.editForm.examineUser = res.data.examineUser this.editForm.ratifyUser = res.data.ratifyUser if (res.data.countersignUser) { this.editForm.countersignUser = res.data.countersignUser.split(",").map(Number) } } }).catch(err => { this.tableLoading = false }) } }, // æå¨æ·»å addQuarter () { this.quarterItems.push({ productType: '', dutyUser: this.nickName, productModel: '', spotCheckNumber: '', number: '', spotCheckTime: '', result: '', samplingUser: '', itemRemark: '', }) }, // æäº¤å£åº¦æ½æ · handleSample () { this.$confirm('æ¯å¦æäº¤è¯¥æ°æ®', 'æç¤º', { confirmButtonText: 'ç¡®å®', cancelButtonText: 'åæ¶', type: 'warning' }).then(() => { if (this.operationType === 'add') { this.quarterSampleForm.quarterItems = JSON.parse(JSON.stringify(this.quarterItems)) this.quarterSampleForm.quarterItems.forEach(item => { item.spotCheckNumber = item.spotCheckNumber + ' ' + (item.number == null ? "" : item.number) }) addQuarter(this.quarterSampleForm).then(res => { if (res.code == 200) { this.$message.success('æäº¤æå') this.quarterItems = [] this.$parent.quarterTemItems = [] this.closeQuarterSampleDia() } }) } else { const params = {...this.editForm} if (params.countersignUser.length > 0) { params.countersignUser = params.countersignUser.join(',') } else { params.countersignUser = '' } params.quarterItems = JSON.parse(JSON.stringify(this.quarterItems)) updateQuarterOnOrder(params).then(res => { if (res.code == 200) { this.$message.success('æäº¤æå') this.quarterItems = [] this.closeQuarterSampleDia() } }) } }).catch(() => { this.$message({ type: 'info', message: '已忶' }); }); }, // æ¸ ç©ºæ½æ ·è®¡å clearTable () { this.quarterItems = [] this.$parent.quarterTemItems = [] }, // æå¨å é¤ deleteScope (index) { this.quarterItems.splice(index, 1) }, // å ³éå£åº¦æ½æ ·å¼¹æ¡ closeQuarterSampleDia () { this.quarterSampleDia = false if (this.operationType === 'add') { this.$parent.handleStockList() } else { this.$parent.refreshTable('page') } }, getUserList(){ selectUserCondition({ type: 0 }).then((res) => { this.userList = res.data; }) }, }, } function getCurrentMonthTwoDigits() { const currentDate = new Date(); const year = currentDate.getFullYear(); const currentMonth = currentDate.getMonth() + 1; return year + currentMonth.toString().padStart(2, '0'); } </script> <style scoped> </style> src/views/business/finishedProductSampling/index.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,448 @@ <!--æåæ½æ ·é¡µé¢--> <template> <div style="padding: 10px 0"> <div class="card"> <div class="title"> <el-button size="small" type="primary" @click="addTemQuarter">æ°å¢</el-button> <el-button size="small" type="primary" @click="quarterSample">å£åº¦æ½æ ·</el-button> <el-button size="small" type="primary" @click="handleStockList">å·æ°</el-button> </div> <el-table ref="finishedproducttransferTable" v-loading="tableLoading" :data="stockList" :header-cell-style="lineSideWarehouseTableHeaderCellStyle" :row-class-name="lineSideWarehouseTableRowClassName" class="finishedproducttransfer-table" height="calc(100vh - 240px)" @selection-change="handleSelectionChange" > <el-table-column type="selection" width="45"></el-table-column> <el-table-column :show-overflow-tooltip="true" align="center" label="客æ·è®¢åç¼å·" prop="customerOrderNo" width="140" > <template slot="header" slot-scope="scope"> <div style="line-height: 14px;margin-bottom: 6px">客æ·è®¢åç¼å·</div> <div class="th" @click.stop> <el-input v-model="queryParamOne.customerOrderNo" clearable size="mini" type="text" @clear="handleStockList" @keyup.enter.native="handleStockList" ></el-input> </div> </template> <template slot-scope="scope"> <span>{{ scope.row.customerOrderNo }}</span> </template> </el-table-column> <el-table-column align="center" label="æåé¶ä»¶å·" prop="partNo" width="140" > <template slot="header" slot-scope="scope"> <div style="line-height: 14px;margin-bottom: 6px">æåé¶ä»¶å·</div> <div class="th" @click.stop> <el-input v-model="queryParamOne.partNo" clearable size="mini" type="text" @clear="handleStockList" @keyup.enter.native="handleStockList" ></el-input> </div> </template> <template slot-scope="scope"> <span>{{ scope.row.partNo }}</span> </template> </el-table-column> <el-table-column align="center" label="é¶ä»¶åç§°" prop="partName" width="140" > <template slot="header" slot-scope="scope"> <div style="line-height: 14px;margin-bottom: 6px">é¶ä»¶åç§°</div> <div class="th" @click.stop> <el-input v-model="queryParamOne.partName" clearable size="mini" type="text" @clear="handleStockList" @keyup.enter.native="handleStockList" ></el-input> </div> </template> <template slot-scope="scope"> <span>{{ scope.row.partName }}</span> </template> </el-table-column> <el-table-column :show-overflow-tooltip="true" align="center" label="ä»åº" prop="warehouseName" width="140" > <template slot="header" slot-scope="scope"> <div style="line-height: 14px;margin-bottom: 6px">ä»åº</div> <div class="th" @click.stop> <el-input v-model="queryParamOne.warehouseName" clearable size="mini" type="text" @clear="handleStockList" @keyup.enter.native="handleStockList" ></el-input> </div> </template> <template slot-scope="scope"> <span>{{ scope.row.warehouseName }}</span> </template> </el-table-column> <el-table-column :show-overflow-tooltip="true" align="center" label="åºä½å·" prop="locationNo" width="140" > <template slot="header" slot-scope="scope"> <div style="line-height: 14px;margin-bottom: 6px">åºä½å·</div> <div class="th" @click.stop> <el-input v-model="queryParamOne.locationNo" clearable size="mini" type="text" @clear="handleStockList" @keyup.enter.native="handleStockList" ></el-input> </div> </template> <template slot-scope="scope"> <span>{{ scope.row.locationNo }}</span> </template> </el-table-column> <el-table-column :show-overflow-tooltip="true" align="center" label="åºä½åç§°" prop="locationName" width="140" > <template slot="header" slot-scope="scope"> <div style="line-height: 14px;margin-bottom: 6px">åºä½åç§°</div> <div class="th" @click.stop> <el-input v-model="queryParamOne.locationName" clearable size="mini" type="text" @clear="handleStockList" @keyup.enter.native="handleStockList" ></el-input> </div> </template> <template slot-scope="scope"> <span>{{ scope.row.locationName }}</span> </template> </el-table-column> <el-table-column align="center" label="æ¹æ¬¡å·" prop="partBatchNo" width="140" > <template slot="header" slot-scope="scope"> <div style="line-height: 14px;margin-bottom: 6px">æ¹æ¬¡å·</div> <div class="th" @click.stop> <el-input v-model="queryParamOne.partBatchNo" clearable size="mini" type="text" @clear="handleStockList" @keyup.enter.native="handleStockList" ></el-input> </div> </template> <template slot-scope="scope"> <span>{{ scope.row.partBatchNo }}</span> </template> </el-table-column> <el-table-column align="center" label="å ¥åºæ¥æº" prop="inSource" width="140" > <template slot="header" slot-scope="scope"> <div style="line-height: 14px;margin-bottom: 6px">å ¥åºæ¥æº</div> <div class="th" @click.stop> <el-input v-model="queryParamOne.inSource" clearable size="mini" type="text" @clear="handleStockList" @keyup.enter.native="handleStockList" ></el-input> </div> </template> <template slot-scope="scope"> <span>{{ scope.row.inSource }}</span> </template> </el-table-column> <el-table-column align="center" label="夿¤é¢è²" prop="outerColor" width="140" > <template slot="header" slot-scope="scope"> <div style="line-height: 14px;margin-bottom: 6px">夿¤é¢è²</div> <div class="th" @click.stop> <el-input v-model="queryParamOne.outerColor" clearable size="mini" type="text" @clear="handleStockList" @keyup.enter.native="handleStockList" ></el-input> </div> </template> <template slot-scope="scope"> <span>{{ scope.row.outerColor }}</span> </template> </el-table-column> <el-table-column align="center" label="åºåæ°é" prop="stockQuantity" width="140" > </el-table-column> <el-table-column align="center" label="å¯ç¨åºåæ°é" prop="availableStockQuantity" width="140" > <template slot-scope="scope"> <span>{{ scope.row.availableStockQuantity }}</span> </template> </el-table-column> </el-table> <div class="pagin-page" style="margin-top: 0;margin-bottom: 0;"> <el-pagination background :current-page="queryReport.current" :page-size="queryReport.size" :page-sizes="[10, 15, 20, 50, 100]" :total="queryReport.total" layout="total, sizes, prev, pager, next, jumper" style="text-align:right;padding: 20px 16px;" @size-change="handleSizeChangeReport" @current-change="handleCurrentChangeReport" > </el-pagination> </div> </div> <add-quarter-item ref="addQuarterItem"></add-quarter-item> </div> </template> <script> import AddQuarterItem from "./components/addQuarterItem.vue"; import {getIfsStock} from "@/api/business/finishedProductSampling"; import {mapGetters} from "vuex"; export default { data() { return { stockList: [], queryParamOne: { partNo: null, partName: null, warehouseName: null, locationName: null, locationNo: null, partBatchNo: null, stockQuantity: null, availableStockQuantity: null, outerColor: null, customerOrderNo: null, inSource: null, }, queryReport: { current: 1, size: 20, total: 0 }, tableLoading: false, multipleSelection: [], // tableæéä¸ç对象 showEditForm: false, showMoveForm: false, showMoveAllForm: false, erpfinishstock: {}, isAvaliable: false, isPackage: false, quarterTemItems: [], operationType: '' } }, components: {AddQuarterItem}, mounted() { this.getIfsStock() }, updated() { this.$nextTick(() => { this.$refs.finishedproducttransferTable.doLayout() }) }, computed: { ...mapGetters(["nickName"]), }, methods: { // å£åº¦æ½æ · quarterSample () { this.$refs.addQuarterItem.openDia(this.quarterTemItems, 'add') }, addTemQuarter () { if (this.multipleSelection.length > 0) { const multipleSelection = JSON.parse(JSON.stringify(this.multipleSelection)) if (multipleSelection.length > 0) { multipleSelection.forEach(item => { if (item.partName.includes(' ')) { const list = item.partName.match(/^(\S+)\s(.*)/).slice(1) console.log('list', list) item.productType = list[0] item.spotCheckNumber = list[1] } item.dutyUser = this.nickName item.itemRemark = item.partBatchNo; this.quarterTemItems.push(item) }) } this.$message.success('æåæå') this.$refs.finishedproducttransferTable.clearSelection() } else { this.$message.warning('è¯·éæ©æ°æ®') } }, // è·åæ°æ®å表 getIfsStock() { this.tableLoading = true this.stockList = [] const newReqParam = this.getFinalParam() getIfsStock(newReqParam) .then((response) => { const resData = response.data this.queryReport.total = resData.total const resStockList = resData.data resStockList.forEach((item) => { this.stockList.push({ partNo: item.PART_NO, partName: item.PART_DESC, warehouseName: item.WAREHOUSE_ID, locationName: item.LOCATION_DESC, locationNo: item.LOCATION_NO, partBatchNo: item.LOT_BATCH_NO, stockQuantity: item.QTY_ONHAND, availableStockQuantity: item.QTY_AVAILABLE, outerColor: item.ATTR4, customerOrderNo: item.ATTR6, inSource: item.ATTR23, }) }) this.tableLoading = false }) .catch(() => { this.tableLoading = false }) }, getFinalParam() { const newReqParam = { partNo: this.queryParamOne.partNo, partDescription: this.queryParamOne.partName, warehouse: this.queryParamOne.warehouseName ? this.queryParamOne.warehouseName + '%' : null, locDesc: this.queryParamOne.locationName, locNo: this.queryParamOne.locationNo, lotBatchNo: this.queryParamOne.partBatchNo, quantityFlag: this.queryParamOne.stockQuantity, outerColor: this.queryParamOne.outerColor, otcOrderNo: this.queryParamOne.customerOrderNo, availableStockQuantity: this.queryParamOne.availableStockQuantity, inSource: this.queryParamOne.inSource, page: this.queryReport.current, limit: this.queryReport.size } return newReqParam }, lineSideWarehouseTableHeaderCellStyle({row, column, rowIndex, columnIndex}) { let headerStyle = 'background:#FAFAFA;color:#666;' if (columnIndex === 0) { headerStyle += 'border-radius: 6px 0px 0px 0px;' } else if (columnIndex === 13) { headerStyle += 'border-radius: 0px 6px 0px 0px;' } return headerStyle }, lineSideWarehouseTableRowClassName({ row, rowIndex }) { if (rowIndex % 2 === 1) { return 'stripe-row' } else { return '' } }, handleSizeChangeReport(val) { this.queryReport.size = val this.queryReport.current = 1 this.getIfsStock() }, handleCurrentChangeReport(val) { this.queryReport.current = val this.getIfsStock() }, handleStockList() { this.queryReport.current = 1 this.getIfsStock() }, handleSelectionChange(val) { this.multipleSelection = val } } } </script> <style scoped> >>>.el-table__header { height: 70px; } .card { height: calc(100% - 40px); background: #ffffff; padding: 10px; } .title { text-align: right; margin-bottom: 10px; } </style>