新购流程修改

This commit is contained in:
hayu 2024-06-07 09:58:35 +08:00
parent c47cfa28d6
commit 75895eaa56
5 changed files with 156 additions and 136 deletions

View File

@ -29,6 +29,10 @@ public class PurchaseMacodeInfo extends BaseEntity
@ApiModelProperty(value = "任务ID")
private Long taskId;
/** 任务状态 */
@ApiModelProperty(value = "任务状态")
private String taskStatus;
/** 类型ID */
@ApiModelProperty(value = "类型ID")
private Long typeId;
@ -147,6 +151,14 @@ public class PurchaseMacodeInfo extends BaseEntity
@ApiModelProperty(value = "0,正常 1, 重复数据")
private int statusFlag;
public String getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus;
}
public Long getId() {
return id;
}

View File

@ -375,6 +375,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pmi.fix_code fixCode,
pcd.type_id typeId,
pcd.task_id taskId,
tt.task_status taskStatus,
mt.code specsCode,
mt1.code typeCode,
CASE
@ -393,6 +394,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
if(pmi.ma_code is not null, 1, pcd.check_num) checkNum
from purchase_check_details pcd
left join purchase_macode_info pmi on pmi.task_id = pcd.task_id and pmi.type_id = pcd.type_id
LEFT JOIN tm_task tt on tt.task_id=pcd.task_id
left join ma_machine mm on pmi.ma_code = mm.ma_code
left join ma_type mt on pcd.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id

View File

