Browse Source

Merge branch 'master' of http://git.cc-lotus.info/news-zhwl/cms-zhwl

lrf402788946 4 years ago
parent
commit
793abf3a7f

+ 5 - 40
src/views/client/addroute.vue

@@ -4,7 +4,6 @@
       <el-col :span="24" class="container">
         <el-col :span="24" class="top">
           <el-button type="primary" size="mini" style="float:left" @click="$router.go(-1)">返回</el-button>
-          <!-- <el-button type="primary" size="mini" style="float:left" @click="$router.push({ path: '/client/project' })">返回</el-button> -->
           <el-button type="primary" size="mini" style="float:right" @click="dialog = true">添加</el-button>
         </el-col>
         <el-col :span="24" class="info">
@@ -25,25 +24,7 @@
     </el-row>
     <el-dialog :visible.sync="dialog" title="线路详情" @close="toClose" width="50%">
       <!-- 物流里面的:data要换成v-model -->
-      <data-form v-model="form" :fields="fields" @save="turnSave" :rules="rules">
-        <template #options="{item}">
-          <!-- <template v-if="item.model == 'project'">
-            <el-option v-for="(item, index) in projectList" :key="index" :value="item.treaty" :label="item.name"></el-option>
-          </template> -->
-          <template v-if="item.model == 'startprovince'">
-            <el-option v-for="(item, index) in startprovinceList" :key="index" :value="item.name" :label="item.name"></el-option>
-          </template>
-          <template v-if="item.model == 'startcity'">
-            <el-option v-for="(item, index) in startcityList" :key="index" :value="item.name" :label="item.name"></el-option>
-          </template>
-          <template v-if="item.model == 'endprovince'">
-            <el-option v-for="(item, index) in endprovinceList" :key="index" :value="item.name" :label="item.name"></el-option>
-          </template>
-          <template v-if="item.model == 'endcity'">
-            <el-option v-for="(item, index) in endcityList" :key="index" :value="item.name" :label="item.name"></el-option>
-          </template>
-        </template>
-      </data-form>
+      <data-form v-model="form" :fields="fields" @save="turnSave" :rules="rules"> </data-form>
     </el-dialog>
   </div>
 </template>
