فهرست منبع

部分需求静态页面完成

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

+ 28 - 0
src/components/process/SendSubscribe.vue

@@ -10,6 +10,25 @@
       <div class="_t">申购信息</div>
       <el-row :gutter="10">
         <el-col :span="6">
+          <el-form-item label="归属公司" prop="corporationId">
+            <el-select
+              v-model="formData.data.corporationId"
+              placeholder="请选择"
+              filterable
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in companyData"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="10">
+        <el-col :span="6">
           <el-form-item label="申购部门" prop="deptName">
             <el-input
               v-model="formData.data.deptName"
@@ -141,6 +160,7 @@ let formData = reactive({
   },
 });
 let rules = ref({
+  corporationId: [{ required: true, message: "请选择归属公司", trigger: "change" }],
   deptName: [{ required: true, message: "请输入申购部门", trigger: "blur" }],
   subcribeName: [
     { required: true, message: "请输入申购人名称", trigger: "blur" },
@@ -241,6 +261,8 @@ watch(
   }
 );
 const productUnit = ref([]);
+const companyData = ref([]);
+
 const getDict = () => {
   proxy.getDictOne(["unit"]).then((res) => {
     productUnit.value = res["unit"].map((x) => ({
@@ -248,6 +270,12 @@ const getDict = () => {
       value: x.dictKey,
     }));
   });
+
+  proxy
+    .post("/corporation/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      companyData.value = res.rows;
+    });
 };
 getDict();
 const getFormData = () => {

+ 188 - 45
src/views/purchaseManage/purchaseManage/handoverSlip/index.vue

@@ -6,6 +6,7 @@
       :config="config"
       :loading="loading"
       highlight-current-row
+      :row-class-name="getRowClass"
       :table-events="{
         select: selectRow,
         'select-all': selectRow,
@@ -30,6 +31,42 @@
           <span v-else>未到账</span>
         </div>
       </template>
+      <template #details="{ item }">
+        <div>
+          <el-button type="primary" link v-if="item.expendQuantity > 0"
+            >查看</el-button
+          >
+          <el-button type="primary" link style="color: #f54a45" v-else
+            >查看</el-button
+          >
+        </div>
+      </template>
+      <template #btn="{ item }">
+        <div v-if="item.expendQuantity > 0">
+          <el-button type="primary" link @click="start(10, item)"
+            >采购</el-button
+          >
+          <el-button type="primary" link @click="transferToProduction(item)"
+            >转生产</el-button
+          >
+        </div>
+        <div v-else>
+          <el-button
+            type="primary"
+            link
+            style="color: #f54a45"
+            @click="handleFollow(item)"
+            >跟进</el-button
+          >
+          <el-button
+            type="primary"
+            link
+            style="color: #f54a45"
+            @click="lookRecords(item)"
+            >跟进记录</el-button
+          >
+        </div>
+      </template>
     </byTable>
 
     <el-dialog
@@ -136,6 +173,49 @@
         >
       </template>
     </el-dialog>
+    <el-dialog
+      title="填写跟进"
+      v-if="dialogVisibleOne"
+      v-model="dialogVisibleOne"
+      width="500"
+      v-loading="loadingDialog"
+    >
+      <byForm
+        :formConfig="formConfigOne"
+        :formOption="formOption"
+        v-model="formData.dataOne"
+        :rules="rulesOne"
+        ref="submitOne"
+      >
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisibleOne = false" size="large"
+          >取 消</el-button
+        >
+        <el-button type="primary" @click="submitFormOne()" size="large"
+          >确 定</el-button
+        >
+      </template>
+    </el-dialog>
+
+    <el-dialog title="跟进记录" v-model="dialogVisibleTwo" width="500">
+      <div style="width: 100%">
+        <el-timeline :reverse="false">
+          <el-timeline-item
+            placement="top"
+            v-for="(activity, index) in activities"
+            :key="index"
+            :timestamp="activity.handleTime"
+          >
+            <div>
+              跟进人:{{ activity.handleUserName }}
+              <span>({{ activity.status ? "已完成" : "处理中" }})</span>
+            </div>
+            <div style="margin-top: 5px">跟进记录: {{ activity.explain }}</div>
+          </el-timeline-item>
+        </el-timeline>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -163,14 +243,22 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "归属公司",
+        prop: "aa",
+      },
+    },
+    {
+      attrs: {
         label: "外销合同编号",
         prop: "contractCode",
+        width: "160",
       },
     },
     {
       attrs: {
         label: "合同到账时间",
         slot: "claimTime",
+        width: "155",
       },
     },
     {
@@ -204,6 +292,7 @@ const config = computed(() => {
       attrs: {
         label: "单位",
         prop: "productUnit",
+        width: "80",
       },
       render(unit) {
         return proxy.dictValueLabel(unit, productUnit.value);
@@ -213,46 +302,24 @@ const config = computed(() => {
       attrs: {
         label: "待处理数量",
         prop: "expendQuantity",
+        width: "110",
       },
     },
     {
       attrs: {
         label: "详情",
-        prop: "remark",
+        width: "100",
+        align: "center",
+        slot: "details",
       },
     },
     {
       attrs: {
         label: "操作",
+        slot: "btn",
         width: "140",
         align: "center",
-      },
-      renderHTML(row) {
-        return [
-          {
-            attrs: {
-              label: "采购",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              selectData.value = [row];
-              start();
-            },
-          },
-          {
-            attrs: {
-              label: "转生产",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              transferToProduction(row);
-            },
-          },
-        ];
+        fixed: "right",
       },
     },
   ];
@@ -263,7 +330,7 @@ const getList = async (req) => {
   proxy
     .post("/contractProduct/page", sourceList.value.pagination)
     .then((message) => {
-      console.log(message);
+      message.rows[0].expendQuantity = -1;
       sourceList.value.data = message.rows;
       sourceList.value.pagination.total = message.total;
       setTimeout(() => {
@@ -286,7 +353,10 @@ const selectData = ref([]);
 const selectRow = (data) => {
   selectData.value = data;
 };
-const start = () => {
+const start = (type, row) => {
+  if (type === 10) {
+    selectData.value = [row];
+  }
   if (selectData.value.length > 0) {
     let ids = selectData.value.map((x) => x.id).join();
     proxy.$router.replace({
@@ -305,8 +375,11 @@ const start = () => {
   }
 };
 const dialogVisible = ref(false);
+const dialogVisibleOne = ref(false);
+const dialogVisibleTwo = ref(false);
 const loadingDialog = ref(false);
 const submit = ref(null);
+const submitOne = ref(null);
 const formOption = reactive({
   inline: true,
   labelWidth: 100,
@@ -317,24 +390,10 @@ const formData = reactive({
   data: {
     list: [],
   },
+  dataOne: {},
 });
 const formConfig = computed(() => {
   return [
-    // {
-    //   label: "基本信息",
-    // },
-    // {
-    //   type: "select",
-    //   prop: "warehouseId",
-    //   label: "工单类型",
-    //   data: [],
-    // },
-    // {
-    //   type: "input",
-    //   prop: "remark",
-    //   label: "备注",
-    //   itemType: "textarea",
-    // },
     {
       type: "slot",
       slotName: "details",
@@ -346,6 +405,78 @@ const rules = ref({
   quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
   time: [{ required: true, message: "请选择完工期限", trigger: "change" }],
 });
+
+const formConfigOne = computed(() => {
+  return [
+    {
+      type: "select",
+      prop: "warehouseId",
+      label: "跟进结果",
+      data: [],
+    },
+    {
+      type: "date",
+      itemType: "datetime",
+      prop: "warehouseId",
+      label: "跟进时间",
+      format: "YYYY-MM-DD HH:mm:ss",
+    },
+    {
+      type: "input",
+      prop: "remark",
+      label: "跟进记录",
+      itemType: "textarea",
+    },
+  ];
+});
+const rulesOne = ref({
+  quantity: [{ required: true, message: "请选择跟进结果", trigger: "change" }],
+  time: [{ required: true, message: "请选择跟进时间", trigger: "change" }],
+  remark: [{ required: true, message: "请输入跟进记录", trigger: "blur" }],
+});
+
+const activities = ref([]);
+const lookRecords = (row) => {
+  proxy
+    .post("/abnormalDetails/page", {
+      abnormalInfoId: row.id,
+    })
+    .then((res) => {
+      if (res.rows.length > 0) {
+        activities.value = res.rows;
+        dialogVisibleTwo.value = true;
+      } else
+        return ElMessage({
+          message: "暂无跟进记录!",
+          type: "info",
+        });
+    });
+};
+const handleFollow = () => {
+  formData.dataOne = {};
+  dialogVisibleOne.value = true;
+};
+
+const submitFormOne = () => {
+  submitOne.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/workOrder/addBatch", formData.data.list).then(
+      () => {
+        ElMessage({
+          message: "提交成功",
+          type: "success",
+        });
+        dialogVisibleOne.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+  });
+};
+
 const transferToProduction = (row) => {
   if (row && row.id) {
     formData.data = {
@@ -405,6 +536,13 @@ const submitForm = () => {
 const handleDelete = (index) => {
   formData.data.list.splice(index, 1);
 };
+
+const getRowClass = ({ row }) => {
+  if (row.expendQuantity < 0) {
+    return "redClass";
+  }
+  return "";
+};
 </script>
 
 <style lang="scss" scoped>
@@ -415,3 +553,8 @@ const handleDelete = (index) => {
   text-align: left;
 }
 </style>
+<style >
+.redClass {
+  color: #f54a45 !important;
+}
+</style>

+ 6 - 0
src/views/purchaseManage/purchaseManage/purchase/index.vue

@@ -189,6 +189,12 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "归属公司",
+        prop: "subscribeCode",
+      },
+    },
+    {
+      attrs: {
         label: "申购单号",
         prop: "subscribeCode",
       },