瀏覽代碼

销售订单调试

zouzhd 3 年之前
父節點
當前提交
8a0e50de4c

+ 1 - 1
build/utils.js

@@ -19,7 +19,7 @@ const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应
 // let devModules = ['index', 'qualityControl', 'standard', 'basicconfig'];
 // let devModules = ['index','devops','workFlow','systemConfig', 'microService'];
 // let devModules = ['all'];
-let devModules = ['all'];
+let devModules = ['index','appoint','sale','TMS'];
 // let devModules = ['index','systemConfig', 'formGenerator', 'preview', 'metaData', 'serviceManager', 'configManager', 'custom'];
 // let devModules = ['index', 'systemConfig','formGenerator', 'preview', 'metaData', 'serviceManager', 'configManager', 'btnControll'];
 if (pathSrc.indexOf('node_modules') > -1) {

+ 2 - 2
config/index.js

@@ -63,14 +63,14 @@ let proxyTable = {
   //   }
   // },
   "/api/v1": {
-    target: "http://172.16.33.166:8080",
+    target: "http://192.168.1.109:8080",
     ws: true,
     pathRewrite: {
       "^/api/v1": "/api/v1"
     }
   },
   "/views/api/v1": {
-    target: "http://172.16.33.166:8080",
+    target: "http://192.168.1.109:8080",
     ws: true,
     pathRewrite: {
       "^/views/api/v1": "/api/v1"

+ 22 - 0
src/components/exportExcel/exportExcel.js

@@ -0,0 +1,22 @@
+// 导出表格为excel格式
+export default{
+  install (Vue, options) {
+    Vue.prototype.exportData = function () {
+      var title = this.tableTitle
+      let tHeader = [];
+        let filterVal = [];
+        this.$refs.excelDom.dataColumnData.filter( (item,i) =>{
+          tHeader.push(item.label);
+              filterVal.push(item.prop);
+          } )
+      //导出为excel
+      this.downloadLoading = true
+      require.ensure([], () => {
+      const { export_json_to_excel } = require("@/assets/excel/Export2Excel.js"); //这里必须使用绝对路径,使用@/+存放export2Excel的路径
+      let list = this.$refs.excelDom.dataTabel;
+      let data = list.map((v) => filterVal.map((j) => v[j]));//3.formatJson格式转换
+      export_json_to_excel(tHeader, data, title); // (title)导出的表格名称
+    });
+    }
+  },
+}

+ 43 - 0
src/components/exportPdf/exportPdf.js

@@ -0,0 +1,43 @@
+// 导出页面为PDF格式
+import html2Canvas from 'html2canvas'
+import JsPDF from 'jspdf'
+export default{
+  install (Vue, options) {
+    Vue.prototype.getPdf = function () {
+      var title = this.htmlTitle
+      html2Canvas(document.querySelector('#pdfDom'), {
+        allowTaint: true
+      }).then(function (canvas) {
+        var pdf = new JsPDF('p', 'mm', 'a4') // A4纸,纵向
+
+        var ctx = canvas.getContext('2d')
+
+        var a4w = 210;
+        var a4h = 297 // A4大小,210mm x 297mm,四边不保留边距,显示区域210x297 (四边各保留20mm的边距,显示区域170x257)(pass)
+
+        var imgHeight = Math.floor(a4h * canvas.width / a4w) // 按A4显示比例换算一页图像的像素高度
+
+        var renderedHeight = 0
+
+        while (renderedHeight < canvas.height) {
+            var page = document.createElement('canvas')
+
+            page.width = canvas.width
+
+            page.height = Math.min(imgHeight, canvas.height - renderedHeight) // 可能内容不足一页
+
+            // 用getImageData剪裁指定区域,并画到前面建立的canvas对象中
+            page.getContext('2d').putImageData(ctx.getImageData(0, renderedHeight, canvas.width, Math.min(imgHeight, canvas.height - renderedHeight)), 0, 0)
+            pdf.addImage(page.toDataURL('image/jpeg', 1.0), 'JPEG', 0, 0, a4w, Math.min(a4h, a4w * page.height / page.width)) // 添加图像到页面,保留10mm边距
+            renderedHeight += imgHeight
+
+            if (renderedHeight < canvas.height) {
+                pdf.addPage()
+            } // 若是后面还有内容,添加一个空页
+            // delete page;
+        }
+        pdf.save(title + '.pdf')
+    })
+    }
+  }
+}

+ 4 - 0
src/views/appoint/app.js

@@ -24,6 +24,10 @@ Vue.use(VueApollo)
 import DilCommonUI from "@/components/DilCommonUI";
 Vue.use(DilCommonUI);
 
+// 导出Excel全局组件
+import tableToExcel from '@/components/exportExcel/exportExcel'
+Vue.use(tableToExcel)
+
 const apolloProvider = new VueApollo({
     defaultClient: apollo
 })

+ 492 - 0
src/views/appoint/components/saleContract/addSaleOrderArrange.vue

@@ -0,0 +1,492 @@
+<template>
+  <!-- 添加销售订单 -->
+  <div class="addSalePlan">
+    <page-title>新增销售订单排车</page-title>
+
+    <div class="table_form from">
+      <div class="materialId">
+        <span class="text"> 物资: </span>
+        <el-button type="primary" class="btn" @click="table = true">浏览</el-button>
+      </div>
+    </div>
+    <!-- 车序号表格 -->
+    <div class="switch" v-if="selectionList.length > 0">
+      <el-tooltip placement="top">
+        <div slot="content">下面表格已有数据,不能进行更改!!!</div>
+        <el-switch
+          v-model="value"
+          active-text="重量"
+          inactive-text="件数"
+          disabled
+        >
+        </el-switch>
+      </el-tooltip>
+    </div>
+    <div class="switch" v-else>
+      <el-tooltip placement="top">
+        <div slot="content">当下面表格有数据之后,将不能进行更改!!!</div>
+        <el-switch v-model="value" active-text="重量" inactive-text="件数">
+        </el-switch>
+      </el-tooltip>
+    </div>
+
+    <div class="selectionTable from">
+      <el-table
+        :data="selectionList"
+        border
+        style="width: 100%"
+        highlight-current-row
+      >
+        <el-table-column
+          v-for="(item, i) in tableTop"
+          :key="i"
+          :prop="item.prop"
+          :label="item.label"
+          :width="item.width"
+          align="center"
+          show-overflow-tooltip
+        >
+          <template slot="scope" v-if="item.label !== '件数'">
+            <span>{{ item.label }}</span>
+          </template>
+          <template slot="scope" v-if="item.label !== '车序号'">
+            <span>{{ item.label }}</span>
+          </template>
+          <template slot="scope" v-if="item.label !== '收货地址'">
+            <span>{{ item.label }}</span>
+          </template>
+          <template slot="scope" v-if="item.label !== '收货日期'">
+            <span>{{ item.label }}</span>
+          </template>
+          <template slot="scope" v-if="item.label !== '收货姓名'">
+            <span>{{ item.label }}</span>
+          </template>
+          <template slot="scope" v-if="item.label !== '收货方电话'">
+            <span>{{ item.label }}</span>
+          </template>
+          <!-- 插入输入框 -->
+          <template slot-scope="scope">
+            <template v-if="item.slot">
+              <!-- 物资件数 -->
+              <template v-if="item.prop == 'orderPlanWeight'">
+                <el-input
+                  class="textinput"
+                  v-model.number="scope.row.orderPlanWeight"
+                ></el-input>
+              </template>
+              <!-- 车序号 -->
+              <template v-if="item.prop == 'cxh'">
+                <el-input
+                  class="textinput1"
+                  v-model.number="scope.row.cxh"
+                ></el-input>
+              </template>
+              <!-- 收货地址id -->
+              <template style="width: 400px" v-if="item.prop == 'saleShipperAddressName'">
+                <el-input style="width: 200px" v-model="scope.row.saleShipperAddressName" disabled>
+                </el-input>
+                <el-button type="primary" @click="ondrawer(scope.row,scope.$index)"
+                  >浏览</el-button
+                >
+              </template>
+              <!-- 收货日期 -->
+              <template v-if="item.prop == 'saleDateOfReceipt'">
+                <el-date-picker
+                  class="textinput3"
+                  type="date"
+                  v-model.number="scope.row.saleDateOfReceipt"
+                ></el-date-picker>
+              </template>
+              <!-- 收货客户 -->
+              <template v-if="item.prop == 'saleOrderConsignee'">
+                <el-input
+                  class="textinput4"
+                  v-model.number="scope.row.saleOrderConsignee"
+                ></el-input>
+              </template>
+              <!-- 收货客户电话号码 -->
+              <template v-if="item.prop == 'saleOrderConsigneeTel'">
+                <el-input
+                  class="textinput5"
+                  v-model.number="scope.row.saleOrderConsigneeTel"
+                ></el-input>
+              </template>
+            </template>
+            <template v-else>
+              <span>{{ scope.row[item.prop] }}</span>
+            </template>
+          </template>
+        </el-table-column>
+        <!-- 操作列 -->
+        <el-table-column fixed="right" label="操作" width="100">
+          <template slot-scope="scope">
+            <el-button
+              @click.native.prevent="deleteRow(scope.$index, selectionList)"
+              type="text"
+              icon="el-icon-close"
+              size="big"
+            ></el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <el-drawer
+      :visible.sync="drawer"
+      :direction="direction"
+      :close-on-press-escape="true"
+      :show-close="true"
+      :wrapperClosable="true"
+      modal
+      size="30%"
+    >
+      <el-input
+        placeholder="请输入内容"
+        v-model="textInput"
+        style="margin-top: 10px; margin-left: 20px;width: 200px"
+        clearable
+      >
+      </el-input>
+      <el-button
+        type="primary"
+        class="btn"
+        @click="onclick1()"
+        style="margin-bottom: 15px"
+      >
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <dilTable
+        v-bind.sync="frist"
+        @radio-change="currentRadioChange1"
+      ></dilTable>
+    </el-drawer>
+    <el-drawer
+      title="选择物资信息"
+      :visible.sync="table"
+      direction="rtl"
+      size="50%"
+      :show-close="false"
+    >
+      <el-input placeholder="请输入内容" v-model="input"  
+      style="margin-top: 10px; margin-left: 20px;width:160px" clearable> </el-input
+      ><el-button type="primary" class="btn" @click="onclick" style="margin-left: 4px;">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <el-button @click="open">取消</el-button>
+      <el-button type="primary" @click="makeSure1">确定</el-button>
+      <div class="tablecls">
+        <!-- 查询所有的物资 -->
+        <dilTable v-bind.sync="option" @selection-change="selectionChange">
+        </dilTable>
+      </div>
+    </el-drawer>
+
+    <div class="button-box">
+      <el-button @click="cancel">取消</el-button>
+      <el-button type="primary" @click="makeSure">确定</el-button>
+    </div>
+  </div>
+</template>
+<script>
+import PageTitle from "@/components/Page/Title";
+
+export default {
+  components: { PageTitle },
+  data() {
+    return {
+      textInput: "",
+      input: "",
+      option: {
+        // 表格请求数据的地址
+        requestUrl: "api/v1/ams/getSaleOrderAndMaterialById?apiId=410&saleOrderId=" + this.$route.params.saleOrderId,
+        // 控制显示多选列
+        selectionType: "select",
+      },
+      table: false,
+      selectionList: [],
+      selectionList1: [],
+      drawer: false,
+      direction: "rtl",
+      form1: {},
+      value: false,
+      frist: {
+        requestUrl: "/api/v1/ams/getAddressDeliveryAddress?apiId=255",
+        selectionType: "radio",
+        mapList: [],
+      },
+      options: [
+        {
+          values: "yes",
+          label: "是",
+        },
+        {
+          values: "no",
+          label: "否",
+        },
+      ],
+      values: "yes",
+      tableTop: [
+        {
+          prop: "materialCode",
+          label: "物资编码",
+          width: "120",
+        },
+        {
+          prop: "cxh",
+          label: "车序号",
+          slot: true,
+        },
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: "140",
+        },
+        {
+          prop: "Specification",
+          label: "规格型号",
+          width: "140",
+        },
+        {
+          prop: "orderPlanWeight",
+          label: "件数",
+          slot: true,
+        },
+        {
+          prop: "saleShipperAddressName",
+          label: "收货地址",
+          width: "300",
+          slot: true,
+        },
+        {
+          prop: "saleDateOfReceipt",
+          label: "收货日期",
+          width: "110",
+          slot: true,
+        },
+        {
+          prop: "saleOrderConsignee",
+          label: "收货客户",
+          slot: true,
+        },
+        {
+          prop: "saleOrderConsigneeTel",
+          label: "收货客户电话号码",
+          slot: true,
+        },
+      ],
+      row: {},
+    };
+  },
+  // mounted() {
+  //   this.dianji();
+  // },
+  watch: {
+    value() {
+      if (this.value) {
+        this.tableTop[4]={
+          prop: "orderPlanWeight",
+          label: "重量",
+          slot: true,
+        };
+      } else {
+        this.tableTop[4]={
+          prop: "orderPlanWeight",
+          label: "件数",
+          slot: true,
+        };
+      }
+    },
+  },
+  methods: {
+    deleteRow(index, rows) {
+      rows.splice(index, 1);
+    },
+    //点击浏览事件
+    ondrawer(row,index) {
+      this.row = row;
+      this.row.index = index;
+      this.drawer = true;
+    },
+    //监听模态框点击事件
+    currentRadioChange1(radioList) {
+      this.selectionList[this.row.index].saleShipperAddressId = radioList.addressId;
+      this.selectionList[this.row.index].saleShipperAddressName = radioList.address;
+    },
+    //收货地址模态框查询
+    onclick1() {
+      this.option.requestUrl =
+        "/api/v1/ams/getAddressDeliveryAddress?apiId=255&con=" + this.textInput;
+    },
+    // dianji() {
+    //   this.axios.get("/api/v1/ams/getAddressDeliveryAddress").then((res) => {
+    //     if (res.data.code == "200") {
+    //       console.log(res);
+    //       this.options1 = res.data.data;
+    //     }
+    //   });
+    // },
+    //物资模态框查询
+    // 框计算
+    onclick() {
+      this.option.requestUrl =
+      "api/v1/ams/getSaleOrderAndMaterialById?apiId=410&saleOrderId=" + this.$route.params.saleOrderId;
+        //"/api/v1/uc/queryMaterialByLike?apiId=244&index=" + this.input;
+    },
+    open() {
+      if (this.selectionList1.length != 0) {
+        this.$confirm("取消会将已选择的数据清空, 是否继续?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(() => {
+            this.selectionList1 = [];
+            this.table = false;
+          })
+          .catch(() => {});
+      } else {
+        this.table = false;
+      }
+    },
+    // 返回主界面
+    makeSure1() {
+      this.selectionList1.forEach((e) => {
+        var addmap = {
+          materialCode: e.materialCode,
+          cxh: null,
+          materialName: e.materialName,
+          Specification: e.specificationModel,
+          orderPlanWeight: null,
+          saleShipperAddressId: null,
+          saleShipperAddressName:null,
+          saleDateOfReceipt: null,
+          saleOrderConsignee: null,
+          saleOrderConsigneeTel: null,
+          saleMaterialId: e.saleMaterialId,
+          materialTheoreticalWeight: e.materialTheoreticalWeight,
+        };
+        this.selectionList.push(addmap);
+      });
+      this.selectionList1 = [];
+      this.table = false;
+    },
+    // 返回选中的物资信息
+    selectionChange(selection) {
+      this.selectionList1 = [];
+      this.selectionList1 = selection;
+      console.log("this.selectionList1 ",this.selectionList1)
+    },
+    // 确定
+    makeSure() {
+        //初始化maplist
+      var mapList = [];
+      console.log("this.selectionList",this.selectionList)
+      this.selectionList.forEach((item,i) => {
+        //初始化mapItem
+        var mapItem={
+                //销售订单id
+                saleOrderId : 0,
+                //车序号    
+                truckNo : "",
+                //收货地址id
+                shippingAddressId : 0,
+                //收货日期
+                dateOfReceipt :null,
+                //收货方姓名   
+                orderConsignee :"",
+                //收货方电话 
+                orderConsigneeTel :"",
+                //车序号物资ID
+                saleMaterialId : 0,
+                //物资数量
+                materialNumber : 0,
+            };
+        mapItem.saleOrderId=this.$route.params.saleOrderId;
+        mapItem.truckNo=item.cxh;
+        mapItem.shippingAddressId=item.saleShipperAddressId;
+        mapItem.dateOfReceipt=item.saleDateOfReceipt;
+        mapItem.orderConsignee=item.saleOrderConsignee;
+        mapItem.orderConsigneeTel=item.saleOrderConsigneeTel;
+        mapItem.saleMaterialId=item.saleMaterialId;
+        mapItem.materialNumber=item.orderPlanWeight;
+        mapList.push(mapItem);
+      });
+      console.log("mapList",mapList);
+        this.axios.post("api/v1/ams/addTruckNo", mapList).then((res) => {
+          if (res.data.code == "200") {
+            this.$router.go(-1);
+          }
+        });
+        
+    },
+    // 取消
+    cancel() {
+      this.$router.go(-1);
+    },
+    //关闭事件
+    handleClose(done) {
+      this.$confirm("确认关闭?")
+        .then((_) => {
+          done();
+        })
+        .catch((_) => {});
+    },
+
+    CloseClick() {},
+  },
+};
+</script>
+<style lang='scss' scoped>
+.addSalePlan{
+  width: 100%;
+}
+.switch{
+  margin-left: 60rem;
+}
+.form-box,
+.from {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-top: 5px;
+  margin-bottom: 20px;
+}
+.button-box{
+  display: flex;
+  text-align: center;
+  align-items: center;
+  justify-content: center;
+  margin-top: 0.3125rem;
+  margin-bottom: 1.25rem;
+}
+.select {
+  margin-left: -10rem;
+}
+.demo-form-inline {
+  margin-left: 2rem;
+}
+.table_form {
+  margin-left: -16rem;
+}
+.textinput {
+  width: 50px;
+}
+.textinput1 {
+  width: 50px;
+  text-align: center;
+  size: small;
+}
+.textinput2 {
+  width: 50px;
+  margin-right: 30px;
+}
+.textinput3 {
+  width: 270px;
+}
+.textinput4 {
+  width: 60px;
+}
+.textinput5 {
+  width: 120px;
+}
+</style>

+ 15 - 15
src/views/appoint/components/saleContract/saleOrder.vue

@@ -65,19 +65,19 @@
       <!-- 销售公司已审批 -->
        <el-tab-pane label="销售公司已审批" name="four">
         <dilTable v-bind.sync="option4">
-          <el-table-column fixed="right" label="操作" width="200">
+          <el-table-column fixed="right" label="操作" width="130">
             <template slot-scope="scope">
               <el-button
-                @click="lookclick(scope.row.saleOrderId)"
+                @click="addClick(scope.row.saleOrderId)"
                 type="text"
                 size="small"
-                >查看修改地址</el-button
+                >新增车序号</el-button
               >
               <el-button
-                @click="passclick(scope.row.saleOrderId)"
+                @click="detailedClick(scope.row.saleOrderId)"
                 type="text"
                 size="small"
-                >修改日志</el-button
+                >物资详情</el-button
               >
             </template>
           </el-table-column>
@@ -96,22 +96,22 @@ export default {
       option: {
         // 表格请求数据的地址
         requestUrl:
-          "/api/v1/ams/getSaleOrderInfo?apiId=98",
+          "/api/v1/ams/getSaleOrderInfoes?apiId=408",
       },
       option2: {
         // 表格请求数据的地址
         requestUrl:
-          "/api/v1/ams/getSaleOrderReported?apiId=98",
+          "/api/v1/ams/getSaleOrderReportedes?apiId=408",
       },
       option3: {
         // 表格请求数据的地址
         requestUrl:
-          "/api/v1/ams/getAmsSaleOrderApproved?apiId=105",
+          "/api/v1/ams/getAmsSaleOrderApprovedes?apiId=409",
       },
       option4: {
         // 表格请求数据的地址
         requestUrl:
-          "/api/v1/ams/getSaleOrderListBySaleCompany?apiId=105",
+          "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409",
       },
       
     };
@@ -127,18 +127,18 @@ export default {
     seeclick(saleOrderId) {
       this.$router.push("/saleOrderDetail/" + saleOrderId);
     },
-    lookclick(saleOrderId) {
-      this.$router.push("/saleOrderDetailApproved/" + saleOrderId);
-    },
-    passclick(saleOrderId) {
-      this.$router.push("/saleOrderUpdateLog/" + saleOrderId);
-    },
     btnclick() {
       this.$router.push("/addSaleOrder");
     },
     click(saleOrderId) {
       this.$router.push("/editSaleOrder/" + saleOrderId);
     },
+    addClick(saleOrderId){
+      this.$router.push("/addSaleOrderArrange/" + saleOrderId);
+    },
+    detailedClick(saleOrderId){
+      this.$router.push("saleOrderMaterial/" + saleOrderId);
+    },
     // 上传
     uploadclick(saleOrderId) {
       this.$confirm("是否上传", "提示", {

+ 118 - 0
src/views/appoint/components/saleContract/saleOrderArrange.vue

@@ -0,0 +1,118 @@
+//  销售订单排车
+<template>
+  <div class="steel_inbound">
+    <div class="sache">
+      <el-input placeholder="请输入内容" v-model="inputText" clearable>
+      </el-input>
+      <el-button type="primary" class="btn">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <el-button type="primary" class="btn" @click="Issue()">
+        <i class="el-icon-download"></i>下发
+      </el-button>
+    </div>
+    <template>
+      <div>
+        <dilTable v-bind.sync="first" @selection-change="selectionChange">
+            <el-table-column fixed="right" label="操作" width="150">
+                <template slot-scope="scope">
+                <el-button
+                @click="lookclick(scope.row.saleOrderId)"
+                type="text"
+                size="small"
+                >查看修改地址</el-button
+              >
+              <el-button
+                @click="passclick(scope.row.saleOrderId)"
+                type="text"
+                size="small"
+                >修改日志</el-button
+              >
+                </template>
+            </el-table-column>
+        </dilTable>
+      </div>
+    </template>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      inputText: "",
+      first: {
+        // first请求数据的地址
+        requestUrl: "/api/v1/ams/getTruckNoList?apiId=411&issueStatus=0",
+        selectionType: "select",
+        mapList: [],
+      },
+      activeName: "first",
+    };
+  },
+  methods: {
+    Issue(){
+    if(this.first.mapList.length==0){
+      this.$message({
+            type: "warning",
+            message: "请先选择订单!",
+          });
+    }else{
+    this.$confirm("是否下发", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true,
+      })
+      .then(() => {
+      //初始化maplist
+      var mapList = [];
+      this.first.mapList.forEach((item,i) => {
+        //初始化mapItem
+        var mapItem={
+                //销售订单物资中间表id
+                saleOrderMaterialId : 0,
+            };
+        mapItem.saleOrderMaterialId=item.saleOrderMaterialId;
+        mapList.push(mapItem);
+      });
+          this.$message({
+            type: "success",
+            message: "下发成功!",
+          });
+         this.axios.post("api/v1/ams/issueTruckNo", mapList).then((res) => {
+          if (res.data.code == "200") {
+            this.$router.go(0);
+          }
+        });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "取消上传!",
+          });
+        });
+    }
+    },
+    lookclick(saleOrderId) {
+      this.$router.push("/saleOrderDetailApproved/" + saleOrderId);
+    },
+    passclick(saleOrderId) {
+      this.$router.push("/saleOrderUpdateLog/" + saleOrderId);
+    },
+    selectionChange(selection) {
+      this.first.mapList = selection;
+    },
+  },
+};
+</script>
+<style lang="scss" scode>
+.steel_inbound {
+  .sache {
+    padding: 1.25rem 0.375rem;
+    .el-input {
+      width: 20%;
+      margin-right: 1.25rem;
+    }
+  }
+}
+</style>

