Parcourir la source

部分功能整改

cz il y a 1 an
Parent
commit
c28084a84f

+ 9 - 4
src/components/byForm/index.vue

@@ -33,6 +33,9 @@
               </el-select>
             </template>
           </el-input>
+          <div v-else-if="i.type == 'text'">
+            {{formData[i.prop]}}
+          </div>
           <el-select v-model="formData[i.prop]" :multiple="i.multiple || false" v-else-if="i.type == 'select'"
                      :placeholder="i.placeholder || $t('common.pleaseSelect')" @change="(e) => commonsEmit(e, i)"
                      :disabled="i.disabled ? i.disabled : false" :clearable="i.clearable ? i.clearable : false"
@@ -46,8 +49,10 @@
               value: i.propsTreeValue || 'id',
               label: i.propsTreeLabel || 'label',
               children: i.propsTreeChildren || 'children',
-            }" value-key="id" :placeholder="i.placeholder || $t('common.pleaseSelect')" :disabled="i.disabled ? i.disabled : false" check-strictly
-                          :style="i.style?i.style:{width:'100%'}" default-expand-all @change="(e) => commonsEmit(e, i)" />
+              disabled:i.propsTreeDisabled || 'disabled'
+            }" value-key="id" :normalizer="()=>i.disabledFn?i.disabledFn(node):''" :placeholder="i.placeholder || $t('common.pleaseSelect')"
+                          :disabled="i.disabled ? i.disabled : false" check-strictly :style="i.style?i.style:{width:'100%'}" default-expand-all
+                          @change="(e) => commonsEmit(e, i)" />
           <el-date-picker v-model="formData[i.prop]" :readonly="i.readonly ? i.readonly : false" v-else-if="i.type == 'date'" :type="i.itemType"
                           :placeholder="i.placeholder || $t('common.pleaseSelectTime')" @change="(e) => commonsEmit(e, i)"
                           :disabled="i.disabled ? i.disabled : false" :format="i.format ? i.format : dateFormatInit(i.itemType)"
@@ -116,7 +121,7 @@
                        :data="uploadData" :before-upload="(file)=>handleBeforeUploadOne(file,i.prop,i.imgProp)"
                        :on-success="()=>handleSuccessOne(i.imgProp)">
               <div v-loading="imgLoading">
-                <img v-if="formData[i.imgProp]" :src="formData[i.imgProp]" class="pic" />
+                <img v-if="formData[i.imgProp]" :src="formData[i.imgProp]" class="picOne" />
                 <el-icon v-else class="avatar-uploader-icon">
                   <Plus />
                 </el-icon>
@@ -461,7 +466,7 @@ loadInit();
   padding: 0px !important;
 } */
 
