Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override
| | |
| | | reportFormDate:ref(["",""]), |
| | | workOrderDate:ref(["",""]), |
| | | reportingWorkDate:ref(["",""]), |
| | | qualityInspectionDate:ref(["",""]), |
| | | searchOrderListFilter:ref([]),//订单首页筛选] |
| | | searchOrderFilter:{ |
| | | list:ref([]), |
| | |
| | | import { useI18n } from 'vue-i18n' |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import footSum from "@/hook/footSum" |
| | | import useOrderInfoStore from "@/stores/sd/order/orderInfo"; |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | let router=useRouter() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const orderInfo = useOrderInfoStore() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | |
| | | } |
| | | |
| | | //第一次加载数据 |
| | | request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${orderInfo.qualityInspectionDate}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | orderInfo.qualityInspectionDate = res.data.selectDate |
| | | pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | |
| | | const selectPageList = ()=>{ |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`,filterData.value).then((res) => { |
| | | request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${orderInfo.qualityInspectionDate}/${state}/${inputVal}`,filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | |
| | | orderInfo.qualityInspectionDate = res.data.selectDate |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | }else{ |
| | |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${orderInfo.qualityInspectionDate}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | orderInfo.qualityInspectionDate = res.data.selectDate |
| | | pageTotal.value = res.data.total |
| | | produceList = deepClone(res.data.data) |
| | | produceList.forEach(item => { |
| | |
| | | inputVal = null |
| | | } |
| | | |
| | | request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${orderInfo.qualityInspectionDate}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal=parseInt(res.data.total) |
| | | orderInfo.qualityInspectionDate = res.data.selectDate |
| | | pageNum.value=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | |
| | | <div style="width: 100%;height: 100%"> |
| | | <div class="head"> |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | v-model="orderInfo.qualityInspectionDate" |
| | | type="daterange" |
| | | format="YYYY/MM/DD" |
| | | value-format="YYYY-MM-DD" |
| | |
| | | type: '', |
| | | consume: '', |
| | | price: '', |
| | | unit:'', |
| | | }) |
| | | |
| | | const validatePass = (rule, value, callback) => { |
| | |
| | | case 'edit' :{ |
| | | ruleForm.MaterialId=row.id |
| | | ruleForm.MaterialName=row.name |
| | | ruleForm.unit=row.unit |
| | | dialogTableVisible.value = true |
| | | return |
| | | } |
| | |
| | | let orderBomData =ref({ |
| | | productName:[] |
| | | }) |
| | | let bomSum = ref({ |
| | | sumData:[], |
| | | sumDatilsData:[] |
| | | }) |
| | | |
| | | let orderBomDetails = ref(null) |
| | | |
| | |
| | | request.post(`/BomData/getOrderBomData/${row.orderId}`,).then((res) => { |
| | | if (res.code == 200 ) { |
| | | orderBomData.value.productName =res.data.data |
| | | // orderBomData.value.productName = orderBomData.value.productName.map(item => { |
| | | // const parts = item.product_name.split(/[*+]/) |
| | | // parts.push("其它") |
| | | // return { |
| | | // ...item, |
| | | // product_parts: parts |
| | | // } |
| | | // }) |
| | | |
| | | bomSum.value.sumData = res.data.sumData |
| | | bomSum.value.sumDatilsData =res.data.sumDataDatils |
| | | request.post(`/BomData/getBomDataProduct`,orderBomData.value).then((res) => { |
| | | if (res.code == 200 ) { |
| | | orderBomDetails.value=res.data.data |
| | |
| | | dialogTableVisible.value = true |
| | | } |
| | | }) |
| | | console.log(orderBomData.value.productName) |
| | | } |
| | | }) |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //总价 |
| | | const totalPrice = computed(() => { |
| | | return bomSum.value.sumDatilsData.reduce((sum, d) => sum + d.materialPrice, 0) |
| | | }) |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | :close-on-click-modal="false" |
| | | :close-on-press-escape="false" |
| | | > |
| | | <el-card style="max-width: 480px;margin-left: 45px"> |
| | | <el-card style="max-width: 480px;margin-left: 45px;margin-top: 20px"> |
| | | <!-- header --> |
| | | <template #header> |
| | | <div class="card-header"> |
| | | <span style="font-weight: bold">成品合计</span> |
| | |       |
| | | <span>面积:1312.48㎡</span> |
| | |       |
| | | <span>数量:200</span> |
| | |       |
| | | <span>周长:5325.7m</span> |
| | | |
| | | <span>面积:{{ bomSum.sumData[0].area }}㎡</span> |
| | | |
| | | <span>数量:{{ bomSum.sumData[0].quantity }}</span> |
| | | |
| | | <span>周长:{{ bomSum.sumData[0].perimeter }}m</span> |
| | | </div> |
| | | </template> |
| | | <el-row > |
| | | <el-col :span="8">6mm超白:</el-col> |
| | | <el-col :span="8">3149.72㎡</el-col> |
| | | |
| | | <!-- body --> |
| | | <el-row |
| | | v-for="(mat, idx) in bomSum.sumDatilsData" |
| | | :key="idx" |
| | | style="text-align: left; margin-bottom: 6px" |
| | | > |
| | | <el-col :span="8">{{ mat.material }}:</el-col> |
| | | <el-col :span="8">{{ mat.consume }}㎡</el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="8">8mm超白:</el-col> |
| | | <el-col :span="8">787.72㎡</el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="8">铝框:</el-col> |
| | | <el-col :span="8">2662.85m</el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="8">0.76PVB:</el-col> |
| | | <el-col :span="8">1706.22㎡</el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="8">其他:</el-col> |
| | | <el-col :span="8">5</el-col> |
| | | </el-row> |
| | | <template #footer>合计xxx元</template> |
| | | |
| | | <!-- footer --> |
| | | <template #footer> |
| | | 合计 ¥{{ totalPrice }} |
| | | </template> |
| | | </el-card> |
| | | |
| | | <el-card |
| | |
| | | </template> |
| | | |
| | | <!-- body --> |
| | | <el-row v-for="(part, index) in item.product_parts" :key="index" style="text-align: left"> |
| | | <el-col :span="8">{{ part.name }}:</el-col> |
| | | <el-col :span="16"> |
| | | <div v-for="(d, j) in part.details" :key="j"> |
| | | {{ d.material }} ¥{{ d.materialPric}} |
| | | </div> |
| | | <hr> |
| | | <el-row |
| | | v-for="(part, index) in item.product_parts" |
| | | :key="index" |
| | | style="text-align: left; margin-bottom: 6px" |
| | | > |
| | | <el-col :span="24"> |
| | | |
| | | <el-row v-for="(d, j) in part.details" |
| | | :key="j" |
| | | style="text-align: left"> |
| | | <el-col :span="8">{{ d.material }}</el-col> |
| | | <el-col :span="8">{{ d.consume }}{{d.unit}}</el-col> |
| | | </el-row> |
| | | <!-- <hr v-if="part.details.length > 0" />--> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | |
| | | |
| | | @ApiOperation("质检审核查询接口") |
| | | @SaCheckPermission("qualityInspectionReview.search") |
| | | @PostMapping ("/selectQualityTesting/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}/{state}/{processId}") |
| | | @PostMapping ("/selectQualityTesting/{pageNum}/{pageSize}/{selectDate}/{state}/{processId}") |
| | | public Result selectQualityTesting( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable List<String> selectDate, |
| | | @PathVariable Integer state, |
| | | @PathVariable String processId, |
| | | @RequestBody ReportingWork reportingWork){ |
| | | return Result.seccess(reportingWorkService.selectQualityTestingSv(pageNum,pageSize,selectTime1,selectTime2,state,processId,reportingWork)); |
| | | return Result.seccess(reportingWorkService.selectQualityTestingSv(pageNum,pageSize,selectDate,state,processId,reportingWork)); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | List<ReportingWork> selectReportingWorkMp(Integer offset, Integer pageSize, String selectTime1, String selectTime2, String orderId, ReportingWork reportingWork); |
| | | |
| | | List<ReportingWork> selectQualityTestingMp(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, Integer state, String processId, ReportingWork reportingWork); |
| | | List<ReportingWork> selectQualityTestingMp(Integer offset, Integer pageSize, String selectTime1, String selectTime2, Integer state, String processId, ReportingWork reportingWork); |
| | | |
| | | Map<String, Integer> getQualityPageTotal(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, Integer state, String processId, ReportingWork reportingWork); |
| | | Map<String, Integer> getQualityPageTotal(Integer offset, Integer pageSize, String selectTime1, String selectTime2, Integer state, String processId, ReportingWork reportingWork); |
| | | |
| | | Boolean updateQualityStatusMp(String reportingWorkId,String username); |
| | | |
| | |
| | | public interface BomDataMapper extends BaseMapper<BasicData> { |
| | | |
| | | |
| | | Boolean saveMaterialBomDataMp(Integer id, String name, Object consume, Object price, Integer type); |
| | | Boolean saveMaterialBomDataMp(Integer id, String name, Object consume, Object price, Integer type, String unit); |
| | | |
| | | Integer getMaterialId(Integer id); |
| | | |
| | | Boolean updateMaterialBomDataMp(Integer id, String name, Object consume, Object price, Integer type); |
| | | Boolean updateMaterialBomDataMp(Integer id, String name, Object consume, Object price, Integer type, String unit); |
| | | |
| | | Boolean saveProductBOMMp(Object produceId, Object tabId, Object layer); |
| | | |
| | | List<Map<String, String>> getOrderBomDataMp(String orderId); |
| | | |
| | | List<Map<String, String>> getBOMDetails(Integer productId); |
| | | |
| | | List<Map<String, String>> getOrderBomSumDataMp(String orderId); |
| | | |
| | | List<Map<String, String>> getOrderBomsumDataDatilsMp(String orderId); |
| | | } |
| | |
| | | } |
| | | |
| | | //查询质检审核 |
| | | public Map<String, Object> selectQualityTestingSv(Integer pageNum, Integer pageSize, java.sql.Date selectTime1, java.sql.Date selectTime2, Integer state, String processId, ReportingWork reportingWork) { |
| | | public Map<String, Object> selectQualityTestingSv(Integer pageNum, Integer pageSize, List<String> selectDate, Integer state, String processId, ReportingWork reportingWork) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | if ("null".equals(processId)) { |
| | | processId = ""; |
| | | } |
| | | String endDate = LocalDate.now().toString(); |
| | | String startDate = LocalDate.now().minusDays(3).toString(); |
| | | if(selectDate !=null && selectDate.size()==2){ |
| | | if(!selectDate.get(0).isEmpty()){ |
| | | startDate = selectDate.get(0); |
| | | } |
| | | if(!selectDate.get(1).isEmpty()){ |
| | | endDate = selectDate.get(1); |
| | | } |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportingWorkMapper.selectQualityTestingMp(offset, pageSize, selectTime1, selectTime2, state, processId, reportingWork)); |
| | | map.put("total", reportingWorkMapper.getQualityPageTotal(offset, pageSize, selectTime1, selectTime2, state, processId, reportingWork)); |
| | | |
| | | map.put("data", reportingWorkMapper.selectQualityTestingMp(offset, pageSize, startDate, endDate, state, processId, reportingWork)); |
| | | map.put("total", reportingWorkMapper.getQualityPageTotal(offset, pageSize, startDate, endDate, state, processId, reportingWork)); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(startDate); |
| | | list.add(endDate); |
| | | map.put("selectDate",list); |
| | | return map; |
| | | } |
| | | |
| | |
| | | Object consume = object.get("consume"); |
| | | Object price = object.get("price"); |
| | | Integer type = (Integer) object.get("type"); |
| | | |
| | | String unit=""; |
| | | if (type.equals(1)){ |
| | | unit = "㎡"; |
| | | } else if (type.equals(2)) { |
| | | unit = "m"; |
| | | } else if (type.equals(3)) { |
| | | unit = "片"; |
| | | } |
| | | if (id!=null){ |
| | | //查询物料编号是否已存在 |
| | | Integer countId = bomDataMapper.getMaterialId(id); |
| | | if (countId == 0){ |
| | | bomDataMapper.saveMaterialBomDataMp(id,name,consume,price,type); |
| | | bomDataMapper.saveMaterialBomDataMp(id,name,consume,price,type,unit); |
| | | }else { |
| | | bomDataMapper.updateMaterialBomDataMp(id,name,consume,price,type); |
| | | bomDataMapper.updateMaterialBomDataMp(id,name,consume,price,type,unit); |
| | | } |
| | | |
| | | return true; |
| | |
| | | public Map<String, Object> getOrderBomDataSv(String orderId) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", bomDataMapper.getOrderBomDataMp(orderId)); |
| | | map.put("sumData", bomDataMapper.getOrderBomSumDataMp(orderId)); |
| | | map.put("sumDataDatils", bomDataMapper.getOrderBomsumDataDatilsMp(orderId)); |
| | | return map; |
| | | } |
| | | |
| | |
| | | |
| | | <insert id="saveMaterialBomDataMp"> |
| | | insert into sd.bom_base |
| | | (material_id, material, status, type, consume, price,create_time) |
| | | (material_id, material, status, type, consume, price,unit,create_time) |
| | | values |
| | | (#{id}, #{name}, 0, #{type}, #{consume},#{price}, now()) |
| | | (#{id}, #{name}, 0, #{type}, #{consume},#{price}, #{unit},now()) |
| | | </insert> |
| | | |
| | | <select id="getMaterialId"> |
| | |
| | | |
| | | <update id="updateMaterialBomDataMp"> |
| | | update sd.bom_base |
| | | set type=#{type},consume=#{consume},price=#{price},create_time=now() |
| | | set type=#{type},consume=#{consume},price=#{price},unit=#{unit},create_time=now() |
| | | where material_id = #{id} |
| | | </update> |
| | | |
| | |
| | | select *,(consume*price) as materialPric from sd.bom_product as bp left join sd.bom_base as bb on bb.id=bp.base_id |
| | | where bp.product_id = #{productId} ORDER BY product_layer |
| | | </select> |
| | | |
| | | <select id="getOrderBomSumDataMp"> |
| | | SELECT product_id,product_name,SUM(quantity) as quantity,SUM(gross_area) as area,SUM(perimeter) as perimeter |
| | | from sd.order_detail where order_id=#{orderId} |
| | | </select> |
| | | |
| | | <select id="getOrderBomsumDataDatilsMp"> |
| | | SELECT |
| | | od.order_id, |
| | | bp.product_id, |
| | | bb.material_id, |
| | | bb.material, |
| | | bb.`status`, |
| | | bb.type, |
| | | sum(bb.consume) as consume, |
| | | sum(bb.price) as price, |
| | | sum(bb.consume * bb.price) AS materialPrice |
| | | FROM |
| | | sd.bom_product AS bp |
| | | LEFT JOIN sd.bom_base AS bb ON bb.id = bp.base_id |
| | | LEFT JOIN ( |
| | | select order_id,product_id from sd.order_detail GROUP BY product_id |
| | | ) as od on od.product_id = bp.product_id |
| | | |
| | | WHERE od.order_id=#{orderId} |
| | | GROUP BY bb.material_id |
| | | ORDER BY bp.product_layer |
| | | </select> |
| | | </mapper> |