فهرست منبع

Merge branch 'feature/Feature-sales' of https://gogs.zfire.top/zfire-front/supply-front into feature/Feature-sales

howie 3 سال پیش
والد
کامیت
e190babce2

+ 9 - 0
src/api/policy_list.js

@@ -300,6 +300,15 @@ export function addImgCarousel(params) {
   })
 }
 
+//修改轮播图
+export function editImgCarousel(params) {
+  return request({
+    url:'/record/update',
+    method: 'post',
+    data: params
+  })
+}
+
 //批量删除轮播图
 export function delImgData(params) {
   return request({

+ 9 - 0
src/api/setting.js

@@ -439,4 +439,13 @@ export function getDepartmentDetail(params) {
     method: 'get',
     params
   })
+}
+
+// 获取接口状态列表
+export function getApiList(params) {
+  return request({
+    url: '/common/interface/list',
+    method: 'get',
+    params
+  })
 }

+ 27 - 0
src/api/supply/apply.js

@@ -137,6 +137,15 @@ export function getEnginGoodsList(params) {
   })
 }
 
+// 工程发货申请单 - 获取产品详情
+export function getEnginGoodsDetail(params) {
+  return request({
+    url: '/invoice/listProjectOrderDetail',
+    method: 'get',
+    params
+  })
+}
+
 // 工程发货申请单 - 新增
 export function addEngin(params) {
   return request({
@@ -162,4 +171,22 @@ export function examineEngin(params) {
     method: 'post',
     data: params
   })
+}
+
+// 工程发货申请单 - 申请/撤回
+export function submitEngin(params) {
+  return request({
+    url: '/invoice/submitProject',
+    method: 'post',
+    params
+  })
+}
+
+// 工程发货申请单 - 删除
+export function deleteEngin(params) {
+  return request({
+    url: '/invoice/deleteProject',
+    method: 'post',
+    params
+  })
 }

+ 509 - 0
src/views/pset/login_setting.vue

@@ -0,0 +1,509 @@
+<template>
+  <div class="app-container">
+    <div class="page-header">
+      轮播图管理
+    </div>
+    <el-divider></el-divider>
+
+    <div class="btn-group">
+      <el-button
+        type="primary"
+        size="small"
+        @click="(dialogVisible = true), (type = 1)"
+      >新增</el-button>
+
+      <el-button size="small" type="danger"  @click="batchDelete()">删除</el-button>
+
+    </div>
+    <div class="mymain-container">
+      <el-table
+        v-loading="listLoading"
+        :data="dataList"
+        element-loading-text="Loading"
+        border
+        fit
+        highlight-current-row
+        stripe
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column type="selection" width="55" align="center">
+        </el-table-column>
+        <template v-for="col in columns">
+          <el-table-column
+            align="center"
+            :label="col.lable"
+            :prop="col.prop"
+            :min-width="col.widht"
+            show-overflow-tooltip
+            v-if="col.prop == 'status'"
+          >
+            <template slot-scope="scope">
+              <div style="z-index: 99">
+                <el-tag type="success"   v-if="scope.row.status == '1'"  >显示</el-tag>
+                <el-tag type="danger"  v-else-if="scope.row.status == '0'">隐藏 </el-tag>
+              </div>
+            </template>
+          </el-table-column>
+
+          <el-table-column
+            align="center"
+            :label="col.lable"
+            :prop="col.prop"
+            :min-width="col.widht"
+            show-overflow-tooltip
+            v-if="col.prop == 'imgCarouselUrl'"
+          >
+            <template slot-scope="scope">
+              <a :href="scope.row.imgCarouselUrl" >
+                <img :src="scope.row.imgCarouselUrl" alt="轮播图"  class="el-image__inner el-image__preview"/>
+              </a>
+            </template>
+          </el-table-column>
+
+          <el-table-column
+            v-else
+            align="center"
+            :label="col.lable"
+            :prop="col.prop"
+            :min-width="col.widht"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+        </template>
+
+        <el-table-column
+          align="center"
+          fixed="right"
+          label="操作"
+          min-width="160"
+        >
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="hanleEdit(scope.row)"
+            >编辑</el-button
+            >
+
+            <el-button type="text" size="small" @click="hanleStatus(scope.row.id)"  v-if="scope.row.status === '1'">隐藏</el-button>
+            <el-button type="text" size="small" @click="hanleStatus(scope.row.id)"  v-if="scope.row.status === '0'">显示</el-button>
+
+
+            <el-popconfirm
+              title="确定要删除这张轮播图吗?"
+              style="margin-left: 10px"
+              @onConfirm="hanleDelete(scope.row.id)"
+            >
+              <el-button slot="reference" type="text" size="small"
+              >删除</el-button
+              >
+            </el-popconfirm>
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- 分页 -->
+      <!--      <div style="margin: 20px 0">-->
+      <!--        <el-pagination-->
+      <!--          @size-change="handleSizeChange"-->
+      <!--          @current-change="handleCurrentChange"-->
+      <!--          :current-page="currentPage"-->
+      <!--          :page-sizes="[10, 20, 30, 50]"-->
+      <!--          :page-size="10"-->
+      <!--          layout="total, sizes, prev, pager, next, jumper"-->
+      <!--          :total="listTotal"-->
+      <!--        >-->
+      <!--        </el-pagination>-->
+      <!--      </div>-->
+    </div>
+
+    <!-- 添加公司备案信息 -->
+    <div>
+      <div class="setting_title">备案管理</div>
+      <el-divider></el-divider>
+
+      <el-card shadow="never" class="my-card">
+        <el-form
+          class="my-form"
+          ref="mainForm"
+          :model="comPanyDialogForm"
+          label-width="120px"
+          label-position="right"
+        >
+          <el-form-item label="ICP备案:" prop="nickName">
+            <el-input
+              autocomplete="off"
+              placeholder="请输入"
+              v-model="comPanyDialogForm.icpRecord"
+            ></el-input
+            >
+          </el-form-item>
+
+          <el-form-item label="ICP备案链接:" prop="nickName">
+            <el-input
+              autocomplete="off"
+              placeholder="请输入"
+              v-model="comPanyDialogForm.icpRecordLink"
+            ></el-input
+            > (填写链接,可跳转至链接页面)
+          </el-form-item>
+
+          <el-form-item label="公网安备案:" prop="nickName">
+            <el-input
+              autocomplete="off"
+              placeholder="请输入"
+              v-model="comPanyDialogForm.pubSecurityRecord"
+            ></el-input
+            >
+          </el-form-item>
+
+          <el-form-item label="公网安备案链接:" prop="nickName">
+            <el-input
+              autocomplete="off"
+              placeholder="请输入"
+              v-model="comPanyDialogForm.pubSecurityRecordLink"
+            ></el-input
+            > (填写链接,可跳转至链接页面)
+          </el-form-item>
+
+          <div class="setting_title">公司名称管理</div>
+          <el-divider></el-divider>
+
+          <el-form-item label="公司名称:" prop="nickName">
+            <el-input
+              autocomplete="off"
+              placeholder="单行输入"
+              v-model="comPanyDialogForm.companyName"
+            ></el-input
+            >
+          </el-form-item>
+
+        </el-form>
+
+      </el-card>
+    </div>
+
+
+
+    <div class="page-footer">
+      <div class="footer">
+        <!--        <el-button type="primary" @click="editFn">修改</el-button>-->
+        <el-button type="primary" @click="addComPany">确定</el-button>
+      </div>
+    </div>
+
+    <div>
+      <el-dialog
+        :visible.sync="dialogVisible"
+        width="50%"
+        @close="resetForm"
+        :close-on-click-modal="false"
+      >
+        <el-form
+          ref="dialogForm"
+          :model="dialogForm"
+          :rules="type == 1 ? rules : ''"
+          label-width="120px"
+          size="normal"
+        >
+          <el-form-item label="轮播图名称" prop="saleCode">
+            <el-input v-model="dialogForm.imgCarouselName"></el-input>
+          </el-form-item>
+
+          <el-form-item label="轮播图" prop="fileUrl">
+            <ImageUpload :fileList="fileList" :multiple="true" />
+          </el-form-item>
+
+          <el-form-item label="排序" prop="mainId">
+            <el-input v-model="dialogForm.imgCarouselOrder"></el-input>
+          </el-form-item>
+
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="(dialogVisible = false), resetForm()"
+          >取 消</el-button
+          >
+          <el-button type="primary" @click="addImgCarousel">确 定</el-button>
+        </span>
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+    import Mixin from "@/mixin/index";
+    import Pagination from "@/components/Pagination";
+    import ImageUpload from '@/components/Common/image-upload.vue';
+    import {
+        getProductList,
+        getImgCarouseList,
+        handleImgIsShow,
+        addImgCarousel,
+        delImgData,
+        addCompany,
+        editImgCarousel,
+    } from "@/api/policy_list";
+
+    export default {
+        mixins: [Mixin],
+        data() {
+            return {
+
+                type: 0, // 0,1
+                screenForm: {
+                    companyRecordManageId: "",
+                    imgCarouselName: "",
+                    imgCarouselUrl: "",
+                    imgCarouselOrder: "",
+                    status: "",
+                },
+                dialogForm: {
+                    id: "",
+                    companyRecordManageId: "",
+                    imgCarouselName: "",
+                    imgCarouselUrl: "",
+                    imgCarouselOrder: "",
+                    status: "1",
+                },
+                comPanyDialogForm: {
+                    id: "",
+                    icpRecord: "",
+                    icpRecordLink: "",
+                    pubSecurityRecord: "",
+                    pubSecurityRecordLink: "",
+                    companyName: "",
+                },
+
+                dataList: [
+                    {
+                        date: "2016-05-02",
+                        name: "王小虎",
+                        label: "姓名",
+                        address: "上海市普陀区金沙江路 1518 弄",
+                    },
+                ],
+                columns: [
+                    {
+                        prop: "imgCarouselName",
+                        lable: "轮播图名称",
+                        widht: 160,
+                    },
+                    {
+                        prop: "imgCarouselUrl",
+                        lable: "轮播图",
+                        widht: 160,
+                    },
+
+                    {
+                        prop: "imgCarouselOrder",
+                        lable: "排序",
+                        widht: 160,
+                    },
+                    {
+                        prop: "createTime",
+                        lable: "创建时间",
+                        widht: 160,
+                    },
+                    {
+                        prop: "status",
+                        lable: "状态",
+                        widht: 160,
+                    },
+
+                ],
+
+                rules: {
+                    imgCarouselName: [
+                        { required: true, message: "请输入轮播图名称", trigger: "blur" },
+                    ],
+                    // saleName: [
+                    //   { required: true, message: "请输入销售类型名称", trigger: "blur" },
+                    // ],
+                    // mainName: [
+                    //   { required: true, message: "请输入品类名称", trigger: "blur" },
+                    // ],
+                },
+                productList: [],
+                fileList: [],
+                multipleSelection: [],
+            };
+        },
+        methods: {
+
+            getList() {
+                this.listLoading = true;
+                const params = {
+                    pageNum: this.currentPage,
+                    pageSize: this.pageSize,
+                    saleCode: this.screenForm.saleCode,
+                    saleName: this.screenForm.saleName,
+                    mainId: "",
+                    status: this.screenForm.status,
+                };
+                // getTypeList(params).then((res) => {
+                //   this.dataList = res.data.records;
+                //   this.listTotal = res.data.total;
+                //   this.listLoading = false;
+                // });
+                getImgCarouseList(params).then((res) => {
+                    this.dataList = res.data;
+                    this.listLoading = false;
+                });
+                getProductList({
+                    productCategoryName: "",
+                    productCategoryNumber: "",
+                }).then((res) => {
+                    this.productList = res.data;
+                });
+            },
+            handleChange(e) {
+                this.productList.find((k) => {
+                    if (k.productCategoryNumber == e) {
+                        this.dialogForm.mainId = k.productCategoryNumber;
+                        this.dialogForm.mainName = k.productCategoryName;
+                        this.screenForm.mainId = k.productCategoryNumber;
+                        this.screenForm.mainName = k.productCategoryName;
+                    }
+                });
+            },
+            hanleDelete(id) {
+                this.hanleDeleteAllPromise(id).then((ids) => {
+                    delImgData({
+                        ids: ids[0],
+                    }).then((res) => {
+                        this.$successMsg("删除成功");
+                        this.hanleReset();
+                    });
+                });
+            },
+            hanleEdit(item) {
+                this.dialogForm = {
+                    id: item.id,
+                    companyRecordManageId: item.companyRecordManageId,
+                    imgCarouselName: item.imgCarouselName,
+                    imgCarouselUrl: item.imgCarouselUrl,
+                    imgCarouselOrder: item.imgCarouselOrder,
+                    status: item.status,
+                };
+                this.type = 0;
+                this.dialogVisible = true;
+            },
+            hanleDateil(item) {
+                this.dialogVisible = true;
+                this.dialogForm = {
+                    ...item,
+                };
+                this.type = 3;
+            },
+
+            hanleStatus(id){
+                handleImgIsShow({
+                    id:id
+                }).then((res) => {
+                    this.$successMsg("状态已更改");
+                    this.hanleReset();
+                });
+            },
+
+            addImgCarousel(){
+                if (this.type == 1) {
+                    this.$refs.dialogForm.validate((valid) => {
+                        //console.log(...this.dialogForm)
+                        if (valid) {
+                            this.dialogForm.imgCarouselUrl = "http://hg.zfire.top/api/img/get?key=" + this.fileList[0].url
+                            const params = {
+                                ...this.dialogForm,
+                            };
+                            addImgCarousel(params).then((res) => {
+                                this.$successMsg("添加成功");
+                                this.hanleReset();
+                            });
+                        } else {
+                            console.log("error submit!!");
+                            return false;
+                        }
+                    });
+                } else if (this.type == 0) {
+                    const upParams = {
+                        ...this.dialogForm,
+                    };
+                    editImgCarousel(upParams).then((res) => {
+                        this.$successMsg("修改成功");
+                        this.hanleReset();
+                    });
+                } else {
+                    this.dialogVisible = false;
+                }
+            },
+            // 表格选择
+            handleSelectionChange(val) {
+                this.multipleSelection = val;
+            },
+
+            //添加公司信息
+            addComPany(){
+                const params = {
+                    ...this.comPanyDialogForm,
+                };
+                addCompany(params).then((res) => {
+                    this.$successMsg("添加成功");
+                    this.hanleReset();
+                });
+
+            },
+            resetForm(formName) {
+                this.$refs.dialogForm.resetFields();
+            },
+            hanleReset() {
+                this.dialogForm = {
+                    companyRecordManageId: "",
+                    imgCarouselName: "",
+                    imgCarouselUrl: "",
+                    imgCarouselOrder: "",
+                    status: "1"
+                };
+                // this.$refs.dialogForm.resetFields()
+                this.dialogVisible = false;
+                this.getList();
+            },
+            batchDelete() {
+                if(this.multipleSelection.length < 1) {
+                    return this.$errorMsg('请选择信息');
+                }
+                this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    let ids = [];
+                    this.multipleSelection.forEach(item => {
+                        ids.push(item.id);
+                    });
+                    delImgData({ids: ids.join(',')}).then(res => {
+                        this.$successMsg('删除成功');
+                        this.hanleReset();
+                    })
+                }).catch(() => {});
+            },
+
+        },
+        components: {
+            Pagination,
+            ImageUpload
+        },
+    };
+</script>
+
+<style scoped>
+  .el-switch.is-disabled {
+    opacity: inherit;
+  }
+  .page-header{
+    font-size: 18px;
+    padding-bottom: 10px;
+    font-weight: 600;
+  }
+  .cname-footer{
+    margin-top: 15px;
+  }
+  .my-form{
+    width :60%
+  }
+
+</style>