@ -364,6 +364,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pcd.task_id taskId,
mt.CODE specsCode,
mt1.CODE typeCode,
GROUP_CONCAT( mtk.user_id ) AS userIds,
CASE
WHEN pmi.ma_code IS NULL THEN
CASE
@ -384,6 +385,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_machine mm ON pmi.ma_code = mm.ma_code
LEFT JOIN ma_type mt ON pcd.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
LEFT JOIN ma_type_keeper mtk ON mtk.type_id = pcd.type_id
WHERE
pcd.task_id = #{taskId}
AND pcd.`status` != 3
@ -392,6 +394,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and (mt.type_name like concat('%',#{dictName},'%') or
mt1.type_name like concat('%',#{dictName},'%'))
</if>
GROUP BY
pcd.type_id
ORDER BY
STATUS,
pmi.id
@ -447,7 +451,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
WHERE
pcd.task_id = #{taskId}
AND pcd.`status` != 3
AND pcd.`status` != '3' and pcd.`status`!='7'
<if test="dictName != null and dictName != ''">
and (mt.type_name like concat('%',#{dictName},'%') or
mt1.type_name like concat('%',#{dictName},'%'))
@ -456,8 +460,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
STATUS
) aa
WHERE
`status` != 0
AND `status` !=2
`status` ='1'
</select>
<select id="selectPutinDetailsAddTypeId" resultType="com.bonus.sgzb.material.domain.PurchaseMacodeInfo">
select pcd.production_time productionTime,
@ -496,29 +499,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by status
</select>
<select id="isOperateAll" resultType="java.lang.Integer">
SELECT count(*)
FROM (SELECT CASE
WHEN
pmi.ma_code IS NOT NULL THEN
CASE
WHEN pmi.STATUS = 0 THEN
1
WHEN pmi.STATUS = 1 THEN
4
WHEN pmi.STATUS = 2 THEN
5
ELSE 1
END
ELSE pcd.STATUS
END AS STATUS
FROM purchase_check_details pcd
LEFT JOIN purchase_macode_info pmi ON pmi.task_id = pcd.task_id
AND pmi.type_id = pcd.type_id
LEFT JOIN ma_machine mm ON pmi.ma_code = mm.ma_code
WHERE pcd.task_id = #{taskId}) aa
WHERE (STATUS = 1 OR STATUS = 6)
SELECT
count(*)
FROM
purchase_check_details
WHERE
`status` = '6'
and task_id=#{taskId}
</select>
<select id="selectPurchaseCheckDetailsStatus" resultType="java.lang.Integer">
SELECT
@ -551,6 +538,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectKeepUser" resultType="java.lang.String">
SELECT user_id FROM ma_type_keeper WHERE type_id = #{typeId}
</select>
<select id="isOperateAllPurchaseMacodeInfo" resultType="java.lang.Integer">
SELECT
count(*)
FROM
purchase_macode_info
WHERE
task_id = #{taskId}
AND type_id = #{typeId}
AND `status` = '3'
</select>
<select id="selectPassAndNoPassNum" resultType="com.bonus.sgzb.material.domain.PurchaseCheckInfo">
SELECT
COUNT(pmi.id) as passNum,
COUNT(pmi2.id) as noPassNum
FROM
purchase_macode_info pmi
LEFT JOIN purchase_macode_info pmi2 on pmi.task_id=pmi2.task_id and pmi.type_id=pmi2.type_id and pmi2.`status`='2'
WHERE
pmi.task_id = #{taskId}
and pmi.type_id = #{typeId}
and pmi.`status`='1'
</select>
<select id="isOperateAllPass" resultType="java.lang.Integer">
SELECT
COUNT(*)
FROM
purchase_macode_info
WHERE
task_id = #{taskId}
AND `status` = '2'
</select>
<update id="updateTypeByTypeId">
update ma_type set num = #{num} where type_id = #{typeId}

View File

@ -245,19 +245,16 @@
@click="handleDialogQuery"
>查询</el-button
>
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> -->
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8" v-if="showHandle">
<el-row :gutter="10" class="mb8" v-if="showBatchButtons">
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled="multiple"
@click="passAll"
>批量通过</el-button
>
>通过</el-button>
</el-col>
<el-col :span="1.5">
<el-button
@ -265,20 +262,8 @@
plain
size="mini"
@click="refusedAll"
:disabled="multiple"
>批量不通过</el-button
>
>不通过</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:dict:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
</el-row>
<el-table
v-loading="loading"
@ -286,12 +271,12 @@
@selection-change="handleSelectionChange"
height="400"
>
<el-table-column
type="selection"
width="55"
align="center"
:selectable="selectable"
/>
<!-- <el-table-column-->
<!-- type="selection"-->
<!-- width="55"-->
<!-- align="center"-->
<!-- :selectable="selectable"-->
<!-- />-->
<el-table-column
label="序号"
align="center"
@ -346,37 +331,30 @@
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
v-if="showHandle"
width="150"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
v-if="scope.row.status == '0'"
@click="pass(scope.row)"
>通过</el-button
>
<el-button
size="mini"
type="text"
v-if="scope.row.status == '0'"
@click="refused(scope.row)"
>不通过</el-button
>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['system:dict:remove']"-->
<!-- >删除</el-button>-->
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- label="操作"-->
<!-- align="center"-->
<!-- class-name="small-padding fixed-width"-->
<!-- v-if="showHandle"-->
<!-- width="150"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- v-if="scope.row.status == '0'"-->
<!-- @click="pass(scope.row)"-->
<!-- >通过</el-button-->
<!-- >-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- v-if="scope.row.status == '0'"-->
<!-- @click="refused(scope.row)"-->
<!-- >不通过</el-button-->
<!-- >-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
@ -593,6 +571,7 @@ export default {
printData: {},
printTableData: [],
showHandle: true,
showBatchButtons: true,
//
dateRange: [],
//
@ -629,6 +608,12 @@ export default {
},
}
},
mounted() {
// taskStatus
this.$watch('detailTableList', () => {
this.showBatchButtons = this.detailTableList.some(item => item.taskStatus === '122');
}, { deep: true });
},
created() {
this.getList()
this.getTypeList()
@ -668,6 +653,7 @@ export default {
this.detailTableList = response.rows
this.dialogTotal = response.total
this.loading = false
this.ids = response.rows.map((item) => item)
})
},
@ -713,10 +699,12 @@ export default {
}
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item)
this.single = selection.length != 1
this.multiple = !selection.length
handleSelectionChange() {
console.log(this.ids)
this.ids = this.detailTableList.map((item) => item) // id
console.log(this.ids)
// this.single = selection.length != 1
// this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {

View File

@ -156,7 +156,7 @@
<template slot-scope="scope">
<el-tag
size="mini"
type="primary"
type="success"
v-if="scope.row.taskStatus == '28'"
>已全部入库</el-tag
>