-.pic {
+.picOne {
   object-fit: contain;
   width: 80px;
   height: 80px;

+ 3 - 3
src/components/process/SF/Contract.vue

@@ -448,7 +448,7 @@ const judgeStatus = () => {
 };
 const formOption = reactive({
   inline: true,
-  labelWidth: 100,
+  labelWidth: 120,
   itemWidth: 100,
   disabled: false,
 });
@@ -502,7 +502,7 @@ const formConfig = computed(() => {
     {
       type: "treeSelect",
       prop: "companyId",
-      label: "归属公司",
+      label: "生产公司",
       data: treeData.value,
       propsTreeLabel: "deptName",
       propsTreeValue: "deptId",
@@ -752,7 +752,7 @@ const formConfig = computed(() => {
   ];
 });
 const rules = ref({
-  companyId: [{ required: true, message: "请选择归属公司", trigger: "change" }],
+  companyId: [{ required: true, message: "请选择生产公司", trigger: "change" }],
   contractType: [
     { required: true, message: "请选择合同类型", trigger: "change" },
   ],

+ 10 - 3
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -304,7 +304,7 @@ const selectConfig = computed(() => {
       data: status.value,
     },
     {
-      label: "归属公司",
+      label: "生产公司",
       prop: "companyId",
       data: companyData.value,
     },
@@ -385,7 +385,14 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "归属公司",
+        label: "生产公司",
+        prop: "companyName",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "销售部门",
         prop: "companyName",
         width: 120,
       },
@@ -1184,7 +1191,7 @@ const formSearchConfig = computed(() => {
     },
     {
       type: "select",
-      label: "归属公司",
+      label: "生产公司",
       prop: "companyId",
       itemWidth: 50,
       data: companyData.value,

+ 199 - 20
src/views/MES/productionOrder/index.vue

@@ -6,6 +6,11 @@
               
         ]" @get-list="getList">
 
+        <template #code="{ item }">
+          <div style="width: 100%" class="el-click" @click="lookDetails(item)">
+            {{item.code}}
+          </div>
+        </template>
         <template #prodTag="{ item }">
           <div style="width: 100%">
             <!-- <el-icon :size="16" style="cursor:pointer;margin-right: 5px;position:relative;top:5px" color="#409EFF" @click="handleEditTag(item)">
@@ -26,6 +31,7 @@
                   <div>产品编码:{{product.productCode}}</div>
                   <div>产品名称:{{product.productName}}</div>
                   <div>产品尺寸:{{product.productLength}}cm*{{product.productWidth}}cm*{{product.productHeight}}cm</div>
+                  <div>产品数量:{{product.quantity}}</div>
                 </div>
                 <template #reference>
                   <el-progress type="circle" :percentage="(Number(product.finishQuantity) / Number(product.quantity))*100" width="60"
@@ -65,13 +71,13 @@
       <div class="schedule-bottom">
         <el-calendar v-model="today" ref="calendar">
           <template #date-cell="{ data }">
-            <div style="text-align:center">
+            <div style="text-align:center;height: 100%;">
               <div>
                 {{ data.day.substr(8, 10) }}
               </div>
               <el-popover placement="left" :width="400" trigger="hover" @show="onShow(data.day)">
                 <template #reference>
-                  <div v-if="isShow(data.day)">
+                  <div v-if="isShow(data.day)" style="height: calc(100% - 20px);">
                     <div style="height:5px;margin-bottom:5px;border-radius:2px" v-for="(item,index) in judgeDay(data.day)" :key="index"
                          :style="{ background: colorData[item]}">
                     </div>
@@ -118,6 +124,89 @@
       </template>
     </el-dialog>
 
+    <el-dialog :title="'订单详情'" v-model="dialogVisible" width="90%" destroy-on-close>
+      <byForm :formConfig="formConfig" :formOption="formOptionOne" v-model="formData.orderData" ref="formDom">
+        <template #commodity>
+          <div style="width: 100%">
+            <el-table :data="formData.orderData.contractProductList" style="width: 100%; ">
+              <el-table-column type="expand" width="50" align="center">
+                <template #default="scope">
+                  <div style="padding-left:50px">
+                    <div style="margin-bottom:10px;">
+                      <TitleInfo content='BOM单:'></TitleInfo>
+                    </div>
+                    <el-table :data="scope.row.contractProductBomList" style="width: 100%;" border class="bom-table">
+                      <el-table-column label="图片" width="80">
+                        <template #default="{ row }">
+                          <div v-if="row.fileUrl">
+                            <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
+                          </div>
+                          <div v-else></div>
+                        </template>
+                      </el-table-column>
+                      <el-table-column prop="productCode" label="物料编码" width="190" />
+                      <el-table-column prop="productName" label="物料名称" min-width="200" />
+                      <el-table-column label="尺寸 (cm)" width="150">
+                        <template #default="{ row, $index }">
+                          <div style="width: 100%">
+                            {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                          </div>
+                        </template>
+                      </el-table-column>
+                      <el-table-column prop="quantity" label="数量" width="110" />
+                      <el-table-column prop="remark" label="备注" width="180" />
+                    </el-table>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="商品图片" width="80">
+                <template #default="{ row }">
+                  <div v-if="row.fileUrl">
+                    <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
+                  </div>
+                  <div v-else></div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="productCnName" label="商品名称" min-width="130" />
+              <el-table-column prop="productCode" label="商品编码" width="130" />
+              <el-table-column label="尺寸 cm*cm*cm" width="180">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="设计图稿" width="80">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-upload action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" accept=".gif, .jpeg, .jpg, .png" :show-file-list="false"
+                               :data="uploadData" :before-upload="(file)=>handleBeforeUpload(file,$index)" :on-success="()=>handleSuccess($index)">
+                      <div v-loading="row.imgLoading">
+                        <img v-if="row.imageUrl" :src="row.imageUrl" class="pic" />
+                        <!-- <el-icon v-else class="avatar-uploader-icon">
+                          <Plus />
+                        </el-icon> -->
+                      </div>
+                    </el-upload>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="生产源文件" width="140">
+                <template #default="{ row, $index }">
+                  <span class="el-click" v-if="row.prodFilePath" @click="handleClickUpload('prodFilePath',false,$index)">点击上传 (查看)</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="数量" width="150" prop="quantity" />
+              <el-table-column label="备注" min-width="200" prop="remark" />
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="defualt">取 消</el-button>
+      </template>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -200,7 +289,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "订单号",
-        prop: "code",
+        slot: "code",
         width: 150,
       },
     },
@@ -292,38 +381,45 @@ const config = computed(() => {
 });
 const formData = reactive({
   data: {},
+  orderData: {},
 });
+
 const formOption = reactive({
   inline: true,
   labelWidth: 100,
   itemWidth: 100,
 });
+
+const formOptionOne = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  disabled: true,
+});
+
 const formDom = ref(null);
 const formConfig = computed(() => {
   return [
     {
-      type: "input",
+      type: "title1",
+      title: "基本信息",
+    },
+    {
+      type: "text",
       prop: "code",
-      label: "店铺编号",
-      itemWidth: 100,
-      disabled: false,
+      label: "合同号:",
+      disabled: true,
+      isShow: formData.orderData.code ? true : false,
     },
     {
-      type: "input",
-      prop: "name",
-      label: "店铺名称",
-      itemWidth: 100,
-      disabled: false,
+      type: "title1",
+      title: "商品信息",
+      haveLine: true,
     },
     {
-      type: "treeSelect",
-      prop: "deptId",
-      label: "负责部门",
-      data: treeData.value,
-      propsTreeLabel: "deptName",
-      propsTreeValue: "deptId",
-      itemWidth: 100,
-      disabled: false,
+      type: "slot",
+      slotName: "commodity",
+      label: "",
     },
   ];
 });
@@ -564,6 +660,81 @@ const nextMonth = () => {
   selectDate("next-month");
   getRightData();
 };
+
+watch(
+  () => today.value,
+  (newValue) => {
+    if (month.value !== moment(newValue).format("yyyy年MM月")) {
+      month.value = moment(newValue).format("yyyy年MM月");
+      monthOne.value = moment(moment(month.value, "yyyy年MM月")).format(
+        "yyyy-MM"
+      );
+      getRightData();
+    }
+  }
+);
+
+const getFileData = () => {
+  let ids = [];
+  formData.orderData.contractProductList.map((x) => {
+    ids.push(x.productId);
+    x.contractProductBomList.map((y) => {
+      ids.push(y.materialId);
+    });
+  });
+  ids = Array.from(new Set(ids));
+  proxy
+    .post("/fileInfo/getList", {
+      businessIdList: ids,
+    })
+    .then((fileObj) => {
+      formData.orderData.contractProductList.map((x) => {
+        if (fileObj[x.productId] && fileObj[x.productId].length > 0) {
+          x.fileUrl = fileObj[x.productId][0].fileUrl;
+        }
+        x.contractProductBomList.map((y) => {
+          y.fileList = fileObj[y.materialId] || [];
+          if (y.fileList && y.fileList.length > 0) {
+            y.fileUrl = y.fileList[0].fileUrl;
+          }
+        });
+      });
+    });
+};
+
+const lookDetails = (item) => {
+  proxy.post("/contract/detail", { id: item.contractId }).then((res) => {
+    formData.orderData = res;
+    dialogVisible.value = true;
+    if (
+      formData.orderData.contractProductList &&
+      formData.orderData.contractProductList.length > 0
+    ) {
+      getFileData();
+    }
+  });
+};
+
+const handleClickUpload = async (att, flag, index) => {
+  let res = null;
+  let path = "";
+  if (flag) {
+    proxy.msgTip("请稍后", 2);
+    res = await proxy.post("/fileService/createTempFolder");
+    if (res && res.path) {
+      formData.data.contractProductList[index][att] = res.path;
+      path = res.path;
+    }
+  } else {
+    path = formData.data.contractProductList[index][att];
+  }
+  let a = document.createElement("a");
+  a.href = "printer://" + "ftp://192.168.1.13/" + path + "/";
+  a.style.display = "none";
+  document.body.appendChild(a);
+  a.click();
+  document.body.removeChild(a);
+};
 </script>
 
 <style lang="scss" scoped>
@@ -619,4 +790,12 @@ const nextMonth = () => {
   height: calc((100vh - 100px - 20px - 83px - 95px) / 5);
   overflow-y: hidden;
 }
+.el-icon.avatar-uploader-icon {
+  font-size: 20px;
+  color: #8c939d;
+  width: 50px;
+  height: 50px;
+  text-align: center;
+  border: 1px dashed var(--el-border-color);
+}
 </style>