+ 47 - 30
src/views/setting/api.vue

@@ -5,13 +5,15 @@
       <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="接口名称" prop="account">
-              <el-input v-model="screenForm.account" placeholder="请输入接口名称"></el-input>
+            <el-form-item label="接口名称" prop="name">
+              <el-input v-model="screenForm.name" placeholder="请输入接口名称"></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="接口状态" prop="name">
-              <el-input v-model="screenForm.name" placeholder="请输入接口状态"></el-input>
+            <el-form-item label="接口状态" prop="status">
+              <el-select v-model="screenForm.status" placeholder="请选择接口状态" clearable>
+                <el-option :label="item.label" :value="item.value" v-for="(item, index) in statusList" :key="index"></el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           
@@ -29,16 +31,20 @@
       <div class="btn-group clearfix">
         <div class="fl" />
         <div class="fr">
-          <el-button size="small" type="primary" @click="handleExport">导出</el-button>
+          <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
         </div>
       </div>
 
       <div class="table">
         <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-          <el-table-column align="center" label="接口名称" prop="moduleName"></el-table-column>
-          <el-table-column align="center" label="接口描述" prop="moduleName"></el-table-column>
-          <el-table-column align="center" label="接口状态" prop="createTime"></el-table-column>
-          <el-table-column align="center" label="更新时间" prop="ip"></el-table-column>
+          <el-table-column align="center" label="接口名称" prop="name"></el-table-column>
+          <el-table-column align="center" label="接口描述" prop="description"></el-table-column>
+          <el-table-column align="center" label="接口状态" prop="status">
+            <template slot-scope="scope">
+              {{scope.row.status | statusFilter}}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="更新时间" prop="syncTime"></el-table-column>
         </el-table>
       </div>
       