+ 41 - 0
src/views/appoint/components/saleContract/saleOrderMaterial.vue

@@ -0,0 +1,41 @@
+//  销售订单物资详情
+<template>
+  <div class="steel_inbound">
+      <page-title>销售订单物资详情</page-title>
+    <template>
+      <div>
+        <dilTable v-bind.sync="first">
+        </dilTable>
+      </div>
+    </template>
+  </div>
+</template>
+<script>
+import PageTitle from "@/components/Page/Title";
+export default {
+  components: { PageTitle },
+  data() {
+    return {
+      inputText: "",
+      first: {
+        // first请求数据的地址
+        requestUrl: "api/v1/ams/getSaleOrderAndMaterialById?apiId=410&saleOrderId=" + this.$route.params.saleOrderId,
+      },
+      activeName: "first",
+    };
+  },
+  methods: {
+  },
+};
+</script>
+<style lang="scss" scode>
+.steel_inbound {
+  .sache {
+    padding: 1.25rem 0.375rem;
+    .el-input {
+      width: 20%;
+      margin-right: 1.25rem;
+    }
+  }
+}
+</style>

+ 6 - 0
src/views/appoint/router/index.js

@@ -32,6 +32,7 @@ import updateShipPrice from '../components/purchase/updateShipPrice.vue'
 import updateTrainPrice from '../components/purchase/updateTrainPrice.vue'
 import updateTruckPrice from '../components/purchase/updateTruckPrice.vue'
 import addSaleOrder from '../components/saleContract/addSaleOrder.vue'
