|
@@ -69,12 +69,22 @@
|
|
|
style="width: 220px"
|
|
|
@change="handleChangeStatus"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="dict in daywork_status"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- ></el-option>
|
|
|
+ <template v-if="form.status < 4">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in daywork_status_first"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ ></el-option>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-option
|
|
|
+ v-for="dict in daywork_status_second"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ ></el-option>
|
|
|
+ </template>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -91,7 +101,7 @@
|
|
|
type="datetime"
|
|
|
value-format="YYYY-MM-DD HH:mm:ss "
|
|
|
:editable="false"
|
|
|
- :clearable = "false"
|
|
|
+ :clearable="false"
|
|
|
placeholder="请选择结束时间"
|
|
|
@change="handleTotalTime"
|
|
|
/>
|
|
@@ -235,6 +245,8 @@ const { proxy } = getCurrentInstance();
|
|
|
const emit = defineEmits(["handleSaveSuccess"]);
|
|
|
/** 字典 */
|
|
|
const { daywork_status } = proxy.useDict("daywork_status");
|
|
|
+const { daywork_status_first } = proxy.useDict("daywork_status_first");
|
|
|
+const { daywork_status_second } = proxy.useDict("daywork_status_second");
|
|
|
const { waste_causes } = proxy.useDict("waste_causes");
|
|
|
const queryParams = ref({
|
|
|
pageNum: 1,
|
|
@@ -246,7 +258,7 @@ const processList = ref([]);
|
|
|
const visible = ref(false);
|
|
|
const editStatus = ref(true);
|
|
|
const rejectAmount = ref(0);
|
|
|
-const workingHoursTime =ref('')
|
|
|
+const workingHoursTime = ref("");
|
|
|
const detailsRow = {
|
|
|
id: null,
|
|
|
rejectNum: "",
|
|
@@ -312,9 +324,7 @@ const data = reactive({
|
|
|
{ required: true, message: "开始日期不能为空", trigger: "blur" },
|
|
|
],
|
|
|
endTime: [{ validator: validateEndTime, trigger: "blur" }],
|
|
|
- workingHoursTime: [
|
|
|
- { validator: validateWorkingHours, trigger: "change" },
|
|
|
- ],
|
|
|
+ workingHoursTime: [{ validator: validateWorkingHours, trigger: "change" }],
|
|
|
qualifiedNum: [
|
|
|
{ required: true, message: "合格数量不能为空", trigger: "blur" },
|
|
|
{ validator: validateQualifiedNum, trigger: "blur" },
|
|
@@ -330,7 +340,7 @@ const open = (row) => {
|
|
|
reset();
|
|
|
loading.value = true;
|
|
|
if (row.id) {
|
|
|
- console.log(row)
|
|
|
+ console.log(row);
|
|
|
editStatus.value = true;
|
|
|
detailInfo.value = proxy.deepClone(row);
|
|
|
form.value.id = row.id;
|
|
@@ -340,7 +350,7 @@ const open = (row) => {
|
|
|
form.value.nickName = row.nickName;
|
|
|
form.value.status = row.status;
|
|
|
form.value.qualifiedNum = row.qualifiedNum;
|
|
|
- form.value.workHoursTimestamp = 0
|
|
|
+ form.value.workHoursTimestamp = 0;
|
|
|
form.value.prodNum = row.prodNum;
|
|
|
getProcessList({ technologicalProcessId: row.technologicalProcessId }).then(
|
|
|
(res) => {
|
|
@@ -352,7 +362,7 @@ const open = (row) => {
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
- getDayworkItemRejectList({dayworkItemId: detailInfo.value.id }).then(
|
|
|
+ getDayworkItemRejectList({ dayworkItemId: detailInfo.value.id }).then(
|
|
|
(response) => {
|
|
|
if (response.code == 200) {
|
|
|
for (let i = 0; i < response.data.length; i++) {
|
|
@@ -408,11 +418,14 @@ const handleSave = () => {
|
|
|
var flag = true;
|
|
|
//判断工序是否是尾序
|
|
|
var lastProcess = false;
|
|
|
- if(form.value.processId == processList.value[processList.value.length - 1].value){
|
|
|
+ if (
|
|
|
+ form.value.processId ==
|
|
|
+ processList.value[processList.value.length - 1].value
|
|
|
+ ) {
|
|
|
lastProcess = true;
|
|
|
}
|
|
|
- if(lastProcess) {
|
|
|
- if(form.value.status > 3) {
|
|
|
+ if (lastProcess) {
|
|
|
+ if (form.value.status > 3) {
|
|
|
flag = false;
|
|
|
proxy.$modal.msgError("尾序不能选择该状态");
|
|
|
}
|
|
@@ -461,16 +474,16 @@ const handleSave = () => {
|
|
|
if (parseInt(form.value.prodNum) - rejectAmount.value < 0) {
|
|
|
proxy.$modal.msgError("废品总数加合格数不能超过投产数");
|
|
|
form.value.qualifiedNum = 0;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
//workinghours
|
|
|
if (form.value.status == 0 || form.value.status == 1) {
|
|
|
form.value.workHoursTimestamp = 0;
|
|
|
}
|
|
|
- form.value.workingHours = form.value.workHoursTimestamp
|
|
|
+ form.value.workingHours = form.value.workHoursTimestamp;
|
|
|
if (flag) {
|
|
|
- console.log(form.value)
|
|
|
+ console.log(form.value);
|
|
|
updateDayworkItemInfo(form.value).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
proxy.$modal.msgSuccess("保存成功!");
|