@@ -61,20 +67,30 @@
 </template>
 
 <script>
-import { getOplogList } from '@/api/setting'
-import { downloadFiles } from '@/utils/util'
+import { getApiList } from '@/api/setting'
 
+let that
 export default {
+  filters: {
+    statusFilter(val) {
+      let obj = that.statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    },
+  },
   data() {
     return {
       dataList: null, // 列表数据
       listLoading: true, // 列表加载loading
       screenForm: { // 筛选表单数据
-        account: '',
+        status: '',
         name: '',
-        date: '',
-        region: '',
       },
+      statusList: [
+        { label: '未同步', value: 0 },
+        { label: '已同步', value: 1 },
+        { label: '同步失败', value: 2 },
+      ],
+
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -82,6 +98,19 @@ export default {
     }
   },
 
+  computed: {
+    exParams() {
+      return {
+        name: this.screenForm.name,
+        status: this.screenForm.status,
+      }
+    },
+  },
+
+  beforeCreate() {
+    that = this;
+  },
+
   created() {
     this.getList();
   },
@@ -100,16 +129,13 @@ export default {
       this.listLoading = true;
 
       let params = {
-        account: this.screenForm.account,
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
         name: this.screenForm.name,
-        region: this.screenForm.region,
-        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
-        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        pageNo: this.currentPage,
-        pageSize: this.pageSize
+        status: this.screenForm.status,
       };
 
-      getOplogList(params).then(res => {
+      getApiList(params).then(res => {
         this.dataList = res.data.records;
         this.listTotal = res.data.total;
         this.listLoading = false;
@@ -148,15 +174,6 @@ export default {
       this.getList();
     },
 
-    // 导出
-    handleExport() {
-      let screenData = {
-        orderId: this.screenForm.orderId,
-        status: this.screenForm.status,
-      };
-      downloadFiles('tax/export', screenData);
-    },
-
   }
 }
 </script>

+ 2 - 2
src/views/supply/apply/apply_list.vue

@@ -86,7 +86,7 @@
             <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="备注信息" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
@@ -108,7 +108,7 @@
                 <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
                 <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审单</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
-                <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)" >
+                <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)"  v-if="scope.row.examineStatus !== 'OK'">
                   <el-button slot="reference" type="text">删除</el-button>
                 </el-popconfirm>
               </template>

+ 1 - 1
src/views/supply/apply/components/apply_form.vue

@@ -480,7 +480,7 @@ export default {
             remark: this.mainForm.remark,
             fileUrl: this.fileList && this.fileList.length > 0 ? this.fileList[0].url : '',
             fileName: this.fileList && this.fileList.length > 0 ? this.fileList[0].name : '',
-            orderType: 1, // 1零售单 2家用工程 3商用工程
+            // orderType: 1, // 1零售单 2家用工程 3商用工程
             correspondId: this.screenForm.warehouse,
             correspondName,
             orders: this.goodsList,

+ 50 - 6
src/views/supply/apply/components/engin_form.vue

@@ -225,7 +225,7 @@
               {{scope.row.orderType | orderTypeFilter}}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="工程登录编号" prop="enginOrderNo" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="工程登录编号" prop="enginOrderNo" min-width="200" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
@@ -275,7 +275,7 @@
 </template>
 
 <script>
-import { getEnginDetail, addEngin, editEngin, getEnginGoodsList, getWarehouseList, getDealerList } from "@/api/supply/apply";
+import { getEnginDetail, addEngin, editEngin, getEnginGoodsList, getWarehouseList, getDealerList, getEnginGoodsDetail } from "@/api/supply/apply";
 import { getDictList } from '@/api/common'
 import { findElem } from '@/utils/util'
 import fileUpload from '@/components/Common/file-upload.vue'
@@ -397,15 +397,26 @@ export default {
       getEnginDetail({id: this.listItem.id}).then(res => {
         let data = res.data;
         this.mainForm.orderNum = data.id;
-        this.mainForm.date = data.orderTime;
+        this.mainForm.orderDate = data.orderTime.slice(0, 10);
         this.mainForm.jxsNum = data.customerNumber;
         this.mainForm.jxsName = data.customerName;
+        this.mainForm.loginNum = data.enginOrderNo;
+        this.mainForm.enginName = data.refProjectName;
+        this.mainForm.loginType = data.enginOrderType;
+        this.mainForm.factoryNum = data.refFactoryNo;
+        this.mainForm.company = data.refUseUnit;
+        this.mainForm.saleType = data.saleTypeId;
+        this.mainForm.contactMan = data.refLinkman;
+        this.mainForm.tel = data.refTel;
+        this.mainForm.phone = data.refPhone;
+        this.mainForm.address = data.refInstallAddress;
         this.mainForm.createMan = data.createBy;
+        this.mainForm.createDate = data.createTime;
         this.mainForm.remark = data.remark;
         this.screenForm.warehouse = data.correspondId;
         this.fileList = data.fileUrl ? [{
           url: data.fileUrl,
-          name: data.fileName
+          name: data.fileName,
         }] : [];
         data.orders.forEach(item => {
           item.orderId = item.id;
@@ -548,6 +559,17 @@ export default {
       return newArr;
     },
 
+    // 检查是否一致
+    isAllEqual(array) {
+      if (array.length > 0) {
+        return !array.some(function(item, index) {
+          return item.enginOrderNo !== array[0].enginOrderNo;
+        });
+      } else {
+        return true;
+      }
+    },
+
     // 确定 添加产品
     submitAddGoods() {
       let allList = this.tableGoodsList;
@@ -556,16 +578,38 @@ export default {
 
       for(let i = 0; i < allList.length; i++) {
         for(let j = 0; j < selectList.length; j++) {
-          if(selectList[j].orderId == allList[i].orderId){
+          if(selectList[j].enginOrderNo == allList[i].enginOrderNo){
             submitList.push(allList[i]);
           }
         }
       }
       // this.goodsList = this.goodsList.concat(submitList);
 
+      if(!this.isAllEqual(submitList)) {
+        return this.$errorMsg('只能选择同一个工程编号的订单');
+      }
+
       this.goodsList = this.delRepeat(submitList, this.goodsList);
       this.isShowDialog = false;
       this.tableGoodsList = [];
+
+      this.getEnginGoodsDetail(submitList[0].enginOrderNo);
+    },
+
+    getEnginGoodsDetail(enginOrderNo) {
+      getEnginGoodsDetail({enginOrderNo}).then(res => {
+        let data = res.data;
+        this.mainForm.loginNum = data.refEnginRecordNo;
+        this.mainForm.enginName = data.refProjectName;
+        this.mainForm.loginType = data.refPromiseStatus;
+        this.mainForm.factoryNum = data.refFactoryNo;
+        this.mainForm.company = data.refUseUnit;
+        this.mainForm.saleType = data.saleTypeId;
+        this.mainForm.contactMan = data.refLinkman;
+        this.mainForm.tel = data.refTel;
+        this.mainForm.phone = data.refPhone;
+        this.mainForm.address = data.refInstallAddress;
+      })
     },
 
     // 删除产品
@@ -598,7 +642,7 @@ export default {
 
           let correspondName = this.warehouseList[findElem(this.warehouseList, 'id', this.screenForm.warehouse)].name;
           let params = {
-            orderTime: this.mainForm.date + ' 00:00:00',
+            orderTime: this.mainForm.orderDate + ' 00:00:00',
             remark: this.mainForm.remark,
             enginOrderNo: this.mainForm.loginNum,
             refProjectName: this.mainForm.enginName,

+ 1 - 0
src/views/supply/engin/commerce_list.vue

@@ -199,6 +199,7 @@ export default {
       dataList: null, // 列表数据
       listLoading: false, // 列表加载loading
       screenForm: { // 筛选表单数据
+        status: '',
         orderNum: '',
         enginNum: '',
         loginNum: '',

+ 16 - 17
src/views/supply/engin/components/commerce_form.vue

@@ -152,7 +152,7 @@
         <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="单位" prop="baseUnitId" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="工程信息数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-input v-model="scope.row.qty" size="small"></el-input>
@@ -281,7 +281,7 @@
           max-height="270">
           <el-table-column align="center" label="" width="100">
             <template slot-scope="scope">
-              <el-button type="primary" size="small" @click="chooseItem(scope.row.enginInfoNo)">选择</el-button>
+              <el-button type="primary" size="small" @click="chooseItem(scope.row.enginInfoId)">选择</el-button>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="checkTime" label="工程登录日期" show-overflow-tooltip></el-table-column>
@@ -552,29 +552,29 @@ export default {
       getComLoginDetail({id}).then(res => {
         this.isShowDialog = false;
         let data = res.data;
-        this.mainForm.type = data.productCategory;
-        this.mainForm.saleType = '';
+        this.mainForm.type = data.productCategoryId;
         this.mainForm.enginNum = data.enginInfoNo;
         this.mainForm.enginName = data.projectName;
-        this.mainForm.loginType = data.promiseStatus;
+        this.mainForm.loginType = data.enginSignType;
         this.mainForm.company = data.useUnit;
-        this.mainForm.contactMan = data.buyUnitCallMen;
-        this.mainForm.tel = data.buyUnitTel;
-        this.mainForm.phone = data.buyUnitPhone;
+        this.mainForm.contactMan = data.linkman;
+        this.mainForm.tel = data.tel;
+        this.mainForm.phone = data.phone;
         this.mainForm.address = data.installAddress;
 
         this.goodsList = data.items.map(item => {
           return {
             useRefCount: '',
-            saleTypeName: '',
-            materialNumber: '',
-            materialOldNumber: item.code,
-            materialName: item.name,
+            saleTypeName: item.saleTypeName,
+            materialId: item.materialId,
+            materialNumber: item.materialNumber,
+            materialOldNumber: item.materialOldNumber,
+            materialName: item.materialName,
             specification: item.machine,
-            baseUnitId: '',
+            baseUnitId: item.unit,
             price: item.price,
             enginNum: '',
-            qty: item.num,
+            qty: item.qty,
             customerWalletId2: '',
             rebateRate: '',
             discAmount: '',
@@ -582,8 +582,8 @@ export default {
             isDirectTransfer: false,
             directTransferQty: '',
             hasSendQty: '',
-            remark: item.discri,
-            tax: '',
+            remark: item.remark,
+            tax: item.taxRate,
             status1: '',
             status2: '',
           }
@@ -666,7 +666,6 @@ export default {
             mainId: this.mainForm.type || '',
             refEnginRecordNo: this.mainForm.enginNum || '',
             refFactoryNo: this.mainForm.factoryNum || '',
-            buyUnitPhone: this.mainForm.phone,
             note2: this.mainForm.greeRemark || '',
             note1: this.mainForm.greeReply || '',
             remark: this.mainForm.remark || '',

+ 0 - 1
src/views/supply/engin/components/home_form.vue

@@ -700,7 +700,6 @@ export default {
             saleTypeId: this.mainForm.saleType,
             saleTypeCode: saleTypeItem.saleCode,
             saleTypeName: saleTypeItem.saleName,
-            buyUnitPhone: this.mainForm.phone,
             note2: this.mainForm.greeRemark || '',
             note1: this.mainForm.greeReply || '',
             remark: this.mainForm.remark || '',

+ 1 - 0
src/views/supply/engin/home_list.vue

@@ -199,6 +199,7 @@ export default {
       dataList: null, // 列表数据
       listLoading: false, // 列表加载loading
       screenForm: { // 筛选表单数据
+        status: '',
         orderNum: '',
         enginNum: '',
         loginNum: '',