@@ -62,11 +43,6 @@ export default {
   data: function() {
     return {
       fields: [
-        // { label: '所属项目', model: 'item', type: 'select', notable: true, noform: true },
-        // { label: '起始地省份', model: 's_p', type: 'select' },
-        // { label: '起始地城市', model: 's_c', type: 'select', filter: 'input' },
-        // { label: '目的地省份', model: 'e_p', type: 'select' },
-        // { label: '目的地城市', model: 'e_c', type: 'select', filter: 'input' },
         { label: '所属项目', model: 'item', notable: true, noform: true },
         { label: '起始地省份', model: 's_p', filter: 'input' },
         { label: '起始地城市', model: 's_c', filter: 'input' },
@@ -98,26 +74,15 @@ export default {
       dialog: false,
       form: {},
       rules: {
-        item: [{ required: true, message: '请选择项目名称', trigger: 'blur' }],
-        s_p: [{ required: true, message: '请选择起始地省份', trigger: 'blur' }],
-        s_c: [{ required: true, message: '请选择起始地城市', trigger: 'blur' }],
-        e_p: [{ required: true, message: '请选择目的地省份', trigger: 'blur' }],
-        e_c: [{ required: true, message: '请选择目的地城市', trigger: 'blur' }],
+        s_p: [{ required: true, message: '请输入起始地省份', trigger: 'blur' }],
+        s_c: [{ required: true, message: '请输入起始地城市', trigger: 'blur' }],
+        e_p: [{ required: true, message: '请输入目的地省份', trigger: 'blur' }],
+        e_c: [{ required: true, message: '请输入目的地城市', trigger: 'blur' }],
         name: [{ required: true, message: '请输入线路名称', trigger: 'blur' }],
         start: [{ required: true, message: '请输入起始站点', trigger: 'blur' }],
         end: [{ required: true, message: '请输入目的站点', trigger: 'blur' }],
         status: [{ required: true, message: '请选择状态', trigger: 'blur' }],
       },
-      //项目列表
-      // projectList: [],
-      //起始省份列表
-      startprovinceList: [{ name: '北京市' }, { name: '天津市' }, { name: '河北省' }, { name: '吉林省' }],
-      //起始城市列表
-      startcityList: [{ name: '长春市' }, { name: '松原市' }],
-      //目的地省份列表
-      endprovinceList: [{ name: '北京市' }, { name: '天津市' }, { name: '河北省' }, { name: '吉林省' }],
-      //目的地城市列表
-      endcityList: [{ name: '长春市' }, { name: '松原市' }],
     };
   },
   created() {

+ 0 - 1
src/views/client/addstyle.vue

@@ -139,7 +139,6 @@ export default {
   },
   created() {
     this.search();
-    console.log(this.id);
   },
   methods: {
     ...mode(['query', 'create', 'update', 'delete']),

+ 4 - 5
src/views/client/contract.vue

@@ -27,10 +27,10 @@
                 <el-option v-for="(item, index) in nameList" :key="index" :value="item.id" :label="item.name"></el-option>
               </template>
             </template>
-            <template #filterEnd>
+            <!-- <template #filterEnd>
               <el-button v-if="selected.length <= 0" type="primary" :disabled="true">未选择任何合同</el-button>
               <el-button v-else type="primary" @click="toExport">导出选中合同</el-button>
-            </template>
+            </template> -->
           </data-table>
         </el-col>
       </el-col>
@@ -127,7 +127,6 @@ export default {
     // 查合同 其他参数是...info,都包括在里面,可以输出看看
     async searchTreaty({ skip = 0, limit = 10, ...info } = {}) {
       let obj = { skip, limit, ...info };
-      console.log(info);
       //如果role不是0就是用户,用户只能查看自己添加的合同,根据创始人owner来查询属于自己添加的合同
       //用户与管理员的区别就是需不需要根据owner这个条件来查询用户
       if (this.user.role !== '0') obj.owner = this.user.id;
@@ -182,10 +181,10 @@ export default {
       this.$router.push({ path: '/client/project', query: { id: data.id } });
     },
     toSelect(data) {
-      this.selected = data;
+      // this.selected = data;
     },
     toExport() {
-      console.log('导出');
+      // console.log('导出');
     },
     roleSelect({ model, value }) {
       if (model == 'client') {

+ 1 - 6
src/views/client/project.vue

@@ -58,12 +58,7 @@ export default {
         },
         { label: '创始人', model: 'owner', notable: true, noform: true },
       ],
-      list: [
-        // {
-        //   name: '运输服务',
-        //   rate: '1',
-        // },
-      ],
+      list: [],
       total: 0,
       opera: [
         { label: '编辑', method: 'editor' },

+ 8 - 13
src/views/order/goods.vue

@@ -23,8 +23,6 @@
                     <el-col class="card-header1" :span="24">线路:{{ getroute(item.route) }}</el-col>
                   </el-row>
                 </div>
-                <!-- <data-table height="200px" :fields="fields" :data="item.split" :usePage="false" :opera="opera" @splice="splice"> </data-table> -->
-                <!-- <el-table :data="item.split" style="width: 100%" @row-click="clickTable(index)"> -->
                 <el-table :data="item.split" style="width: 100%" height="200px">
                   <el-table-column prop="name" label="货物名"></el-table-column>
                   <el-table-column prop="number" label="数量"></el-table-column>
@@ -167,13 +165,8 @@ export default {
       form: {},
       orderForm: {},
       dialog: false,
-      tableData: [],
       //拆分订单列表
       splitList: [],
-      //合同列表
-      contractList: [{ name: '合同一' }, { name: '合同二' }],
-      //项目列表
-      projectList: [{ name: '项目一' }, { name: '项目二' }],
       //客戶列表
       clientList: [],
       //用户列表
@@ -181,7 +174,6 @@ export default {
       // 线路列表
       routeList: [],
       sform: {},
-      // name: [],
       num: 0,
       number: 0,
       max: 0,
@@ -215,7 +207,14 @@ export default {
       const res = await this.query(querys);
       if (this.$checkRes(res)) {
         const { data, total } = res;
-        this.$set(this, `list`, data);
+        let newArray = [];
+        res.data.forEach((now, index) => {
+          newArray[index] = now;
+          newArray[index].split = now.split.filter(item => {
+            return item.status === '0';
+          });
+        });
+        this.$set(this, `list`, newArray);
         this.$set(this, `total`, total);
       }
       //查客户列表
@@ -241,10 +240,6 @@ export default {
     toClose() {
       this.dialog = false;
     },
-    //保存
-    turnSave(data) {
-      console.log(data);
-    },
     //卡片上面的拆分
     splice(tableIndex, data, index) {
       let newList = this.list[tableIndex].split;

+ 5 - 2
src/views/order/in.vue

@@ -25,7 +25,7 @@
         <el-col v-else>
           <inDetail v-model="detailForm" @toReturn="toReturn" :nameList="nameList"></inDetail>
           <el-row type="flex" justify="space-around">
-            <el-col :span="4">
+            <el-col :span="4" style="margin-top:50px">
               <el-button type="primary" @click="toSave(detailForm)">保存</el-button>
             </el-col>
           </el-row>
@@ -132,12 +132,14 @@ export default {
         this.$set(this, `nameList`, data);
       }
     },
+    //查用户
     async searchUser() {
       const res = await this.userQuery();
       if (this.$checkRes(res)) {
         this.$set(this, `chargeList`, res.data);
       }
     },
+    //指派负责人
     async assign({ data }) {
       if (data.id) {
         const res = await this.fetch(data.id);
@@ -167,6 +169,7 @@ export default {
       if (res) this.$set(this, `detailForm`, res);
       this.flag = true;
     },
+    //返回
     toReturn() {
       this.flag = false;
       this.detailForm = {};
@@ -175,13 +178,13 @@ export default {
     async toSave(data) {
       if (data.id) {
         const res = await this.inBill(data);
-        // console.log(res);
         if (this.$checkRes(res, '保存成功', res.errmsg || '保存失败')) {
           this.search();
           this.flag = false;
         }
       }
     },
+    //过滤客户名
     roleSelect({ model, value }) {
       if (model == 'client') {
         let arr = this.nameList.find(i => i.id === value);

+ 8 - 31
src/views/order/inDetail.vue

@@ -185,20 +185,18 @@ export default {
   components: {},
   data: function() {
     return {
-      // detailForm1: { name: '伟巴斯特(长春)车顶系统有限公司-北京天津线', number: '1234', contract: '合同一', route: '线路一', project: '项目一' },
       //合同列表
       contractList: [],
       //项目列表
       projectList: [],
       //线路列表
       routeList: [],
-      detailList: [],
       activeName: 'first',
       //收入项列表
       options: [],
       //税率列表
       rateList: [],
-      listData: [],
+      // listData: [],
       //方式列表
       wayoptions: [],
       cost1: 0,
@@ -257,10 +255,8 @@ export default {
     },
     //查项目
     async searchProject() {
-      // console.log('查项目');
       let goods = this.detailForm.goods;
       const res = await this.projectQuery({ treaty: this.treatyValue });
-      // console.log(res);
       if (res.data.length == 0) {
         this.projectList = [];
         this.routeList = [];
@@ -284,7 +280,6 @@ export default {
     },
     //查计费方式列表
     async searchWay() {
-      // let hh;
       let test1 = [];
       const res = await this.modeQuery({ route: this.wayValue });
       if (res) {
@@ -297,11 +292,7 @@ export default {
           } else {
             i.hh = `${i.price}-整车`;
           }
-          // test1.push(hh);
         }
-        // let newTest = _.slice(test1, 0, this.wayList.length + 1);
-        // this.$set(this, `wayoptions`, newTest);
-        // console.log(this.wayList);
       }
     },
     async searchTree() {
@@ -309,7 +300,6 @@ export default {
       const res = await this.tree('sr');
       if (res) {
         this.$set(this, `options`, res);
-        // console.log(this.options);
       }
       //查其他收费项的税率
       const res1 = await this.tree('sl');
@@ -317,9 +307,6 @@ export default {
         this.$set(this, `rateList`, res1);
       }
     },
-    handleChange(value) {
-      console.log(value);
-    },
     //添加收費項目
     addGoods() {
       this.detailForm.in_bill.push({ taxes: 1 });
@@ -334,31 +321,24 @@ export default {
     //选择货物的计费方式
     async change(data, index) {
       let priceDate = this.wayList.find(i => i.id === data);
-      // console.log(priceDate);
       let goods = this.detailForm.goods[index];
       let price = priceDate.hh.split('-');
       goods.price = price[0];
-      // console.log(goods);
       let arr = _.split(priceDate.hh, '-', 3);
-      // console.log(arr);
       if (_.indexOf(arr, '量份') !== -1) {
         goods.cvalue = goods.number;
       } else if (_.indexOf(arr, '整车') !== -1) {
         goods.cvalue = 1;
       } else if (_.indexOf(arr, '按体积') !== -1) {
-        console.log('按体积');
         goods.cvalue = goods.volume;
       } else {
-        console.log('按重量');
         goods.cvalue = goods.weight;
       }
       goods.sq_ys = _.round(goods.cvalue * goods.price, 2);
       goods.sh_ys = _.round(goods.taxes * goods.cvalue * goods.price, 2);
       goods.sq_ss = _.round(goods.cvalue * goods.price, 2);
       goods.sh_ss = _.round(goods.taxes * goods.cvalue * goods.price, 2);
-      // console.log(goods);
       this.$set(this.detailForm.goods, index, goods);
-
       this.computRate();
     },
     //計算价格
@@ -374,10 +354,12 @@ export default {
       let goods = this.detailForm.goods; //goods是个数组
       let in_bill = this.detailForm.in_bill; //in_bill是个数组
       for (let row1 of goods) {
-        num1 = _.round(num1 + row1.sq_ys, 2);
-        num2 = _.round(num2 + row1.sh_ys, 2);
-        num3 = _.round(num3 + row1.sq_ss, 2);
-        num4 = _.round(num4 + row1.sh_ss, 2);
+        if (row1.sq_ys) {
+          num1 = _.round(num1 + row1.sq_ys, 2);
+          num2 = _.round(num2 + row1.sh_ys, 2);
+          num3 = _.round(num3 + row1.sq_ss, 2);
+          num4 = _.round(num4 + row1.sh_ss, 2);
+        }
       }
       for (let val of in_bill) {
         num5 = _.round(num5 + Number(val.sq_ys), 2);
@@ -403,7 +385,6 @@ export default {
     },
     //税前实收
     otherChange(val, index) {
-      console.log(val, index);
       let bill = this.detailForm.in_bill[index]; //bill是数组
       let sh_ss = _.round(bill.sq_ss * bill.taxes, 2);
       this.$set(bill, `sh_ss`, sh_ss);
@@ -414,11 +395,6 @@ export default {
       let bill = this.detailForm.in_bill[index]; //bill是数组
       this.inputChange(val, index);
     },
-    //保存
-    save() {
-      console.log('保存');
-      console.log(this.listData);
-    },
     //返回
     toReturn() {
       this.$emit('toReturn');
@@ -456,6 +432,7 @@ export default {
         item.mode = '';
       }
     },
+    //是否有合同
     async isTreaty() {
       if (this.detailForm.treaty) this.treayChange(this.detailForm.treaty);
       if (this.detailForm.item) this.projectChange(this.detailForm.item);

+ 0 - 32
src/views/order/out.vue

@@ -4,24 +4,6 @@
       <animates>
         <el-col :span="24" class="container">
           <el-col :span="24" class="info">
-            <!-- <data-table
-              :fields="fields"
-              :data="list"
-              :opera="opera"
-              :total="total"
-              :size="50"
-              :step="10"
-              @query="search"
-              v-if="!dialog"
-              @see="see"
-              :toFormat="roleSelect"
-            >
-              <template #options="{item}">
-                <template v-if="item.model == 'client'">
-                  <el-option v-for="(item, index) in nameList" :key="index" :value="item.id" :label="item.name"></el-option>
-                </template>
-              </template>
-            </data-table> -->
             <el-row v-if="!dialog">
               <el-row type="flex">
                 <el-col :span="22">
@@ -173,19 +155,11 @@ export default {
   data: function() {
     return {
       dialog: false,
-      // fields: [
-      //   { label: '订单号', model: 'order_no', filter: 'input' },
-      //   { label: '客户', model: 'client', filter: 'select', format: true },
-      //   { label: '合同', model: 'contract', notable: 'true', filter: 'select' },
-      //   { label: '项目', model: 'project', notable: 'true', filter: 'select' },
-      //   { label: '线路', model: 'route', notable: 'true', filter: 'select' },
-      // ],
       list: [],
       total: 0,
       limit: 10,
       opera: [{ label: '查看', method: 'see' }],
       //客户列表
-      // nameList: [],
       clientList: [],
       //用户列表
       userList: [],
@@ -199,7 +173,6 @@ export default {
       ],
       detailList: [],
       editableTabsValue: '1',
-      editableTabs: [],
       tabIndex: 1,
       //支出项列表
       costList: [],
@@ -242,7 +215,6 @@ export default {
       const res1 = await this.clientQuery({ type: '客户' });
       if (this.$checkRes(res1)) {
         const { data, total } = res1;
-        // this.$set(this, `nameList`, data);
         this.$set(this, `clientList`, data);
       }
       //查询其他收费项
@@ -265,7 +237,6 @@ export default {
     //查看
     async see(data) {
       const res = await this.fetch(data.id);
-      // console.log(res);
       if (res) this.$set(this, `detailForm`, res);
       if (this.detailForm.out_bill.length > 0) {
         this.computRate();
@@ -274,7 +245,6 @@ export default {
     },
     //添加选项卡
     addTab(value) {
-      console.log(value);
       if (this.editableTabsValue == '0') {
         this.editableTabsValue = '1';
       }
@@ -304,7 +274,6 @@ export default {
     change(index) {
       const outList = this.detailForm.out_bill;
       let outForm = outList[index];
-      console.log(outForm);
       let sh_ys = _.round(outForm.sq_ys * outForm.taxes, 2);
       this.$set(outForm, `sh_ys`, sh_ys);
       let sq_ss = _.round(outForm.sq_ys, 2);
@@ -341,7 +310,6 @@ export default {
     },
     //保存
     async save(data) {
-      // console.log(data);
       const res = await this.outBill(this.detailForm);
       if (this.$checkRes(res, '修改成功', res.errmsg || '修改失败')) {
         this.back();

+ 5 - 36
src/views/order/transport/detail.vue

@@ -1,62 +1,31 @@
 <template>
   <div id="detail">
     <el-row>
-      <el-col :span="24" class="info">
-        <data-table :fields="fields" :data="[detailForm]" :usePage="false"> </data-table>
+      <el-col :span="24">
+        <p>detail</p>
       </el-col>
     </el-row>
   </div>
 </template>
 
 <script>
-const _ = require('lodash');
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   metaInfo() {
     return { title: this.$route.meta.title };
   },
   name: 'detail',
-  props: {
-    detailForm: {
-      type: Object,
-    },
-  },
+  props: {},
   components: {},
   data: function() {
-    return {
-      fields: [
-        { label: '订单号', model: 'order_no' },
-        // { label: '运输单号', model: 'transportnum' },
-        // { label: '发货时间', model: 'time' },
-        // { label: '花费', model: 'cost' },
-      ],
-      list: [
-        // {
-        //   ordernum: '66464',
-        //   time: '2020-2-14',
-        //   transportnum: '11111',
-        //   cost: '400',
-        // },
-      ],
-    };
+    return {};
   },
   created() {},
   methods: {},
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
-    },
   },
 };
 </script>
 
-<style lang="less" scoped>
-.container {
-  min-height: 300px;
-  .top {
-    text-align: left;
-    margin: 15px 0;
-  }
-}
-</style>
+<style lang="less" scoped></style>

+ 13 - 9
src/views/order/transport/index.vue

@@ -293,7 +293,15 @@ export default {
       let res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {
         const { data, total } = res;
-        this.$set(this, `list`, data);
+        let newArray = [];
+        res.data.forEach((now, index) => {
+          newArray[index] = now;
+          newArray[index].split = now.split.filter(item => {
+            return item.status === '0';
+          });
+        });
+        // console.log(newArray);
+        this.$set(this, `list`, newArray);
         this.$set(this, `total`, total);
       }
       //查客户列表
@@ -320,13 +328,6 @@ export default {
         this.$set(this, `taxesList`, res);
       }
     },
-    // 选择货物
-    // toSelect(data) {
-    //   console.log(data);
-    //   let newData = data.concat(this.selected);
-    //   this.$set(this, `selected`, newData);
-    //   console.log(this.selected);
-    // },
     // 发车
     async toExport() {
       let res = await this.transportNo();
@@ -479,6 +480,7 @@ export default {
     back() {
       this.selected = [];
       this.dialog = false;
+      this.search();
     },
     // 查询其他信息
     async searchOther() {
@@ -487,6 +489,7 @@ export default {
         this.$set(this, `carnoList`, res.data);
       }
     },
+    //选择货物
     handleSelectionChange(val, index) {
       let obj = this.newObj;
       let numberIndex;
@@ -510,8 +513,9 @@ export default {
           this.$set(this, `selected`, newData);
         }
       }
-      console.log(this.selected);
+      // console.log(this.selected);
     },
+    //也是选择货物
     onTableSelect(selection, row) {
       //判断是选中还是取消商品,num为true是选中,为false的时候是取消
       //取消没了的时候selection.length为0,num也就是0

+ 4 - 12
src/views/order/transport/sign.vue

@@ -36,7 +36,7 @@
     </el-row>
     <el-dialog title="签收详情" :visible.sync="dialog" @close="toClose">
       <el-form :model="form" :rules="rules">
-        <el-form-item label="签收时间" prop="sign_time">
+        <el-form-item label="签收日期" prop="sign_time">
           <el-date-picker v-model="form.sign_time" type="datetime" placeholder="选择日期时间" value-format="yyyy-MM-dd HH:mm:ss"> </el-date-picker>
         </el-form-item>
       </el-form>
@@ -80,14 +80,10 @@ export default {
       carList: [],
       dialog: false,
       form: {},
-      formFields: [
-        { label: '签收人', model: 'signer' },
-        { label: '签收日期', model: 'receiptdate', type: 'date' },
-      ],
+      formFields: [{ label: '签收日期', model: 'receiptdate', type: 'date' }],
       rules: {
         sign_time: [{ required: true, message: '请选择签收日期', trigger: 'blur' }],
       },
-      backup: '',
     };
   },
   async created() {
@@ -127,7 +123,6 @@ export default {
     },
     //保存
     async turnSave(data) {
-      // console.log(data);
       if (data.id) {
         data.status = '1';
         const res = await this.transportSign(data);
@@ -136,13 +131,13 @@ export default {
         }
       }
     },
+    //签收
     sign(data) {
-      // console.log(data);
       this.$set(this, `form`, data);
       this.dialog = true;
     },
+    //过滤客户名称
     roleSelect({ model, value }) {
-      // console.log(model, value);
       if (model == 'client') {
         let arr = this.nameList.find(i => i.id === value);
         if (arr) return arr.name;
@@ -171,9 +166,6 @@ export default {
         return supplier.car_no;
       }
     },
-    back() {
-      this.flage1 = false;
-    },
   },
   computed: {
     ...mapState(['user']),

+ 4 - 5
src/views/supplier/contract.vue

@@ -26,10 +26,10 @@
                 <el-option v-for="(item, index) in nameList" :key="index" :value="item.id" :label="item.name"></el-option>
               </template>
             </template>
-            <template #filterEnd>
+            <!-- <template #filterEnd>
               <el-button v-if="selected.length <= 0" type="primary" :disabled="true">未选择任何合同</el-button>
               <el-button v-else type="primary" @click="toExport">导出选中合同</el-button>
-            </template>
+            </template> -->
           </data-table>
         </el-col>
       </el-col>
@@ -135,9 +135,7 @@ export default {
     //关闭
     toClose() {
       this.form = {};
-      // console.log(this.dialog);
       this.dialog = false;
-      // console.log('调用了');
     },
     //保存
     async turnSave({ data }) {
@@ -180,8 +178,9 @@ export default {
       this.selected = data;
     },
     toExport() {
-      console.log('导出');
+      // console.log('导出');
     },
+    //过滤供应商
     roleSelect({ model, value }) {
       if (model == 'client') {
         let arr = this.nameList.find(i => i.id === value);