cz 1 rok temu
rodzic
commit
9c7f80b6b9

+ 488 - 0
src/views/JXSK/production/receive/index copy.vue

@@ -0,0 +1,488 @@
+<template>
+  <div class="tenant">
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{}"
+        :action-list="[]"
+        @get-list="getList"
+      >
+      </byTable>
+    </div>
+    <el-dialog
+      :title="'任务接收'"
+      v-model="dialogVisible"
+      width="700"
+      v-loading="loading"
+      destroy-on-close
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #productRemark>
+          <div style="width: 100%">
+            {{ formData.data.productRemark }}
+          </div>
+        </template>
+        <template #file>
+          <div style="width: 100%">
+            <el-upload
+              v-model:fileList="formData.data.fileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="uploadData"
+              multiple
+              :before-upload="uploadFile"
+              :on-preview="onPreviewFile"
+            >
+              <el-button>选择</el-button>
+            </el-upload>
+          </div>
+        </template>
+        <template #fileTwo>
+          <div
+            style="width: 100%"
+            v-if="
+              formData.data.fileListTwo && formData.data.fileListTwo.length > 0
+            "
+          >
+            <span
+              v-for="item in formData.data.fileListTwo"
+              :key="item.id"
+              @click="onPreviewFile(item)"
+              style="margin-right: 10px; cursor: pointer; color: #409eff"
+            >
+              {{ item.name }}
+            </span>
+          </div>
+          <div v-else>无</div>
+        </template>
+        <template #fileThree>
+          <div
+            style="width: 100%"
+            v-if="
+              formData.data.fileListThree &&
+              formData.data.fileListThree.length > 0
+            "
+          >
+            <span
+              v-for="item in formData.data.fileListThree"
+              :key="item.id"
+              @click="onPreviewFile(item)"
+              style="margin-right: 10px; cursor: pointer; color: #409eff"
+            >
+              {{ item.name }}
+            </span>
+          </div>
+          <div v-else>无</div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm(true)"
+          size="large"
+          :loading="submitLoading"
+        >
+          确认接收
+        </el-button>
+        <!-- <el-button
+          type="danger"
+          @click="submitForm()"
+          size="large"
+          :loading="submitLoading"
+          v-if="otherBtn"
+        >
+          退回前道工序
+        </el-button> -->
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+const { proxy } = getCurrentInstance();
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+  },
+});
+const dialogVisible = ref(false);
+const modalType = ref("add");
+const rules = ref({
+  workOrderId: [{ required: true, message: "请选择工单", trigger: "change" }],
+  startDate: [
+    { required: true, message: "请选择计划开始时间", trigger: "change" },
+  ],
+  stopDate: [
+    { required: true, message: "请选择计划结束时间", trigger: "change" },
+  ],
+  quantity: [{ required: true, message: "请输入计划数量", trigger: "blur" }],
+});
+const workOrderData = ref([]);
+const workOrderDataOne = ref([]);
+
+const statusData = ref([
+  {
+    label: "未开始",
+    value: "0",
+  },
+  {
+    label: "进行中",
+    value: "1",
+  },
+  {
+    label: "完成",
+    value: "2",
+  },
+]);
+
+const selectConfig = reactive([]);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "产品名称",
+        prop: "productName",
+      },
+    },
+    {
+      attrs: {
+        label: "规格型号",
+        prop: "productSpec",
+      },
+    },
+    {
+      attrs: {
+        label: "产品SN",
+        prop: "productSn",
+      },
+    },
+
+    {
+      attrs: {
+        label: "当前工序",
+        prop: "productionProcessesName",
+      },
+    },
+    {
+      attrs: {
+        label: "前道工序",
+        prop: "previousProcessesName",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "80",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "查看",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const formData = reactive({
+  data: {},
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      itemType: "text",
+      prop: "productName",
+      label: "产品名称",
+      disabled: true,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "text",
+      prop: "productSpec",
+      label: "规格型号",
+      disabled: true,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "text",
+      prop: "productSn",
+      label: "产品SN",
+      disabled: true,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "slot",
+      slotName: "productRemark",
+      label: "产品备注",
+      disabled: true,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "text",
+      prop: "productionProcessesName",
+      label: "当前工序",
+      disabled: true,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "slot",
+      slotName: "fileTwo",
+      label: "生产工序资料",
+    },
+    {
+      type: "slot",
+      slotName: "fileThree",
+      label: "工单附件",
+    },
+    {
+      type: "slot",
+      slotName: "file",
+      label: "完工拍摄",
+    },
+    {
+      type: "input",
+      itemType: "text",
+      prop: "previousProcessesName",
+      label: "前道工序",
+      disabled: true,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "input",
+      itemType: "text",
+      prop: "circulationUserName",
+      label: "流转人",
+      disabled: true,
+      style: {
+        width: "50%",
+      },
+    },
+  ];
+});
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/productionTaskDetail/receivePage", sourceList.value.pagination)
+    .then((message) => {
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+const submitApi = () => {
+  proxy.post("/productionTaskDetail/receive", { id: formData.data.id }).then(
+    (res) => {
+      ElMessage({
+        message: "操作成功",
+        type: "success",
+      });
+      dialogVisible.value = false;
+      submitLoading.value = false;
+      getList();
+    },
+    (err) => {
+      submitLoading.value = false;
+      return ElMessage({
+        message: err.message,
+        type: "info",
+      });
+    }
+  );
+};
+const submitForm = (flag) => {
+  if (flag) {
+    proxy
+      .post("/productionTaskDetail/haveTaskCount", {
+        productionProcessesId: formData.data.productionProcessesId,
+      })
+      .then((res) => {
+        if (res && Number(res) > 0) {
+          ElMessageBox.confirm(
+            `你当前还有进行中的任务尚未提交,确认接收新任务吗?`,
+            "提示",
+            {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning",
+            }
+          ).then(() => {
+            ElMessageBox.confirm(
+              `你当前还有进行中的任务尚未提交,确认接收新任务吗?`,
+              "提示",
+              {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }
+            ).then(() => {
+              submitApi();
+            });
+          });
+        } else {
+          submitApi();
+        }
+      });
+  } else {
+    proxy
+      .post("/productionTaskDetail/rejection", { id: formData.data.id })
+      .then(
+        (res) => {
+          ElMessage({
+            message: "退回成功",
+            type: "success",
+          });
+          dialogVisible.value = false;
+          submitLoading.value = false;
+          getList();
+        },
+        (err) => {
+          submitLoading.value = false;
+          return ElMessage({
+            message: err.message,
+            type: "info",
+          });
+        }
+      );
+  }
+};
+const submitType = ref("");
+const otherBtn = ref(true);
+const getDtl = (row) => {
+  if (!row.previousProcessesId || row.previousProcessesId == -1) {
+    otherBtn.value = false;
+  } else {
+    otherBtn.value = true;
+  }
+  formOption.disabled = true;
+  formData.data = { ...row };
+  proxy.post("/productionTaskDetail/detail", { id: row.id }).then((res) => {
+    if (
+      res.productionTaskDetailRecordList &&
+      res.productionTaskDetailRecordList.length > 0
+    ) {
+      let id = res.previousProcessesRecordId;
+      proxy.post("/fileInfo/getList", { businessIdList: [id] }).then((res) => {
+        if (res[id] && res[id].length > 0) {
+          formData.data.fileList = res[id].map((item) => {
+            return {
+              raw: item,
+              name: item.fileName,
+              url: item.fileUrl,
+            };
+          });
+        }
+      });
+    }
+    proxy
+      .post("/fileInfo/getList", {
+        businessIdList: [res.productionProcessesId],
+      })
+      .then((resOne) => {
+        if (
+          resOne[res.productionProcessesId] &&
+          resOne[res.productionProcessesId].length > 0
+        ) {
+          formData.data.fileListTwo = resOne[res.productionProcessesId].map(
+            (item) => {
+              return {
+                raw: item,
+                name: item.fileName,
+                url: item.fileUrl,
+              };
+            }
+          );
+        }
+      });
+
+    proxy
+      .post("/fileInfo/getList", {
+        businessIdList: [res.workOrderId],
+        fileType: 1,
+      })
+      .then((resOne) => {
+        if (resOne[res.workOrderId] && resOne[res.workOrderId].length > 0) {
+          formData.data.fileListThree = resOne[res.workOrderId].map((item) => {
+            return {
+              raw: item,
+              name: item.fileName,
+              url: item.fileUrl,
+            };
+          });
+        }
+      });
+  });
+
+  dialogVisible.value = true;
+};
+
+getList();
+
+const onPreviewFile = (file) => {
+  window.open(file.raw.fileUrl, "_blank");
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

+ 67 - 63
src/views/JXSK/production/receive/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="tenant">
     <div class="content">
-      <byTable
+      <!-- <byTable
         :source="sourceList.data"
         :pagination="sourceList.pagination"
         :config="config"
@@ -12,22 +12,41 @@
         :action-list="[]"
         @get-list="getList"
       >
-      </byTable>
+      </byTable> -->
+      <div style="display:flex;flex-wrap:wrap;justify-content:space-between;padding:0 30px">
+        <el-card class="box-card" v-for="item in sourceList.data" :key="item.id" style="width:31%;margin-top:20px;">
+          <div style="display:flex;flex-wrap:wrap;justify-content:space-between;padding-left: 10px;align-items:center">
+            <div style="flex:1">
+              <div>
+                产品名称:{{item.productName}}
+              </div>
+              <div>
+                规格型号:{{item.productSpec}}
+              </div>
+              <div>
+                &nbsp;&nbsp;产品SN:{{item.productSn}}
+              </div>
+              <div>
+                当前工序:{{item.productionProcessesName}}
+              </div>
+              <div>
+                前道工序:{{item.previousProcessesName}}
+              </div>
+              <div>
+                完成期限:<span style="color:rgb(4, 203, 4)">{{item.dueDate}}</span>
+              </div>
+            </div>
+            <div style="width:60px">
+              <el-button type="primary" style="float:right" text @click="getDtl(item)">查看 </el-button>
+            </div>
+          </div>
+
+        </el-card>
+      </div>
+
     </div>
-    <el-dialog
-      :title="'任务接收'"
-      v-model="dialogVisible"
-      width="700"
-      v-loading="loading"
-      destroy-on-close
-    >
-      <byForm
-        :formConfig="formConfig"
-        :formOption="formOption"
-        v-model="formData.data"
-        :rules="rules"
-        ref="byform"
-      >
+    <el-dialog :title="'任务接收'" v-model="dialogVisible" width="700" v-loading="loading" destroy-on-close>
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
         <template #productRemark>
           <div style="width: 100%">
             {{ formData.data.productRemark }}
@@ -35,50 +54,30 @@
         </template>
         <template #file>
           <div style="width: 100%">
-            <el-upload
-              v-model:fileList="formData.data.fileList"
-              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
-              :data="uploadData"
-              multiple
-              :before-upload="uploadFile"
-              :on-preview="onPreviewFile"
-            >
+            <el-upload v-model:fileList="formData.data.fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData"
+                       multiple :before-upload="uploadFile" :on-preview="onPreviewFile">
               <el-button>选择</el-button>
             </el-upload>
           </div>
         </template>
         <template #fileTwo>
-          <div
-            style="width: 100%"
-            v-if="
+          <div style="width: 100%" v-if="
               formData.data.fileListTwo && formData.data.fileListTwo.length > 0
-            "
-          >
-            <span
-              v-for="item in formData.data.fileListTwo"
-              :key="item.id"
-              @click="onPreviewFile(item)"
-              style="margin-right: 10px; cursor: pointer; color: #409eff"
-            >
+            ">
+            <span v-for="item in formData.data.fileListTwo" :key="item.id" @click="onPreviewFile(item)"
+                  style="margin-right: 10px; cursor: pointer; color: #409eff">
               {{ item.name }}
             </span>
           </div>
           <div v-else>无</div>
         </template>
         <template #fileThree>
-          <div
-            style="width: 100%"
-            v-if="
+          <div style="width: 100%" v-if="
               formData.data.fileListThree &&
               formData.data.fileListThree.length > 0
-            "
-          >
-            <span
-              v-for="item in formData.data.fileListThree"
-              :key="item.id"
-              @click="onPreviewFile(item)"
-              style="margin-right: 10px; cursor: pointer; color: #409eff"
-            >
+            ">
+            <span v-for="item in formData.data.fileListThree" :key="item.id" @click="onPreviewFile(item)"
+                  style="margin-right: 10px; cursor: pointer; color: #409eff">
               {{ item.name }}
             </span>
           </div>
@@ -87,12 +86,7 @@
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button
-          type="primary"
-          @click="submitForm(true)"
-          size="large"
-          :loading="submitLoading"
-        >
+        <el-button type="primary" @click="submitForm(true)" size="large" :loading="submitLoading">
           确认接收
         </el-button>
         <!-- <el-button
@@ -121,7 +115,7 @@ const sourceList = ref({
   pagination: {
     total: 3,
     pageNum: 1,
-    pageSize: 10,
+    pageSize: 10000,
     keyword: "",
   },
 });
@@ -276,6 +270,26 @@ const formConfig = computed(() => {
       },
     },
     {
+      type: "input",
+      itemType: "text",
+      prop: "previousProcessesName",
+      label: "前道工序",
+      disabled: true,
+      style: {
+        width: "50%",
+      },
+    },
+    {
+      type: "date",
+      itemType: "date",
+      prop: "dueDate",
+      label: "完成期限",
+      disabled: true,
+      style: {
+        width: "50%",
+      },
+    },
+    {
       type: "slot",
       slotName: "fileTwo",
       label: "生产工序资料",
@@ -293,16 +307,6 @@ const formConfig = computed(() => {
     {
       type: "input",
       itemType: "text",
-      prop: "previousProcessesName",
-      label: "前道工序",
-      disabled: true,
-      style: {
-        width: "50%",
-      },
-    },
-    {
-      type: "input",
-      itemType: "text",
       prop: "circulationUserName",
       label: "流转人",
       disabled: true,

+ 3 - 0
src/views/JXSK/salesMange/contract/index.vue

@@ -56,6 +56,9 @@
                   <div>
                     {{ circle.productName }}({{circle.productSpec}})
                   </div>
+                  <div>
+                    总数量: {{ circle.productionQuantity }} <span style="margin-left:10px">已完成:{{ circle.completedQuantity }}</span>
+                  </div>
                 </template>
               </el-tooltip>
             </div>