فهرست منبع

0.2部分需求

cz 1 سال پیش
والد
کامیت
0487c1e076

+ 1 - 1
connect/E-mail/mail/index.vue

@@ -52,7 +52,7 @@ const handleChangeFloderId = (val) => {
 
 onMounted(() => {
   if (route.query.mail) {
-    leftDom.value.handleGoWrite(route.query.mail);
+    leftDom.value.handleGoWrite({ email: route.query.mail, personal: null });
   }
 });
 </script>

+ 190 - 12
src/components/process/SendPurchase.vue

@@ -132,7 +132,11 @@
           <el-table-column prop="amount" label="金额" />
           <el-table-column prop="zip" label="操作" width="100">
             <template #default="{ $index }">
-              <el-button type="primary" link @click="handleRemove($index)"
+              <el-button
+                type="primary"
+                link
+                @click="handleRemove($index, 20)"
+                :disabled="formData.data.purchaseDetailList.length === 1"
                 >删除</el-button
               >
             </template>
@@ -141,7 +145,91 @@
       </el-form-item>
       <el-row>
         <el-col :span="4">
-          <el-form-item label="采购金额" prop="amount">
+          <el-form-item label="商品金额小计" prop="productAmount">
+            <el-input
+              v-model="formData.data.productAmount"
+              placeholder="请输入"
+              disabled
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <div class="_t">其他收费项目</div>
+      <el-form-item>
+        <el-button type="primary" style="margin: 10px 0" @click="handleAdd">
+          添加
+        </el-button>
+        <el-table :data="formData.data.otherFeeList">
+          <el-table-column prop="name" label="收费项目" min-width="150">
+            <template #default="{ row, $index }">
+              <el-form-item
+                :prop="'otherFeeList.' + $index + '.name'"
+                :rules="rulesOne.name"
+                :inline-message="true"
+              >
+                <el-autocomplete
+                  v-model="row.name"
+                  :fetch-suggestions="querySearchPerson"
+                  clearable
+                  class="inline-input w-50"
+                  placeholder="请输入"
+                  @select="(val) => handlePerson(val, $index)"
+                >
+                </el-autocomplete>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column prop="price" label="金额" min-width="150">
+            <template #default="{ row, $index }">
+              <el-form-item
+                :prop="'otherFeeList.' + $index + '.price'"
+                :rules="rulesOne.price"
+                :inline-message="true"
+              >
+                <el-input-number
+                  v-model="row.price"
+                  :precision="4"
+                  :controls="false"
+                  @change="handleChangeAmount"
+                />
+              </el-form-item>
+            </template>
+          </el-table-column>
+
+          <el-table-column prop="remark" label="备注" min-width="150">
+            <template #default="{ row, $index }">
+              <el-form-item
+                :prop="'otherFeeList.' + $index + '.remark'"
+                :inline-message="true"
+              >
+                <el-input v-model="row.remark" placeholder="请输入" />
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column prop="zip" label="操作" width="100">
+            <template #default="{ $index }">
+              <el-button type="primary" link @click="handleRemove($index, 10)"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+      <el-row>
+        <el-col :span="4">
+          <el-form-item label="其他收费小计" prop="otherAmount">
+            <el-input
+              v-model="formData.data.otherAmount"
+              placeholder="请输入"
+              disabled
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <!-- <div class="_t">采购总金额</div> -->
+      <el-row>
+        <el-col :span="4">
+          <el-form-item label="采购总金额" prop="amount">
             <el-input
               v-model="formData.data.amount"
               placeholder="请输入"
@@ -181,6 +269,7 @@ let formData = reactive({
   data: {
     purchaseTime: "",
     purchaseDetailList: [],
+    otherFeeList: [],
   },
 });
 let rules = ref({
@@ -196,15 +285,31 @@ let rules = ref({
   price: [{ required: true, message: "请输入单价", trigger: "blur" }],
   remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
 });
+let rulesOne = ref({
+  name: [{ required: true, message: "请输入名称", trigger: "blur" }],
+  price: [{ required: true, message: "请输入金额", trigger: "blur" }],
+});
 
 let openProduct = ref(false);
 // 物品相应逻辑
-const handleRemove = (index) => {
-  formData.data.purchaseDetailList.splice(index, 1);
+const handleRemove = (index, type) => {
+  if (type === 20) {
+    formData.data.purchaseDetailList.splice(index, 1);
+    return ElMessage({
+      message: "删除成功!",
+      type: "success",
+    });
+  } else {
+    formData.data.otherFeeList.splice(index, 1);
+  }
   handleChangeAmount();
-  return ElMessage({
-    message: "删除成功!",
-    type: "success",
+};
+
+const handleAdd = () => {
+  formData.data.otherFeeList.push({
+    name: "",
+    price: undefined,
+    remark: "",
   });
 };
 
@@ -297,7 +402,7 @@ const getDetails = () => {
         return {
           ...x,
           subscribeCount: x.sumPackQuantity,
-          purchaseCount: x.sumPurchaseCount,
+          purchaseCount: x.sumPurchaseCount || 0,
           count: x.expendQuantity || 0,
           price: null,
           amount: null,
@@ -324,6 +429,7 @@ const getDetails = () => {
 };
 // 获取供应商数据
 const supplierData = ref([]);
+const otherFeeListData = ref([]);
 const getSupplierList = async (req) => {
   proxy
     .post("/supplierInfo/page", { pageNum: 1, pageSize: 9999 })
@@ -333,17 +439,65 @@ const getSupplierList = async (req) => {
 };
 // 供应商改变逻辑
 const handleChangeSupplier = (val) => {
-  console.log(val, "as");
+  const ids = formData.data.purchaseDetailList.map((x) => x.bussinessId);
+  proxy
+    .post("/supplierPrice/getSupplierPriceByProductIds", {
+      supplierInfoId: val,
+      productIdList: ids,
+    })
+    .then((res) => {
+      if (res && Object.keys(res).length > 0) {
+        for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
+          const e = formData.data.purchaseDetailList[i];
+          for (const key in res) {
+            if (e.bussinessId === key) {
+              e.price = Number(res[key]);
+            }
+          }
+        }
+      } else {
+        for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
+          const e = formData.data.purchaseDetailList[i];
+          e.price = 0;
+        }
+      }
+      handleChangeAmount();
+    });
+};
+const handleChangeProductAmount = () => {
+  let sum = 0;
+  for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
+    const e = formData.data.purchaseDetailList[i];
+    e.amount = parseFloat(e.count * e.price).toFixed(4);
+    sum += Number(e.amount);
+  }
+  formData.data.productAmount = parseFloat(sum).toFixed(4);
+};
+
+const handleChangeOtherAmount = () => {
+  let sum = 0;
+  for (let i = 0; i < formData.data.otherFeeList.length; i++) {
+    const e = formData.data.otherFeeList[i];
+    sum += Number(e.price);
+  }
+  formData.data.otherAmount = parseFloat(sum).toFixed(4);
 };
+
 // 计算采购总金额
 const handleChangeAmount = () => {
+  handleChangeProductAmount();
+  handleChangeOtherAmount();
   let sum = 0;
   for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
     const e = formData.data.purchaseDetailList[i];
-    e.amount = e.count * e.price;
-    sum += e.amount;
+    e.amount = parseFloat(e.count * e.price).toFixed(4);
+    sum += Number(e.amount);
+  }
+  for (let i = 0; i < formData.data.otherFeeList.length; i++) {
+    const e = formData.data.otherFeeList[i];
+    sum += Number(e.price);
   }
-  formData.data.amount = sum;
+  formData.data.amount = parseFloat(sum).toFixed(4);
 };
 
 const productUnit = ref([]);
@@ -354,9 +508,33 @@ const getDict = () => {
       value: x.dictKey,
     }));
   });
+  proxy.get("/purchaseOtherFee/listName").then((res) => {
+    otherFeeListData.value = res.data.map((x) => ({ ...x, value: x.name }));
+  });
 };
 getDict();
 