+import addSaleOrderArrange from '../components/saleContract/addSaleOrderArrange.vue'
 import addSalePlan from '../components/saleContract/addSalePlan.vue'
 import addSalePlanDetail from '../components/saleContract/addSalePlanDetail.vue'
 import addTransportPrice from '../components/saleContract/addTransportPrice.vue'
@@ -44,8 +45,10 @@ import editSalePlan from '../components/saleContract/editSalePlan.vue'
 import editTransportPrice from '../components/saleContract/editTransportPrice.vue'
 import editTruckNoDetail from '../components/saleContract/editTruckNoDetail.vue'
 import saleOrder from '../components/saleContract/saleOrder.vue'
+import saleOrderArrange from '../components/saleContract/saleOrderArrange.vue'
 import saleOrderDetail from '../components/saleContract/saleOrderDetail.vue'
 import saleOrderDetailApproved from '../components/saleContract/saleOrderDetailApproved.vue'
+import saleOrderMaterial from '../components/saleContract/saleOrderMaterial.vue'
 import saleOrderUpdateLog from '../components/saleContract/saleOrderUpdateLog.vue'
 import salePlan from '../components/saleContract/salePlan.vue'
 import transportPrice from '../components/saleContract/transportPrice.vue'
@@ -85,8 +88,10 @@ const constantRouterMap = [
       {path: 'updateTrainPrice/:priceId', name: 'updateTrainPrice', meta: {code: 'xtpzgl-yhgl'}, component: updateTrainPrice},
       {path: 'updateTruckPrice/:priceId', name: 'updateTruckPrice', meta: {code: 'xtpzgl-yhgl'}, component: updateTruckPrice},
       {path: 'addSaleOrder', name: 'addSaleOrder', meta: {code: 'xtpzgl-jggl'}, component: addSaleOrder},
+      {path: 'addSaleOrderArrange/:saleOrderId', name: 'addSaleOrderArrange', meta: {code: 'xtpzgl-jggl'}, component: addSaleOrderArrange},
       {path: 'addSalePlan', name: 'addSalePlan', meta: {code: 'xtpzgl-yhgl'}, component: addSalePlan},
       {path: 'addSalePlanDetail/:planId', name: 'addSalePlanDetail', meta: {code: 'xtpzgl-yhgl'}, component: addSalePlanDetail},
+      {path: 'saleOrderMaterial/:saleOrderId', name: 'saleOrderMaterial', meta: {code: 'xtpzgl-yhgl'}, component: saleOrderMaterial},
       {path: 'addTransportPrice', name: 'addTransportPrice', meta: {code: 'xtpzgl-yhgl'}, component: addTransportPrice},
       {path: 'addTruckNoDetail/:saleOrderMaterialId', name: 'addTruckNoDetail', meta: {code: 'xtpzgl-yhgl'}, component: addTruckNoDetail},
       {path: 'editaddress/:saleOrderMaterialId', name: 'editaddress', meta: {code: 'xtpzgl-yhgl'}, component: editaddress},
@@ -97,6 +102,7 @@ const constantRouterMap = [
       {path: 'editTransportPrice/:priceId', name: 'editTransportPrice', meta: {code: 'xtpzgl-yhgl'}, component: editTransportPrice},
       {path: 'editTruckNoDetail/:trucknoMaterialId', name: 'editTruckNoDetail', meta: {code: 'xtpzgl-yhgl'}, component: editTruckNoDetail},
       {path: 'saleOrder', name: 'saleOrder', meta: {code: 'xtpzgl-yhgl'}, component: saleOrder},
+      {path: 'saleOrderArrange', name: 'saleOrderArrange', meta: {code: 'xtpzgl-yhgl'}, component: saleOrderArrange},
       {path: 'saleOrderDetail/:saleOrderId', name: 'saleOrderDetail', meta: {code: 'xtpzgl-yhgl'}, component: saleOrderDetail},
       {path: 'saleOrderDetailApproved/:saleOrderId', name: 'saleOrderDetailApproved', meta: {code: 'xtpzgl-yhgl'}, component: saleOrderDetailApproved},
       {path: 'saleOrderUpdateLog/:saleOrderId', name: 'saleOrderUpdateLog', meta: {code: 'xtpzgl-yhgl'}, component: saleOrderUpdateLog},

+ 121 - 41
src/views/sale/components/transport_appointment/directionalDispatch.vue

@@ -10,7 +10,7 @@
       <el-button
         type="primary"
         class="btn"
-        @click="Issue"
+        @click="table = true"
         v-if="activeName == 'first'"
       >
         <i class="el-icon-download"></i>下发
@@ -40,6 +40,28 @@
         </el-tabs>
       </div>
     </template>
+
+    <!-- 承运商模态框 -->
+    <el-drawer
+      title="选择承运商"
+      :visible.sync="table"
+      direction="rtl"
+      size="35%"
+      :show-close="false"
+    >
+      <el-input placeholder="请输入内容" v-model="index"  
+      style="margin-top: 10px; margin-left: 20px;width:160px" clearable> </el-input
+      ><el-button type="primary" class="btn" @click="onclick" style="margin-left: 4px;">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <!-- <el-button @click="open">取消</el-button> -->
+      <el-button type="primary" @click="makeSure1">确定</el-button>
+      <div class="tablecls">
+        <!-- 查询所有的承运商 -->
+        <dilTable v-bind.sync="option" @radio-change="currentRadioChange1">
+        </dilTable>
+      </div>
+    </el-drawer>
   </div>
 </template>
 <script>
@@ -47,9 +69,12 @@ export default {
   data() {
     return {
       inputText: "",
+      index: "",
+      carrierId: 0,
+      table:false,
       first: {
         // first请求数据的地址
-        requestUrl: "/api/v1/ams/getSaleOrderList?apiId=181&status=1",
+        requestUrl: "/api/v1/ams/getTruckNoList?apiId=411&issueStatus=1",
         selectionType: "select",
         mapList: [],
       },
@@ -58,6 +83,12 @@ export default {
         requestUrl: "/api/v1/ams/getSaleOrderList?apiId=245&status=0",
       },
       activeName: "first",
+      option: {
+        requestUrl: "/api/v1/uc/getCarrierListByLike?apiId=412",
+        selectionType: "radio",
+        mapList: [],
+      },
+
     };
   },
   methods: {
@@ -99,49 +130,98 @@ export default {
     selectionChange(selection) {
       this.first.mapList = selection;
     },
-    Issue() {
-      console.log();
-      if (this.first.mapList.length !== 0) {
-        this.$confirm("是否下发", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-          center: true,
-        })
-          .then(() => {
-            this.axios
-              .post(
-                "/api/v1/ams/addFixedAmsDispatchSaleOrder",
-                this.first.mapList
-              )
-              .then((res) => {
-                if (res.data.code == "200") {
-                  this.$message({
-                    type: "success",
-                    message: "下发成功!",
-                  });
-				  this.$router.go(0)
-                } else {
-                  this.$message({
-                    message: "下发失败",
-                    type: "warning",
-                  });
-                }
-              });
-          })
-          .catch(() => {
-            this.$message({
-              type: "info",
-              message: "取消下发!",
-            });
-          });
-      } else {
+    //点击下发事件
+    ondrawer() {
+      // this.row = row;
+      // this.row.index = index;
+      this.drawer = true;
+    },
+    //监听模态框点击事件
+    currentRadioChange1(row) {
+      this.carrierId = row.carrierId;
+    },
+    //模糊查询承运商
+    onclick(){
+      this.option.requestUrl =
+      "/api/v1/uc/getCarrierListByLike?apiId=412&index=" + this.index;
+    },
+    // 返回主界面并下发
+    makeSure1() {
+      if(this.first.mapList.length==0){
         this.$message({
-          type: "warning",
-          message: "请选择订单后再下发!",
+            type: "warning",
+            message: "请先选择订单!",
+          });
+      }else{
+      //初始化maplist
+      var mapList = [];
+      this.first.mapList.forEach((item,i) => {
+        //初始化mapItem
+        var mapItem={
+                //销售订单物资中间表id
+                saleOrderMaterialId : 0,
+            };
+        mapItem.saleOrderMaterialId=item.saleOrderMaterialId;
+        mapList.push(mapItem);
+      });
+      //初始化
+      let map = {
+        //承运商ID
+        carrierId : this.carrierId,
+        //销售订单物资中间表id的mapList
+        mapList : mapList
+      }
+      this.axios.post("api/v1/ams/addDispatchSaleOrder", map).then((res) => {
+          if (res.data.code == "200") {
+            this.$router.go(0);
+          }
         });
       }
+      
     },
+    // Issue() {
+    //   console.log();
+    //   if (this.first.mapList.length !== 0) {
+    //     this.$confirm("是否下发", "提示", {
+    //       confirmButtonText: "确定",
+    //       cancelButtonText: "取消",
+    //       type: "warning",
+    //       center: true,
+    //     })
+    //       .then(() => {
+    //         this.axios
+    //           .post(
+    //             "/api/v1/ams/addFixedAmsDispatchSaleOrder",
+    //             this.first.mapList
+    //           )
+    //           .then((res) => {
+    //             if (res.data.code == "200") {
+    //               this.$message({
+    //                 type: "success",
+    //                 message: "下发成功!",
+    //               });
+		// 		  this.$router.go(0)
+    //             } else {
+    //               this.$message({
+    //                 message: "下发失败",
+    //                 type: "warning",
+    //               });
+    //             }
+    //           });
+    //       })
+    //       .catch(() => {
+    //         this.$message({
+    //           type: "info",
+    //           message: "取消下发!",
+    //         });
+    //       });
+    //   } else {
+    //     this.$message({
+    //       type: "warning",
+    //       message: "请选择订单后再下发!",
+    //     });
+    //   }
+    // },
   },
 };
 </script>

+ 15 - 13
src/views/sale/components/transport_appointment/openDistribution.vue

@@ -29,23 +29,24 @@
 				<dilTable v-bind.sync="second">
           <el-table-column fixed="right" label="操作" width="50">
             <template slot-scope="scope">
-          <el-button @click="dispatch(scope) ,handleBtnClick1() " type="text" size="small">
+          <el-button @click="dispatch(scope)  " type="text" size="small">
+            <!-- ,handleBtnClick1() -->
             派单
           </el-button>
             </template>
       </el-table-column>
       </dilTable>
-      <el-drawer title="司机排班信息表" :visible.sync="drawer" :direction="direction" :before-close="handleClose"
+      <!-- <el-drawer title="司机排班信息表" :visible.sync="drawer" :direction="direction" :before-close="handleClose"
 				:modal="false" size="30%" style="margin-top: 5.625rem;">
-        <el-input placeholder="请输入内容" v-model="input"  style="margin-top:10px;margin-left:20px" clearable> </el-input>
+        <el-input placeholder="请输入内容" v-model="input"  style="margin-top:10px;margin-left:20px;width:160px" clearable> </el-input>
       <el-button type="primary" class="btn" @click="onclick()"  style="margin-bottom:15px">
         <i class="el-icon-search"></i>查询
       </el-button>
 				<dilTable v-bind.sync="third" @radio-change="currentRadioChange"></dilTable>
-				<div style=" margin-left: 25rem;">
+				<div>
 					<el-button type="primary" @click="makeSure">派发</el-button>
 				</div>
-			</el-drawer>
+			</el-drawer> -->
 		</el-tab-pane>
     </el-tabs>
     
@@ -68,7 +69,7 @@ export default {
         requestUrl: "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0",
       },
       second:{
-        requestUrl:"/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierId=6",
+        requestUrl:"/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierId=73",
       },
       third:{
         requestUrl:"/api/v1/oms/getCapacityAndDriverList?apiId=246",
@@ -91,11 +92,12 @@ export default {
     },
     dispatch(scope){
       this.dispatchId = scope.row.dispatchId
+      this.$router.push("/openDistributionSection/" + scope.row.dispatchId);
     },
-    handleBtnClick1(){
+    // handleBtnClick1(){
 
-				this.drawer=true
-			},
+		// 		this.drawer=true
+		// 	},
       currentRadioChange(selection) {
 				this.mapList = selection
         console.log(this.mapList)
@@ -113,7 +115,7 @@ export default {
         })
         .then(() => {
         this.axios.post("/api/v1/oms/addAppTruckOrder?orderType=" + 1 + 
-        "&carrierId="+ 5 +"&dispatchId=" + this.dispatchId 
+        "&carrierId="+ 73 +"&dispatchId=" + this.dispatchId 
         + "&capacityNumber=" + this.mapList.capacityNumber)
         .then((res) => {
           if(res.data.code == 200){
@@ -139,7 +141,7 @@ export default {
       },
   	Grab(scope){
       console.log(scope)
-      this.$confirm("是否抢单", "提示", {
+      this.$confirm("是否接收", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
@@ -147,12 +149,12 @@ export default {
       })
         .then(() => {
           this.axios
-            .post("/api/v1/ams/lockDispatchSaleOrder?dispatchId="+ scope.row.dispatchId+"&carrierId=" + 6)
+            .post("/api/v1/ams/lockDispatchSaleOrder?dispatchId="+ scope.row.dispatchId+"&carrierId=" + 73)
             .then((res) => {
               if (res.data.code == 200) {
                 this.$message({
                   type: "success",
-                  message: "单成功!",
+                  message: "单成功!",
                 });     
                 this.$router.go(0);
               } else {

+ 254 - 0
src/views/sale/components/transport_appointment/openDistributionSection.vue

@@ -0,0 +1,254 @@
+<template>
+  <!-- 定向派单接单选择路段顺序号 -->
+  <div id="contractDetails">
+    <page-title>选择路段顺序号和车</page-title>
+
+    <div class="lineId from">
+      <div class="materialId">
+        <span class="text">选择路线:</span>
+        <el-input class="input" v-model="lineName" disabled> </el-input>
+        <el-button type="primary" class="btn" @click="table = true">浏览</el-button>
+      </div>
+    </div>
+    
+    <div class="lineId from">
+      <div class="materialId">
+        <span class="text">选择车辆:</span>
+        <el-input class="input" v-model="capacityNumber" disabled> </el-input>
+        <el-button type="primary" @click="drawer = true" class="truckBtn"
+          >浏览</el-button
+        >
+      </div>
+    </div>
+    
+    <!-- 模态窗口 -->
+    <el-drawer
+      title="选择路线"
+      :visible.sync="table"
+      direction="rtl"
+      size="50%"
+      :show-close="false"
+    >
+      <el-input placeholder="请输入内容" v-model="input"  
+      style="margin-top: 10px; margin-left: 20px;width:160px" clearable> </el-input
+      ><el-button type="primary" class="btn" @click="onclick1" style="margin-left: 4px;">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <div class="tablecls">
+        <!-- 查询所有的路线 -->
+        <dilTable
+          v-bind.sync="line" @radio-change="currentRadioChange5"
+        ></dilTable>
+      </div>
+    </el-drawer>
+
+    <el-drawer title="选择车" :visible.sync="drawer" :direction="direction" :before-close="handleClose"
+				:modal="false" size="30%" style="margin-top: 5.625rem;">
+        <el-input placeholder="请输入内容" v-model="input"  style="margin-top:10px;margin-left:20px;width:160px" clearable> </el-input>
+      <el-button type="primary" class="btn" @click="onclick2()"  style="margin-bottom:15px">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <!-- 查询所有的车 -->
+            <dilTable v-bind.sync="third" @radio-change="currentRadioChange"></dilTable>
+            <!-- <div>
+                <el-button type="primary" @click="makeSure">派发</el-button>
+            </div> -->
+	</el-drawer>
+
+    <div class="button_box">
+      <el-button @click="onClickCancel">返回</el-button>
+      <el-button type="primary" @click="onClickConfirm">确认</el-button>
+    </div>
+  </div>
+</template>
+<script>
+import PageTitle from "@/components/Page/Title";
+import { sjTime,isNumber,isIntegerNumber } from '@/utils/sharedJsFile'
+export default {
+  components: { PageTitle },
+  data() {
+    return {
+      table: false,
+      drawer: false,
+      // 线路名称
+      lineName: "",
+      //线路id
+      lineId: null,
+      // 车牌号
+      capacityNumber: "",
+      direction: "rtl",
+      input: "",
+      third: {
+        requestUrl: "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248",
+        selectionType: "radio",
+        mapList3: [],
+      },
+      line: {
+        requestUrl: "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3",
+        selectionType: "radio",
+      },
+    };
+  },
+  methods: {
+    onClick(index) {
+      this.selectionList.splice(index, 1);
+    },
+    onclick1() {
+        
+        this.option.requestUrl =
+          "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con=" + this.input;
+
+    },
+    onclick2(){
+        this.third.requestUrl =
+          "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&index=" +
+          this.input;
+    },
+    
+    // 返回
+    onClickCancel() {
+      this.$router.push("/openDistribution");
+    },
+    currentRadioChange(selection) {
+      this.capacityNumber = selection.capacityNumber;
+    },
+    currentRadioChange5(selection) {
+      this.lineName = selection.lineName;
+      this.lineId = selection.lineId;
+    },
+    // 确认
+    onClickConfirm() {
+      let map = {
+          orderType : 1,
+          lineId: this.lineId,
+          dispatchId: this.$route.params.dispatchId,
+          capacityNumber: this.capacityNumber,
+      }
+    //   console.log("map",map);
+      this.axios.post("api/v1/oms/addSaleTruckOrder", map).then((res) => {
+          if (res.data.code == "200") {
+            this.$router.go(-1);
+          }
+        });
+    },
+  },
+};
+</script>
+
+<style lang="scss" >
+.contractDetails {
+  width: 100%;
+}
+.from {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-top: 5px;
+  margin-bottom: 20px;
+}
+.remark {
+  display: flex;
+  justify-content: center;
+  .text {
+    display: inline-block;
+    width: 100px;
+    text-align: right;
+  }
+  .input{
+    width: 250px;
+    margin-right: 20px;
+  }
+}
+.lineId {
+  display: flex;
+  justify-content: center;
+  .text {
+    display: inline-block;
+    width: 170px;
+    text-align: right;
+  }
+  .input{
+    width: 250px;
+    margin-right: 20px;
+  }
+}
+.material {
+  display: flex;
+  justify-content: center;
+  margin-top: 20px;
+  .text {
+    display: inline-block;
+    width: 170px;
+    text-align: right;
+  }
+  .input{
+    width: 250px;
+    margin-right: 20px;
+  }
+}
+.orderType{
+  display: flex;
+  justify-content: center;
+  .text {
+    display: inline-block;
+    width: 110px;
+    text-align: right;
+  }
+  .select{
+    width: 250px;
+  }
+  .span{
+    display: inline-block;
+    width: 30px;height: 10px;
+  }
+}
+.contractTitle{
+  display: flex;
+  justify-content: center;
+  .el-form-item{
+    display: flex;
+    justify-content: center;
+    .el-form-item__label{
+      display: flex;
+      align-items: center;
+    }
+    .el-input{
+      width: 250px;
+    }
+  }
+}
+.forwardingUnit {
+  display: flex;
+  justify-content: center;
+  .text {
+    display: inline-block;
+    width: 170px;
+    text-align: right;
+  }
+  .input{
+    width: 250px;
+    margin-right: 20px;
+  }
+}
+.truckList1 {
+  width: 100%;
+  .truckList {
+    width: 96%;
+    .text {
+      display: inline-block;
+      width: 120px;
+      text-align: right;
+    }
+    .truckBtn {
+      width: 250px;
+    }
+  }
+}
+.button_box {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  width: 100%;
+  height: 100px;
+}
+</style>

+ 2 - 0
src/views/sale/router/index.js

@@ -41,6 +41,7 @@ import updateSteelRailPlan from '../components/transport_appointment/railPlan/up
 import addOpenDistribution from '../components/transport_appointment/addOpenDistribution.vue'
 import directionalDispatch from '../components/transport_appointment/directionalDispatch.vue'
 import openDistribution from '../components/transport_appointment/openDistribution.vue'
+import openDistributionSection from '../components/transport_appointment/openDistributionSection.vue'
 import orderGrabbing from '../components/transport_appointment/orderGrabbing.vue'
 import add_sale_dilNotice from '../components/transport_excute/dilNotice/add_sale_dilNotice.vue'
 import Carrier_dilNotice from '../components/transport_excute/dilNotice/Carrier_dilNotice.vue'
@@ -133,6 +134,7 @@ const constantRouterMap = [
 		{path: 'addOpenDistribution', name: 'addOpenDistribution', meta: {code: 'xtpzgl-yhgl'}, component: addOpenDistribution},
 		{path: 'directionalDispatch', name: 'directionalDispatch', meta: {code: 'xtpzgl-yhgl'}, component: directionalDispatch},
 		{path: 'openDistribution', name: 'openDistribution', meta: {code: 'xtpzgl-yhgl'}, component: openDistribution},
+		{path: 'openDistributionSection/:dispatchId', name: 'openDistributionSection', meta: {code: 'xtpzgl-yhgl'}, component: openDistributionSection},
 		{path: 'orderGrabbing', name: 'orderGrabbing', meta: {code: 'xtpzgl-yhgl'}, component: orderGrabbing},
 		{path: 'add_sale_dilNotice', name: 'add_sale_dilNotice', meta: {code: 'xtpzgl-yhgl'}, component: add_sale_dilNotice},
 		{path: 'Carrier_dilNotice', name: 'Carrier_dilNotice', meta: {code: 'xtpzgl-yhgl'}, component: Carrier_dilNotice},