+const createFilter = (queryString) => {
+  return (restaurant) => {
+    return (
+      restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
+    );
+  };
+};
+
+const querySearchPerson = (queryString, callback) => {
+  const results = queryString
+    ? otherFeeListData.value.filter(createFilter(queryString))
+    : otherFeeListData.value;
+  callback(results);
+};
+
+const handlePerson = (item, index) => {
+  formData.data.otherFeeList[index].name = item.name;
+  formData.data.otherFeeList[index].price = item.price ? item.price : 0;
+  formData.data.otherFeeList[index].remark = item.remark ? item.remark : "";
+};
+
 watch(
   props.queryData,
   () => {

+ 327 - 5
src/views/connect/E-mail/mail/com/left.vue

@@ -37,7 +37,7 @@
             </div>
           </template>
         </el-tab-pane>
-        <!-- <el-tab-pane label="联系人" name="second">
+        <el-tab-pane label="联系人" name="second">
           <template #label>
             <div>
               <i
@@ -55,7 +55,7 @@
               <span>客户</span>
             </div>
           </template>
-        </el-tab-pane> -->
+        </el-tab-pane>
       </el-tabs>
       <div>
         <el-button
@@ -273,8 +273,99 @@
           </el-tree>
         </div>
       </div>
-      <div v-if="activeName === 'second'">暂未开放</div>
-      <div v-if="activeName === 'third'">暂未开放</div>
+      <div v-if="activeName === 'second'">
+        <div
+          class="tree"
+          v-if="contactsTreeData && contactsTreeData.length > 0"
+          style="border-top: none; margin-top: 0px"
+        >
+          <el-tree
+            :data="contactsTreeData"
+            node-key="id"
+            default-expand-all
+            :expand-on-click-node="false"
+            @node-click="
+              (data, node) => handleCustomerTreeClick(data, node, 'contacts')
+            "
+            v-loading="contactsTreeLoading"
+          >
+            <template #default="{ node, data }">
+              <span class="tree-content">
+                <span>{{ data.name }}</span>
+                <el-popover
+                  placement="bottom-start"
+                  title=""
+                  :width="150"
+                  trigger="click"
+                  v-if="data.parentId === '0'"
+                >
+                  <div default style="display: flex">
+                    <el-button
+                      size="small"
+                      @click.stop="handleEditContacts(data)"
+                      >编辑</el-button
+                    >
+                    <el-button
+                      size="small"
+                      @click.stop="handleDelContacts(data)"
+                      >删除</el-button
+                    >
+                  </div>
+                  <template #reference>
+                    <span
+                      class="iconfont icon_more iconColor"
+                      style="padding-bottom: 5px; margin-left: auto"
+                      >...</span
+                    >
+                  </template>
+                </el-popover>
+              </span>
+            </template>
+          </el-tree>
+        </div>
+        <div style="padding: 0 10px; margin-top: 15px">
+          <el-button
+            type="primary"
+            plain
+            :icon="Plus"
+            style="width: 100%; font-size: 12px"
+            @click="handleAddContact"
+            >添加联系人</el-button
+          >
+        </div>
+      </div>
+      <div v-if="activeName === 'third'">
+        <div
+          class="tree"
+          v-if="customerList && customerList.length > 0"
+          style="border-top: none; margin-top: 0px"
+        >
+          <el-tree
+            :data="customerList"
+            node-key="id"
+            :expand-on-click-node="false"
+            default-expand-all
+            @node-click="
+              (data, node) => handleCustomerTreeClick(data, node, 'customer')
+            "
+            v-loading="customerLoading"
+          >
+            <template #default="{ node, data }">
+              <span class="tree-content">
+                <span v-if="data.parentId === '0'"
+                  >{{ data.name }}
+                  <span
+                    v-if="data.parentId === '0' && data.children.length === 0"
+                  >
+                    (点击获取客户邮箱)</span
+                  ></span
+                >
+                <span v-else> {{ data.name }} {{ data.email }} </span>
+              </span>
+            </template>
+          </el-tree>
+        </div>
+      </div>
     </div>
     <el-dialog
       :title="editType === 'add' ? '添加文件夹' : '编辑文件夹'"
@@ -333,10 +424,82 @@
         </el-button>
       </template>
     </el-dialog>
+
+    <el-dialog
+      :title="editType === 'add' ? '添加联系人' : '编辑联系人'"
+      v-model="contactsDialog"
+      width="400px"
+      destroy-on-close
+      v-loading="submitLoading"
+    >
+      <byForm
+        :formConfig="contactsFormConfig"
+        :formOption="formOption"
+        v-model="formData.contactsData"
+        :rules="contactsRules"
+        ref="contactsForm"
+      >
+        <template #mailSet>
+          <div style="width: 100%">
+            <el-button type="primary" @click="clickAddRow">添 加</el-button>
+            <el-table
+              :data="formData.contactsData.mailSet"
+              style="width: 100%; margin-top: 16px"
+            >
+              <el-table-column label="电子邮箱">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item
+                      :prop="'mailSet.' + $index + '.email'"
+                      :rules="contactsRules.email"
+                      :inline-message="true"
+                    >
+                      <el-input
+                        v-model="row.email"
+                        placeholder="请输入电子邮箱"
+                      />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                align="center"
+                label="操作"
+                width="80"
+                fixed="right"
+              >
+                <template #default="{ row, $index }">
+                  <el-button
+                    type="primary"
+                    link
+                    @click="handleRemoveRow($index)"
+                    >删除</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="contactsDialog = false" size="large"
+          >取 消</el-button
+        >
+        <el-button
+          type="primary"
+          @click="submitContactsForm()"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
+import { Plus } from "@element-plus/icons-vue";
 import useMailStore from "@/store/modules/mail";
 import useUserStore from "@/store/modules/user";
 import byForm from "@/components/byForm/index";
@@ -380,6 +543,7 @@ const myFolderFormConfig = computed(() => [
 const formData = reactive({
   myFolderData: {},
   tagData: {},
+  contactsData: {},
 });
 const rules = ref({
   name: [{ required: true, message: "请输入文件夹名称", trigger: "blur" }],
@@ -401,6 +565,134 @@ const tagRules = ref({
   name: [{ required: true, message: "请输入标签名称", trigger: "blur" }],
 });
 
+const customerList = ref([]);
+const customerLoading = ref([]);
+
+const getCustomerList = () => {
+  customerLoading.value = true;
+  proxy.post("/myCustomer/list").then((res) => {
+    customerList.value = res.map((x) => ({
+      ...x,
+      parentId: "0",
+      children: [],
+    }));
+    customerLoading.value = false;
+  });
+};
+
+const contactsTreeData = ref([]);
+const contactsTreeLoading = ref([]);
+const contactsForm = ref(null);
+const contactsDialog = ref(false);
+const contactsFormConfig = computed(() => [
+  {
+    type: "input",
+    prop: "name",
+    label: "联系人名称",
+    disabled: false,
+    itemWidth: 100,
+  },
+  {
+    type: "slot",
+    prop: "mailSet",
+    slotName: "mailSet",
+  },
+]);
+
+const contactsRules = ref({
+  name: [{ required: true, message: "请输入联系人名称", trigger: "blur" }],
+  email: [{ required: true, message: "请输入电子邮箱", trigger: "blur" }],
+});
+
+const submitContactsForm = () => {
+  contactsForm.value.handleSubmit(() => {
+    if (formData.contactsData.mailSet.length > 0) {
+      submitLoading.value = true;
+      formData.contactsData.mailSet = formData.contactsData.mailSet
+        .map((x) => x.email)
+        .join();
+      proxy
+        .post("/myContactPerson/" + editType.value, formData.contactsData)
+        .then(
+          (res) => {
+            ElMessage({
+              message: `操作成功!`,
+              type: "success",
+            });
+            contactsDialog.value = false;
+            submitLoading.value = false;
+            getContactsTreeData();
+          },
+          (err) => {
+            submitLoading.value = false;
+          }
+        );
+    } else {
+      ElMessage({
+        message: "请添加邮箱",
+        type: "info",
+      });
+    }
+  });
+};
+
+const clickAddRow = () => {
+  formData.contactsData.mailSet.push({
+    email: "",
+  });
+};
+
+const handleRemoveRow = (index) => {
+  formData.contactsData.mailSet.splice(index, 1);
+};
+
+const getContactsTreeData = () => {
+  contactsTreeLoading.value = true;
+  proxy.post("/myContactPerson/page").then((res) => {
+    contactsTreeData.value = res.rows.map((x) => ({
+      ...x,
+      parentId: "0",
+      children: x.mailSet.split(",").map((y) => ({ name: y })),
+    }));
+    contactsTreeLoading.value = false;
+  });
+};
+
+const handleAddContact = () => {
+  formData.contactsData = {
+    name: "",
+    mailSet: [],
+  };
+  editType.value = "add";
+  contactsDialog.value = true;
+};
+
+const handleEditContacts = (data) => {
+  editType.value = "edit";
+  proxy.post("/myContactPerson/detail", { id: data.id }).then((res) => {
+    res.mailSet = res.mailSet.split(",").map((x) => ({ email: x }));
+    formData.contactsData = res;
+    contactsDialog.value = true;
+  });
+};
+
+const handleDelContacts = (data) => {
+  ElMessageBox.confirm(`此操作将删除该联系人, 是否继续?`, "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(() => {
+    // 删除
+    proxy.post("/myContactPerson/delete", { id: data.id }).then((res) => {
+      ElMessage({
+        message: `操作成功!`,
+        type: "success",
+      });
+      getContactsTreeData();
+    });
+  });
+};
+
 const getTagsList = () => {
   proxy
     .post("/myTag/page", {
@@ -664,7 +956,7 @@ const handleOpenMenu = (item, listPageType = "10") => {
   mailStore.currentId = menu.id;
 };
 
-const handleGoWrite = (mail = "", pageType = "0") => {
+const handleGoWrite = (mail = {}, pageType = "0") => {
   const menu = {
     title: "写信",
     type: selectMail.value.type,
@@ -764,9 +1056,36 @@ const handleTreeNodeNewClick = (data, node) => {
   }
 };
 
+const handleCustomerTreeClick = (data, node, type) => {
+  if (type === "customer") {
+    if (data.parentId === "0") {
+      const index = customerList.value.findIndex((x) => x.id === data.id);
+      if (index !== -1 && customerList.value[index].children.length === 0) {
+        customerLoading.value = true;
+        proxy.post("/customer/detail", { id: data.id }).then((res) => {
+          if (res.customerUserList && res.customerUserList.length > 0) {
+            customerList.value[index].children = res.customerUserList;
+          }
+          customerLoading.value = false;
+        });
+      }
+    } else {
+      handleGoWrite({ email: data.email, personal: data.name }, "0");
+    }
+  } else if (type === "contacts") {
+    if (data.parentId === "0") {
+      return;
+    } else {
+      handleGoWrite({ email: data.name, personal: node.parent.data.name }, "0");
+    }
+  }
+};
+
 onMounted(() => {
   getMialList();
+  getCustomerList();
   getTagsList();
+  getContactsTreeData();
 });
 
 defineExpose({
@@ -867,6 +1186,9 @@ defineExpose({
   }
 }
 .top {
+  .el-badge__content.is-fixed {
+    top: 8px;
+  }
   .el-tabs__item {
     color: #616161;
     font-size: 12px;

+ 24 - 15
src/views/connect/E-mail/mail/com/mailWrite.vue

@@ -247,7 +247,7 @@ import TinymceEditor from "@/components/Editor/TinymceEditor.vue";
 
 import { validEmail } from "@/utils/validate.js";
 import useMailStore from "@/store/modules/mail";
-import { computed, nextTick } from "vue";
+import { computed, nextTick, watch } from "vue";
 const mailStore = useMailStore();
 const { proxy } = getCurrentInstance();
 const userMailList = computed(() => mailStore.userMailList);
@@ -504,6 +504,16 @@ const querySearchPerson = (queryString, callback) => {
   callback(results);
 };
 
+const pushTo = () => {
+  if (mailStore.currentMenu.reMail) {
+    to.value = [
+      {
+        address: mailStore.currentMenu.reMail.email,
+        personal: mailStore.currentMenu.reMail.personal,
+      },
+    ];
+  }
+};
 const handleReplyInit = (allData, pageType) => {
   let data = allData.details;
   // 回复功能:则发件人是回复的收件人
@@ -563,12 +573,7 @@ const handleReplyInit = (allData, pageType) => {
     formData.data.subject = data.subject;
   } else if (pageType === "50") {
     handleReset();
-    to.value = [
-      {
-        address: mailStore.currentMenu.reMail,
-        personal: null,
-      },
-    ];
+    pushTo();
   }
   if (pageType !== "50") {
     contentEditor.value.changeHtml(`<p><br></p><p><br></p>${data.content}`);
@@ -585,6 +590,7 @@ const init = () => {
     handleReset();
     formData.data.replyTo = mailStore.selectMail.mailUser;
     handleChangeReply(formData.data.replyTo);
+    pushTo();
   } else if (mailStore.currentMenu.pageType === "10") {
     handleReplyInit(mailStore.currentMenu, "10");
   } else if (mailStore.currentMenu.pageType === "20") {
@@ -605,6 +611,7 @@ watch(
       handleReset();
       formData.data.replyTo = mailStore.selectMail.mailUser;
       handleChangeReply(formData.data.replyTo);
+      pushTo();
     } else if (val === "10") {
       handleReplyInit(mailStore.currentMenu, "10");
     } else if (val === "20") {
@@ -619,14 +626,16 @@ watch(
   }
 );
 
-onMounted(() => {
-  // if (mailStore.currentMenu.reMail) {
-  //   to.value.push({
-  //     address: mailStore.currentMenu.reMail,
-  //     personal: null,
-  //   });
-  // }
-});
+watch(
+  () => mailStore.currentMenu.reMail,
+  (val) => {
+    if (val && mailStore.currentMenu.pageType === "0") {
+      pushTo();
+    }
+  }
+);
+
+onMounted(() => {});
 
 defineExpose({
   initFn: init,

+ 2 - 2
src/views/connect/E-mail/mail/index.vue

@@ -33,8 +33,8 @@
 import mailLeft from "./com/left.vue";
 import mailMain from "./com/main.vue";
 import mailRight from "./com/right.vue";
-const mailCon = ref("mail-right-con");
-const showRight = ref(true);
+const mailCon = ref("mail-right-con move-to-close");
+const showRight = ref(false);
 const handleClose = () => {
   if (showRight.value) {
     mailCon.value = "mail-right-con move-to-close";

+ 1 - 1
src/views/dataBoard/board/customerAnalysis/index.vue

@@ -400,7 +400,7 @@ onMounted(() => {
     .item {
       margin: 10px 20px 0px;
       min-width: 200px;
-      flex: 1;
+      // flex: 1;
       display: flex;
       flex-direction: column;
       justify-content: space-around;

+ 30 - 2
src/views/purchaseManage/purchaseManage/arrival/index.vue

@@ -88,7 +88,11 @@
             <el-table-column prop="productCode" label="货品编码" />
             <el-table-column prop="productName" label="货品名称" />
             <el-table-column prop="productSpec" label="规格型号" />
-            <el-table-column prop="productUnit" label="单位" />
+            <el-table-column
+              prop="productUnit"
+              label="单位"
+              :formatter="(row) => dictValueLabel(row.productUnit, productUnit)"
+            />
             <el-table-column prop="count" label="到货数量" />
             <el-table-column prop="sumQualityCount" label="已质检" />
             <el-table-column
@@ -183,6 +187,9 @@ let rules = ref({
     { required: true, message: "请输入质检不合格数量", trigger: "blur" },
   ],
 });
+const supplierData = ref([]);
+const productUnit = ref([]);
+const productType = ref([]);
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
   {
@@ -230,7 +237,7 @@ const config = computed(() => {
         prop: "productType",
       },
       render(type) {
-        return type == 1 ? "产品" : type == 2 ? "物料" : "";
+        return proxy.dictValueLabel(type, productType.value);
       },
     },
 
@@ -257,6 +264,9 @@ const config = computed(() => {
         label: "单位",
         prop: "productUnit",
       },
+      render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -408,7 +418,25 @@ const getDtl = (row) => {
   //   dialogVisible.value = true;
   // });
 };
+const getDict = () => {
+  proxy
+    .post("/supplierInfo/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      supplierData.value = res.rows;
+    });
 
+  proxy.getDictOne(["unit", "product_type"]).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+    productType.value = res["product_type"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDict();
 getList();
 const selectData = ref([]);
 const selectDataOne = ref([]);

+ 107 - 24
src/views/purchaseManage/purchaseManage/handoverSlip/index.vue

@@ -22,7 +22,8 @@
           action: () => start(),
         },
       ]"
-      @get-list="getList">
+      @get-list="getList"
+    >
       <template #claimTime="{ item }">
         <div>
           <span v-if="item.claimTime">{{ item.claimTime }}</span>
@@ -31,36 +32,97 @@
       </template>
     </byTable>
 
-    <el-dialog title="转生产" v-if="dialogVisible" v-model="dialogVisible" width="1200" v-loading="loadingDialog">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+    <el-dialog
+      title="转生产"
+      v-if="dialogVisible"
+      v-model="dialogVisible"
+      width="1200"
+      v-loading="loadingDialog"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="submit"
+      >
         <template #details>
           <div style="width: 100%">
-            <el-table :data="formData.data.list" style="width: 100%; margin-top: 16px">
-              <el-table-column prop="productCode" label="物品编码" width="140" />
-              <el-table-column prop="productName" label="物品名称" min-width="220" />
-              <el-table-column prop="productUnit" label="单位" width="100" />
-              <el-table-column prop="expendQuantity" label="待处理数量" width="120" />
+            <el-table
+              :data="formData.data.list"
+              style="width: 100%; margin-top: 16px"
+            >
+              <el-table-column
+                prop="productCode"
+                label="物品编码"
+                width="140"
+              />
+              <el-table-column
+                prop="productName"
+                label="物品名称"
+                min-width="220"
+              />
+              <el-table-column
+                prop="productUnit"
+                label="单位"
+                width="100"
+                :formatter="
+                  (row) => dictValueLabel(row.productUnit, productUnit)
+                "
+              />
+              <el-table-column
+                prop="expendQuantity"
+                label="待处理数量"
+                width="120"
+              />
               <el-table-column label="转生产数量" width="160">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
-                    <el-form-item :prop="'list.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
-                      <el-input-number v-model="row.quantity" placeholder="请输入数量" style="width: 100%" :precision="0" :controls="false" :min="0" />
+                    <el-form-item
+                      :prop="'list.' + $index + '.quantity'"
+                      :rules="rules.quantity"
+                      :inline-message="true"
+                    >
+                      <el-input-number
+                        v-model="row.quantity"
+                        placeholder="请输入数量"
+                        style="width: 100%"
+                        :precision="0"
+                        :controls="false"
+                        :min="0"
+                      />
                     </el-form-item>
                   </div>
                 </template>
               </el-table-column>
-              <el-table-column label="完工期限" width="160">
+              <el-table-column label="完工期限" width="180">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
-                    <el-form-item :prop="'list.' + $index + '.time'" :rules="rules.time" :inline-message="true">
-                      <el-date-picker v-model="row.time" type="date" placeholder="请选择完工期限" value-format="YYYY-MM-DD" :disabled="true" />
+                    <el-form-item
+                      :prop="'list.' + $index + '.time'"
+                      :rules="rules.time"
+                      :inline-message="true"
+                    >
+                      <el-date-picker
+                        v-model="row.time"
+                        type="date"
+                        placeholder="请选择"
+                        value-format="YYYY-MM-DD"
+                      />
                     </el-form-item>
                   </div>
                 </template>
               </el-table-column>
-              <el-table-column align="center" label="操作" width="80" fixed="right">
+              <el-table-column
+                align="center"
+                label="操作"
+                width="80"
+                fixed="right"
+              >
                 <template #default="{ row, $index }">
-                  <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
+                  <el-button type="primary" link @click="handleDelete($index)"
+                    >删除</el-button
+                  >
                 </template>
               </el-table-column>
             </el-table>
@@ -69,7 +131,9 @@
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large"
+          >确 定</el-button
+        >
       </template>
     </el-dialog>
   </div>
@@ -120,6 +184,9 @@ const config = computed(() => {
         label: "版本号",
         prop: "contractVersion",
       },
+      render(contractVersion) {
+        return "v" + contractVersion;
+      },
     },
     {
       attrs: {
@@ -138,6 +205,9 @@ const config = computed(() => {
         label: "单位",
         prop: "productUnit",
       },
+      render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -190,16 +260,28 @@ const config = computed(() => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/contractProduct/page", sourceList.value.pagination).then((message) => {
-    console.log(message);
-    sourceList.value.data = message.rows;
-    sourceList.value.pagination.total = message.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/contractProduct/page", sourceList.value.pagination)
+    .then((message) => {
+      console.log(message);
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 getList();
+const productUnit = ref([]);
+const getDict = () => {
+  proxy.getDictOne(["unit"]).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDict();
 const selectData = ref([]);
 const selectRow = (data) => {
   selectData.value = data;
@@ -262,6 +344,7 @@ const formConfig = computed(() => {
 });
 const rules = ref({
   quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+  time: [{ required: true, message: "请选择完工期限", trigger: "change" }],
 });
 const transferToProduction = (row) => {
   if (row && row.id) {

+ 9 - 0
src/views/purchaseManage/purchaseManage/purchaseDocumentary/index.vue

@@ -209,7 +209,16 @@ const getList = () => {
     })
     .then(
       (res) => {
+        if(res.documentaryList&&res.documentaryList.length>0){
         purchaseTrackType.value = res.documentaryList;
+
+        }else{
+            ElMessage({
+          message: "请先去跟单配置页面进行配置",
+          type: "info",
+        });
+          purchaseTrackType.value =[]
+        }
         sourceList.value.data = res.page.rows;
         sourceList.value.pagination.total = res.page.total;
         setTimeout(() => {