mushencc 3 lat temu
rodzic
commit
692f0dcc0b

+ 799 - 0
src/views/ProductionOrderList/ProductionPlanlist/BST_two.vue

@@ -0,0 +1,799 @@
+<template>
+  <div>
+    <FullPage
+      title="生产排产列表1"
+      :list="set_list"
+      @init="init"
+      @searchData="searchData"
+      @selectTable="selectTable"
+      @changePage="changePage"
+      @changeSize="changeSize"
+      :tableColums="computedTable"
+      :tableData="tableData"
+      :showPage="false"
+      :page_index="page_index"
+      :total="total"
+    >
+      <div slot="titleButton">
+        <Button
+          v-if="persimissionData['分类派工'] || persimissionData.all"
+          type="primary"
+          style="margin-right:10px"
+          @click="handleDispatchType(selects)"
+          ghost
+          >分类派工</Button
+        >
+        <Button
+          v-if="persimissionData['批量派工单'] || persimissionData.all"
+          type="primary"
+          @click="dispatchList(selects)"
+          ghost
+          >批量派工单</Button
+        >
+      </div>
+
+      <div slot="navButton">
+        <Button
+          v-if="persimissionData['表头设置'] || persimissionData.all"
+          @click="setupTableHeader"
+          type="primary"
+          ghost
+          icon="ios-cog"
+          >设置</Button
+        >
+      </div>
+      <template slot="basicTypeSet" slot-scope="{ row }">
+        <div>
+          <span
+            v-for="item in warningList"
+            :key="item.id"
+            :style="{ color: item.color }"
+            v-show="item.id == row.warning_state"
+            >{{ item.title }}</span
+          >
+        </div>
+      </template>
+      <template slot="set" slot-scope="{ row }">
+        <div>
+          <a
+            v-if="persimissionData['详情'] || persimissionData.all"
+            style="margin:0 5px"
+            @click="goDetial(row)"
+            >详情</a
+          >
+          <a
+            v-if="persimissionData['派工单'] || persimissionData.all"
+            style="margin:0 5px"
+            @click="dispatchList(row)"
+            >派工单</a
+          >
+        </div>
+      </template>
+
+      <div>
+        <Modal
+          :width="1064"
+          class-name="vertical-center-modal"
+          v-model="showTableColums"
+          title="设置表头"
+        >
+          <Form>
+            <FormItem label="订单信息:">
+              <div style="width:100%;display:flex;">
+                <CheckboxGroup style="width:100%">
+                  <Checkbox label="香蕉"></Checkbox>
+                  <Checkbox label="苹果"></Checkbox>
+                  <Checkbox label="西瓜"></Checkbox>
+                  <Checkbox label="香蕉"></Checkbox>
+                </CheckboxGroup>
+              </div>
+            </FormItem>
+          </Form>
+        </Modal>
+      </div>
+      <template slot="pageSlot">
+        <div class="pageSlotStyle">
+          <Page
+            :page-size-opts="[10, 20, 30, 40, 100, 1000]"
+            @on-page-size-change="changeSize"
+            @on-change="changePage"
+            :current="page_index"
+            show-total
+            :total="total"
+            show-sizer
+            :page-size="page_size"
+          />
+        </div>
+      </template>
+    </FullPage>
+     <Modal
+      v-model="showModal"
+      title="设置"
+      @on-ok="handleModalOk"
+      @on-cancel="showModal = false"
+    >
+      <div class="modal_content">
+        <Tabs
+          value="name1"
+          style="max-height: 700px; overflow: hidden; overflow-y: auto"
+        >
+          <TabPane label="表单设置" name="name1">
+            <Table
+              :columns="formModalColumns"
+              border
+              draggable
+              @on-drag-drop="(a, b) => onDragDrop(a, b, formModalTableData, 1)"
+              :data="formModalTableData"
+            ></Table>
+          </TabPane>
+          <TabPane label="表头设置" name="name2">
+            <Table
+              :columns="tableModalColumns"
+              border
+              draggable
+              @on-drag-drop="(a, b) => onDragDrop(a, b, tableModalTableData, 2)"
+              :data="tableModalTableData"
+            ></Table>
+          </TabPane>
+        </Tabs>
+      </div>
+    </Modal>
+  </div>
+</template>
+
+<script>
+import { mapState } from "vuex";
+export default {
+  data() {
+    return {
+        tableModalColumns: [
+        {
+          title: "是否展示",
+          align: "center",
+          key: "is_show",
+          minWidth: 60,
+          render: (h, params) => {
+            const { index } = params;
+            const currentRow = JSON.parse(
+              JSON.stringify(this.tableModalTableData[index])
+            );
+            return h("Checkbox", {
+              props: {
+                value: currentRow.is_show,
+              },
+              on: {
+                "on-change": (e) => {
+                  currentRow.is_show = e;
+                  this.tableModalTableData.splice(index, 1, currentRow);
+                },
+              },
+            });
+          },
+        },
+        {
+          title: "字段名",
+          align: "center",
+          key: "value",
+          minWidth: 100,
+        },
+        {
+          title: "展示名称",
+          align: "center",
+          key: "title",
+          minWidth: 100,
+          render: (h, params) => {
+            const { index } = params;
+            const currentRow = JSON.parse(
+              JSON.stringify(this.tableModalTableData[index])
+            );
+            return h("Input", {
+              props: {
+                value: currentRow.title,
+                type: "text",
+                disabled: currentRow.title == "全选" ? true : false,
+              },
+              on: {
+                "on-change": (e) => {
+                  currentRow.title = e.target.value;
+                  this.tableModalTableData.splice(index, 1, currentRow);
+                },
+              },
+            });
+          },
+        },
+      ],
+        tableModalTableData: [
+        { is_show: true, key: "selection", value: "全选", title: "全选" },
+        {
+          is_show: true,
+          key: "order_no",
+          value: "订单编号",
+          title: "订单编号",
+        },
+        {
+          is_show: true,
+          key: "residential_name",
+          value: "项目名称",
+          title: "项目名称",
+        },
+        { is_show: true, key: "nickname", value: "业务员", title: "业务员" },
+        {
+          is_show: true,
+          key: "client_name",
+          value: "客户姓名",
+          title: "客户姓名",
+        },
+        { is_show: true, key: "address", value: "客户地址", title: "客户地址" },
+        {
+          is_show: true,
+          key: "leading_name",
+          value: "负责人",
+          title: "负责人",
+        },
+        {
+          is_show: true,
+          key: "warning_state",
+          value: "紧急程度",
+          title: "紧急程度",
+        },
+        {
+          is_show: true,
+          key: "predict_price",
+          value: "产品总价",
+          title: "产品总价",
+        },
+        {
+          is_show: true,
+          key: "fax_price",
+          value: "折扣金额",
+          title: "折扣金额",
+        },
+        { is_show: true, key: "price", value: "订单金额", title: "订单金额" },
+        { is_show: true, key: "get_money", value: "已收款", title: "已收款" },
+        { is_show: true, key: "unget_money", value: "未收款", title: "未收款" },
+        { is_show: true, key: "remark", value: "备注", title: "备注" },
+        {
+          is_show: true,
+          key: "start_time",
+          value: "订单开始日期",
+          title: "订单开始日期",
+        },
+        {
+          is_show: true,
+          key: "end_time",
+          value: "订单交付日期",
+          title: "订单交付日期",
+        },
+        {
+          is_show: true,
+          key: "complete_rate",
+          value: "生产进度",
+          title: "生产进度",
+        },
+        { is_show: true, key: "state", value: "订单状态", title: "订单状态" },
+        { is_show: true, key: "crt_name", value: "制单人", title: "制单人" },
+        {
+          is_show: true,
+          key: "crt_time",
+          value: "订单创建时间",
+          title: "订单创建时间",
+        },
+        { is_show: true, key: "set", value: "操作", title: "操作" },
+      ],
+       formModalColumns: [
+        {
+          title: "是否展示",
+          align: "center",
+          key: "is_show",
+          minWidth: 60,
+          render: (h, params) => {
+            const { index } = params;
+            const currentRow = JSON.parse(
+              JSON.stringify(this.formModalTableData[index])
+            );
+            return h("Checkbox", {
+              props: {
+                value: currentRow.is_show,
+              },
+              on: {
+                "on-change": (e) => {
+                  currentRow.is_show = e;
+                  this.formModalTableData.splice(index, 1, currentRow);
+                },
+              },
+            });
+          },
+        },
+        {
+          title: "字段名",
+          align: "center",
+          key: "value",
+          minWidth: 100,
+        },
+        {
+          title: "展示名称",
+          align: "center",
+          key: "title",
+          minWidth: 100,
+          render: (h, params) => {
+            const { index } = params;
+            const currentRow = JSON.parse(
+              JSON.stringify(this.formModalTableData[index])
+            );
+            return h("Input", {
+              props: {
+                value: currentRow.title,
+                type: "text",
+              },
+              on: {
+                "on-change": (e) => {
+                  currentRow.title = e.target.value;
+                  this.formModalTableData.splice(index, 1, currentRow);
+                },
+              },
+            });
+          },
+        },
+      ],
+      formModalTableData: [
+        {
+          is_show: true,
+          key: "order_no",
+          value: "订单编号",
+          title: "订单编号",
+        },
+        {
+          is_show: true,
+          key: "residential_name",
+          value: "项目名称",
+          title: "项目名称",
+        },
+        {
+          is_show: true,
+          key: "client_name",
+          value: "客户姓名",
+          title: "客户姓名",
+        },
+        { is_show: true, key: "address", value: "客户地址", title: "客户地址" },
+        { is_show: true, key: "salesman", value: "业务员", title: "业务员" },
+        { is_show: true, key: "state", value: "订单状态", title: "订单状态" },
+        { is_show: true, key: "crt_id", value: "制单人", title: "制单人" },
+        {
+          is_show: true,
+          key: "leading_name",
+          value: "负责人",
+          title: "负责人",
+        },
+        {
+          is_show: true,
+          key: "warning_state",
+          value: "紧急程度",
+          title: "紧急程度",
+        },
+        {
+          is_show: true,
+          key: "",
+          value: "订单创建时间",
+          title: "订单创建时间",
+        },
+      ],
+      tableColums: [
+        {
+          type: "selection",
+          title: "全选",
+          key: "selection",
+          fixed: "left",
+          width: "90",
+          align: "center",
+        },
+        { title: "订单编号", align: "center", key: "order_no", minWidth: 200 },
+        { title: "计划单号", align: "center", key: "plan_no", minWidth: 200 },
+        {
+          title: "订单类型",
+          align: "center",
+          key: "order_type",
+          minWidth: 150,
+          render(h, params) {
+            return h("span", {}, params.row.order_type == 1 ? "工装" : "家装");
+          },
+        },
+        {
+          title: "订单状态",
+          align: "center",
+          key: "state",
+          minWidth: 150,
+          render: (h, params) =>
+            h(
+              "span",
+              {},
+              params.row.state == 0
+                ? "未派工"
+                : params.row.state == 1
+                ? "派工中"
+                : params.row.state == 2
+                ? "完成"
+                : ""
+            ),
+        },
+        { title: "业务员", align: "center", key: "nickname", minWidth: 150 },
+        {
+          title: "紧急程度",
+          align: "center",
+          key: "warning_state",
+          minWidth: 150,
+          slot: "basicTypeSet",
+        },
+        {
+          title: "项目名称",
+          align: "center",
+          key: "residential_name",
+          minWidth: 200,
+        },
+        {
+          title: "计划开始时间",
+          align: "center",
+          minWidth: 200,
+          key: "plan_start_time",
+          render: (h, params) =>
+            h("span", {}, this.func.replaceDate(params.row.plan_start_time, 1)),
+        },
+        {
+          title: "计划结束时间",
+          align: "center",
+          minWidth: 200,
+          key: "plan_end_time",
+          render: (h, params) =>
+            h("span", {}, this.func.replaceDate(params.row.plan_end_time, 1)),
+        },
+        {
+          title: "生产进度",
+          align: "center",
+          key: "complete_rate",
+          minWidth: 100,
+          render: (h, params) =>
+            h("span", {}, parseInt(params.row.complete_rate * 100) + "%"),
+        },
+        {
+          title: "预估交付日期",
+          align: "center",
+          key: "predict_time",
+          minWidth: 200,
+          render: (h, params) =>
+            h("span", {}, this.func.replaceDate(params.row.predict_time, 1)),
+        },
+        {
+          title: "操作",
+          align: "center",
+          key: "set",
+          slot: "set",
+          fixed: "right",
+          width: "150",
+        },
+      ],
+      tableData: [],
+      showModal:false,
+      page_index: 1,
+      currencyPageId:null,
+      page_size: 10,
+      total: 0,
+      proxyObj: {},
+      showTableColums: false,
+      selects: [],
+      tableheaders: [],
+      userList: [],
+      //详情页返回保留搜索数据
+      corssPageData: localStorage.getItem("corssPageData")
+        ? JSON.parse(localStorage.getItem("corssPageData"))
+        : {},
+      warningList: [],
+    };
+  },
+  beforeRouteEnter(to, from, next) {
+    next((vm) => {
+      if (from.path != "/cms/productionorderlist/productionplanlist/details") {
+        localStorage.removeItem("corssPageData");
+      } else {
+        vm.firstEnter = 1;
+      }
+    });
+  },
+  beforeRouteLeave(to, from, next) {
+    if (to.path == "/cms/productionorderlist/productionplanlist/details") {
+      (this.corssPageData.page_index = this.page_index),
+        (this.corssPageData.page_size = this.page_size),
+        localStorage.setItem(
+          "corssPageData",
+          JSON.stringify(this.corssPageData)
+        );
+    } else {
+      localStorage.removeItem("corssPageData");
+    }
+    next((vm) => {});
+  },
+  created() {
+    // 获取紧急程度
+    this.axios.get("/api/warning_list").then((res) => {
+      this.warningList = res.data.data;
+    });
+    this.axios
+      .get("/api/employee_list")
+      .then((res) => (this.userList = res.data));
+    //this.axios.get('/api/employee_list').then(res => { this.employeeList = res.data })
+    this.currencyPageId = this.$store.state.navgationData[0].sub[0].sub[0].id;
+  },
+  computed: {
+    ...mapState(["persimissionData"]),
+    computedTable() {
+      // if (this.tableheaders.length < 1) {
+      return this.tableColums;
+      // }
+      // return this.func.computedHeader(this.tableheaders, this.tableColums)
+    },
+    set_list() {
+      return [
+        {
+          title: "订单编号",
+          name: "Input",
+          serverName: "order_no",
+          placeholder: "请输入订单编号",
+          value: "",
+        },
+        {
+          title: "项目名称",
+          name: "Input",
+          serverName: "residential_name",
+          placeholder: "请选择项目名称",
+          value: "",
+        },
+        {
+          title: "订单类型",
+          name: "Select",
+          placeholder: "请选择",
+          serverName: "order_type",
+          value: "",
+          option: [
+            { label: "工装", value: 1 },
+            { label: "家装", value: 0 },
+          ],
+        },
+        {
+          title: "计划单号",
+          name: "Input",
+          serverName: "plan_no",
+          placeholder: "请填写计划单号",
+          value: "",
+        },
+        {
+          title: "业务员",
+          name: "Select",
+          serverName: "nickname",
+          placeholder: "请选择",
+          value: "",
+          optionName: "nickname",
+          optionValue: "id",
+          option: this.userList,
+        },
+        {
+          title: "计划开始时间",
+          name: "Input",
+          start_server: "start_time",
+          end_server: "end_time",
+          start_value: "",
+          end_value: "",
+          isDate: true,
+          serverName: "id2",
+          start_placeholder: "开始日期",
+          end_placeholder: "结束日期",
+        },
+        {
+          title: "紧急程度",
+          name: "Select",
+          serverName: "warning_state",
+          placeholder: "请选择",
+          value: "",
+          optionName: "title",
+          optionValue: "id",
+          option: this.warningList,
+        },
+        {
+          title: "订单状态",
+          name: "Select",
+          placeholder: "请选择",
+          serverName: "state",
+          value: "",
+          option: [
+            { label: "未派工", value: 0 },
+            { label: "派工中", value: 1 },
+            { label: "完成", value: 2 },
+          ],
+        },
+      ];
+    },
+  },
+  methods: {
+    handleModalOk(){
+        this.formModalTableData.forEach((element, index) => {
+        element.sort = index;
+      });
+      this.tableModalTableData.forEach((element, index) => {
+        element.sort = index;
+      });
+      this.axios({
+        method: "post",
+        url: "/api/update/table",
+        data: {
+          id: this.currencyPageId,
+          result: {
+            formSet: this.formModalTableData,
+            tableSet: this.tableModalTableData,
+          },
+        },
+      }).then((res) => {
+        this.$Message.success(res.msg);
+        this.init(this.proxyObj);
+      });
+    },
+    init(row) {
+      const { order_no } = this.$route.query;
+      if (order_no) {
+        row.order_no = order_no;
+        this.set_list[0].value = order_no;
+      }
+      row.sub_state = 5;
+      if (this.firstEnter == 1) {
+        this.corssPageData = JSON.parse(localStorage.getItem("corssPageData"));
+        row = this.corssPageData;
+        this.proxyObj = row;
+        this.searchData(row);
+      } else {
+        this.page_index = 1;
+        row.page_index = this.page_index;
+        row.page_size = this.page_size;
+        this.proxyObj = row;
+        this.getData(row);
+      }
+    },
+    searchData(row) {
+      if (this.firstEnter == 1) {
+        this.page_index = this.corssPageData.page_index;
+        this.page_size = this.corssPageData.page_size;
+        this.set_list[0].value = this.corssPageData.order_no;
+        this.set_list[1].value = this.corssPageData.residential_name;
+        this.set_list[3].value = this.corssPageData.warning_state;
+        this.set_list[4].value = this.corssPageData.state;
+        this.set_list[2].start_value = this.corssPageData.start_time
+          ? this.corssPageData.start_time
+          : "";
+        this.set_list[2].end_value = this.corssPageData.end_time
+          ? this.corssPageData.end_time
+          : "";
+        this.corssPageData.type = this.$route.query.type;
+        this.getData(this.corssPageData);
+      } else {
+        this.page_index = 1;
+        row.page_index = this.page_index;
+        row.page_size = this.page_size;
+        this.corssPageData.order_no = this.set_list[0].value;
+        this.corssPageData.residential_name = this.set_list[1].value;
+        this.corssPageData.warning_state = this.set_list[3].value;
+        this.corssPageData.state = this.set_list[4].value;
+        this.corssPageData.start_time = this.func.setDate(
+          this.set_list[2].start_value
+        );
+        this.corssPageData.end_time = this.func.setDate(
+          this.set_list[2].end_value
+        );
+        this.proxyObj = row;
+        this.getData(row);
+      }
+    },
+    changePage(e) {
+      this.page_index = e;
+      this.proxyObj.page_index = this.page_index;
+      this.proxyObj.page_size = this.page_size;
+      this.getData(this.proxyObj);
+    },
+    changeSize(e) {
+      this.page_size = e;
+      this.proxyObj.page_size = this.page_size;
+      this.getData(this.proxyObj);
+    },
+    getData(row) {
+      this.axios("/api/orders_produce_plan_list", { params: row }).then(
+        (res) => {
+          this.firstEnter++;
+          this.tableData = res.data.data;
+          this.total = res.data.total;
+          // this.tableheaders = res.data.tableSet || []
+        }
+      );
+    },
+    setTableColums() {
+      //设置表头
+      this.showTableColums = true;
+    },
+    goDetial(row) {
+      this.$router.push({
+        path: "/cms/productionorderlist/productionplanlist/details",
+        query: {
+          order_no: row.order_no,
+          plan_no: row.plan_no,
+        },
+      });
+    },
+     onDragDrop(a, b, table, type) {
+      if (type == 2 && (a == 0 || b == 0)) {
+        return this.$Message.warning("全选位置不可变");
+      }
+      table.splice(b, 0, ...table.splice(a, 1));
+    },
+    handleDispatchType(row) {
+      console.log("row :>> ", row);
+      this.$router.push({
+        path: "/cms/Dispatching/Dispatching",
+        query: {
+          order_no: row.order_no,
+          plan_no: row.plan_no,
+        },
+      });
+    },
+    dispatchList(row) {
+      this.dispatchOrder({
+        params: {
+          order_no: Array.isArray(row) ? this.selects.join(",") : row.order_no,
+        },
+        then: () => this.getData(this.proxyObj),
+      });
+    },
+    selectTable(e) {
+      let result = [];
+      e.map((v) => result.push(v.order_no));
+      this.selects = result;
+    },
+    setupTableHeader() {
+       this.showModal = true;
+      return;
+      // this.tableheaders.length < 1
+      //   ? (this.tableheaders = this.tableColums.reduce(
+      //       (pre, cur) => pre.concat(cur.key),
+      //       []
+      //     ))
+      //   : "";
+      // this.$setTableheader({
+      //   list: this.tableColums,
+      //   selects: this.tableheaders,
+      //   then: (result) => {
+      //     this.tableheaders = result;
+      //     this.axios
+      //       .post("/api/update/table", { id: this.$route.query.id, result })
+      //       .then((res) => {
+      //         if (res.code == 200) {
+      //           this.$Message.success(res.msg);
+                // let data =[];
+                // for(let i = 0 ; i++ ; i<this.tableColums){
+                //   if(this.tableColums[i].title.indexOf(result)>=0){
+                //              data.push(this.tableColums[i])
+                //   }
+                // }
+                // this.computedTable = data
+       //       }
+      //      });
+     //   },
+    //  });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.pageSlotStyle {
+  display: flex;
+  justify-content: center;
+  margin-top: 40px;
+}
+.modal_content {
+  display: flex;
+  justify-content: center;
+  // width: 500px;
+}
+</style>

+ 11 - 791
src/views/ProductionOrderList/ProductionPlanlist/list.vue

@@ -1,799 +1,19 @@
 <template>
   <div>
-    <FullPage
-      title="生产排产列表"
-      :list="set_list"
-      @init="init"
-      @searchData="searchData"
-      @selectTable="selectTable"
-      @changePage="changePage"
-      @changeSize="changeSize"
-      :tableColums="computedTable"
-      :tableData="tableData"
-      :showPage="false"
-      :page_index="page_index"
-      :total="total"
-    >
-      <div slot="titleButton">
-        <Button
-          v-if="persimissionData['分类派工'] || persimissionData.all"
-          type="primary"
-          style="margin-right:10px"
-          @click="handleDispatchType(selects)"
-          ghost
-          >分类派工</Button
-        >
-        <Button
-          v-if="persimissionData['批量派工单'] || persimissionData.all"
-          type="primary"
-          @click="dispatchList(selects)"
-          ghost
-          >批量派工单</Button
-        >
-      </div>
-
-      <div slot="navButton">
-        <Button
-          v-if="persimissionData['表头设置'] || persimissionData.all"
-          @click="setupTableHeader"
-          type="primary"
-          ghost
-          icon="ios-cog"
-          >设置</Button
-        >
-      </div>
-      <template slot="basicTypeSet" slot-scope="{ row }">
-        <div>
-          <span
-            v-for="item in warningList"
-            :key="item.id"
-            :style="{ color: item.color }"
-            v-show="item.id == row.warning_state"
-            >{{ item.title }}</span
-          >
-        </div>
-      </template>
-      <template slot="set" slot-scope="{ row }">
-        <div>
-          <a
-            v-if="persimissionData['详情'] || persimissionData.all"
-            style="margin:0 5px"
-            @click="goDetial(row)"
-            >详情</a
-          >
-          <a
-            v-if="persimissionData['派工单'] || persimissionData.all"
-            style="margin:0 5px"
-            @click="dispatchList(row)"
-            >派工单</a
-          >
-        </div>
-      </template>
-
-      <div>
-        <Modal
-          :width="1064"
-          class-name="vertical-center-modal"
-          v-model="showTableColums"
-          title="设置表头"
-        >
-          <Form>
-            <FormItem label="订单信息:">
-              <div style="width:100%;display:flex;">
-                <CheckboxGroup style="width:100%">
-                  <Checkbox label="香蕉"></Checkbox>
-                  <Checkbox label="苹果"></Checkbox>
-                  <Checkbox label="西瓜"></Checkbox>
-                  <Checkbox label="香蕉"></Checkbox>
-                </CheckboxGroup>
-              </div>
-            </FormItem>
-          </Form>
-        </Modal>
-      </div>
-      <template slot="pageSlot">
-        <div class="pageSlotStyle">
-          <Page
-            :page-size-opts="[10, 20, 30, 40, 100, 1000]"
-            @on-page-size-change="changeSize"
-            @on-change="changePage"
-            :current="page_index"
-            show-total
-            :total="total"
-            show-sizer
-            :page-size="page_size"
-          />
-        </div>
-      </template>
-    </FullPage>
-     <Modal
-      v-model="showModal"
-      title="设置"
-      @on-ok="handleModalOk"
-      @on-cancel="showModal = false"
-    >
-      <div class="modal_content">
-        <Tabs
-          value="name1"
-          style="max-height: 700px; overflow: hidden; overflow-y: auto"
-        >
-          <TabPane label="表单设置" name="name1">
-            <Table
-              :columns="formModalColumns"
-              border
-              draggable
-              @on-drag-drop="(a, b) => onDragDrop(a, b, formModalTableData, 1)"
-              :data="formModalTableData"
-            ></Table>
-          </TabPane>
-          <TabPane label="表头设置" name="name2">
-            <Table
-              :columns="tableModalColumns"
-              border
-              draggable
-              @on-drag-drop="(a, b) => onDragDrop(a, b, tableModalTableData, 2)"
-              :data="tableModalTableData"
-            ></Table>
-          </TabPane>
-        </Tabs>
-      </div>
-    </Modal>
+    <typeOne/>
+    <BSTTwo v-if="false"/>
   </div>
 </template>
-
 <script>
-import { mapState } from "vuex";
+import typeOne from '@/views/ProductionOrderList/ProductionPlanlist/type_one'
+import BSTTwo from '@/views/ProductionOrderList/ProductionPlanlist/BST_two'
 export default {
-  data() {
-    return {
-        tableModalColumns: [
-        {
-          title: "是否展示",
-          align: "center",
-          key: "is_show",
-          minWidth: 60,
-          render: (h, params) => {
-            const { index } = params;
-            const currentRow = JSON.parse(
-              JSON.stringify(this.tableModalTableData[index])
-            );
-            return h("Checkbox", {
-              props: {
-                value: currentRow.is_show,
-              },
-              on: {
-                "on-change": (e) => {
-                  currentRow.is_show = e;
-                  this.tableModalTableData.splice(index, 1, currentRow);
-                },
-              },
-            });
-          },
-        },
-        {
-          title: "字段名",
-          align: "center",
-          key: "value",
-          minWidth: 100,
-        },
-        {
-          title: "展示名称",
-          align: "center",
-          key: "title",
-          minWidth: 100,
-          render: (h, params) => {
-            const { index } = params;
-            const currentRow = JSON.parse(
-              JSON.stringify(this.tableModalTableData[index])
-            );
-            return h("Input", {
-              props: {
-                value: currentRow.title,
-                type: "text",
-                disabled: currentRow.title == "全选" ? true : false,
-              },
-              on: {
-                "on-change": (e) => {
-                  currentRow.title = e.target.value;
-                  this.tableModalTableData.splice(index, 1, currentRow);
-                },
-              },
-            });
-          },
-        },
-      ],
-        tableModalTableData: [
-        { is_show: true, key: "selection", value: "全选", title: "全选" },
-        {
-          is_show: true,
-          key: "order_no",
-          value: "订单编号",
-          title: "订单编号",
-        },
-        {
-          is_show: true,
-          key: "residential_name",
-          value: "项目名称",
-          title: "项目名称",
-        },
-        { is_show: true, key: "nickname", value: "业务员", title: "业务员" },
-        {
-          is_show: true,
-          key: "client_name",
-          value: "客户姓名",
-          title: "客户姓名",
-        },
-        { is_show: true, key: "address", value: "客户地址", title: "客户地址" },
-        {
-          is_show: true,
-          key: "leading_name",
-          value: "负责人",
-          title: "负责人",
-        },
-        {
-          is_show: true,
-          key: "warning_state",
-          value: "紧急程度",
-          title: "紧急程度",
-        },
-        {
-          is_show: true,
-          key: "predict_price",
-          value: "产品总价",
-          title: "产品总价",
-        },
-        {
-          is_show: true,
-          key: "fax_price",
-          value: "折扣金额",
-          title: "折扣金额",
-        },
-        { is_show: true, key: "price", value: "订单金额", title: "订单金额" },
-        { is_show: true, key: "get_money", value: "已收款", title: "已收款" },
-        { is_show: true, key: "unget_money", value: "未收款", title: "未收款" },
-        { is_show: true, key: "remark", value: "备注", title: "备注" },
-        {
-          is_show: true,
-          key: "start_time",
-          value: "订单开始日期",
-          title: "订单开始日期",
-        },
-        {
-          is_show: true,
-          key: "end_time",
-          value: "订单交付日期",
-          title: "订单交付日期",
-        },
-        {
-          is_show: true,
-          key: "complete_rate",
-          value: "生产进度",
-          title: "生产进度",
-        },
-        { is_show: true, key: "state", value: "订单状态", title: "订单状态" },
-        { is_show: true, key: "crt_name", value: "制单人", title: "制单人" },
-        {
-          is_show: true,
-          key: "crt_time",
-          value: "订单创建时间",
-          title: "订单创建时间",
-        },
-        { is_show: true, key: "set", value: "操作", title: "操作" },
-      ],
-       formModalColumns: [
-        {
-          title: "是否展示",
-          align: "center",
-          key: "is_show",
-          minWidth: 60,
-          render: (h, params) => {
-            const { index } = params;
-            const currentRow = JSON.parse(
-              JSON.stringify(this.formModalTableData[index])
-            );
-            return h("Checkbox", {
-              props: {
-                value: currentRow.is_show,
-              },
-              on: {
-                "on-change": (e) => {
-                  currentRow.is_show = e;
-                  this.formModalTableData.splice(index, 1, currentRow);
-                },
-              },
-            });
-          },
-        },
-        {
-          title: "字段名",
-          align: "center",
-          key: "value",
-          minWidth: 100,
-        },
-        {
-          title: "展示名称",
-          align: "center",
-          key: "title",
-          minWidth: 100,
-          render: (h, params) => {
-            const { index } = params;
-            const currentRow = JSON.parse(
-              JSON.stringify(this.formModalTableData[index])
-            );
-            return h("Input", {
-              props: {
-                value: currentRow.title,
-                type: "text",
-              },
-              on: {
-                "on-change": (e) => {
-                  currentRow.title = e.target.value;
-                  this.formModalTableData.splice(index, 1, currentRow);
-                },
-              },
-            });
-          },
-        },
-      ],
-      formModalTableData: [
-        {
-          is_show: true,
-          key: "order_no",
-          value: "订单编号",
-          title: "订单编号",
-        },
-        {
-          is_show: true,
-          key: "residential_name",
-          value: "项目名称",
-          title: "项目名称",
-        },
-        {
-          is_show: true,
-          key: "client_name",
-          value: "客户姓名",
-          title: "客户姓名",
-        },
-        { is_show: true, key: "address", value: "客户地址", title: "客户地址" },
-        { is_show: true, key: "salesman", value: "业务员", title: "业务员" },
-        { is_show: true, key: "state", value: "订单状态", title: "订单状态" },
-        { is_show: true, key: "crt_id", value: "制单人", title: "制单人" },
-        {
-          is_show: true,
-          key: "leading_name",
-          value: "负责人",
-          title: "负责人",
-        },
-        {
-          is_show: true,
-          key: "warning_state",
-          value: "紧急程度",
-          title: "紧急程度",
-        },
-        {
-          is_show: true,
-          key: "",
-          value: "订单创建时间",
-          title: "订单创建时间",
-        },
-      ],
-      tableColums: [
-        {
-          type: "selection",
-          title: "全选",
-          key: "selection",
-          fixed: "left",
-          width: "90",
-          align: "center",
-        },
-        { title: "订单编号", align: "center", key: "order_no", minWidth: 200 },
-        { title: "计划单号", align: "center", key: "plan_no", minWidth: 200 },
-        {
-          title: "订单类型",
-          align: "center",
-          key: "order_type",
-          minWidth: 150,
-          render(h, params) {
-            return h("span", {}, params.row.order_type == 1 ? "工装" : "家装");
-          },
-        },
-        {
-          title: "订单状态",
-          align: "center",
-          key: "state",
-          minWidth: 150,
-          render: (h, params) =>
-            h(
-              "span",
-              {},
-              params.row.state == 0
-                ? "未派工"
-                : params.row.state == 1
-                ? "派工中"
-                : params.row.state == 2
-                ? "完成"
-                : ""
-            ),
-        },
-        { title: "业务员", align: "center", key: "nickname", minWidth: 150 },
-        {
-          title: "紧急程度",
-          align: "center",
-          key: "warning_state",
-          minWidth: 150,
-          slot: "basicTypeSet",
-        },
-        {
-          title: "项目名称",
-          align: "center",
-          key: "residential_name",
-          minWidth: 200,
-        },
-        {
-          title: "计划开始时间",
-          align: "center",
-          minWidth: 200,
-          key: "plan_start_time",
-          render: (h, params) =>
-            h("span", {}, this.func.replaceDate(params.row.plan_start_time, 1)),
-        },
-        {
-          title: "计划结束时间",
-          align: "center",
-          minWidth: 200,
-          key: "plan_end_time",
-          render: (h, params) =>
-            h("span", {}, this.func.replaceDate(params.row.plan_end_time, 1)),
-        },
-        {
-          title: "生产进度",
-          align: "center",
-          key: "complete_rate",
-          minWidth: 100,
-          render: (h, params) =>
-            h("span", {}, parseInt(params.row.complete_rate * 100) + "%"),
-        },
-        {
-          title: "预估交付日期",
-          align: "center",
-          key: "predict_time",
-          minWidth: 200,
-          render: (h, params) =>
-            h("span", {}, this.func.replaceDate(params.row.predict_time, 1)),
-        },
-        {
-          title: "操作",
-          align: "center",
-          key: "set",
-          slot: "set",
-          fixed: "right",
-          width: "150",
-        },
-      ],
-      tableData: [],
-      showModal:false,
-      page_index: 1,
-      currencyPageId:null,
-      page_size: 10,
-      total: 0,
-      proxyObj: {},
-      showTableColums: false,
-      selects: [],
-      tableheaders: [],
-      userList: [],
-      //详情页返回保留搜索数据
-      corssPageData: localStorage.getItem("corssPageData")
-        ? JSON.parse(localStorage.getItem("corssPageData"))
-        : {},
-      warningList: [],
-    };
-  },
-  beforeRouteEnter(to, from, next) {
-    next((vm) => {
-      if (from.path != "/cms/productionorderlist/productionplanlist/details") {
-        localStorage.removeItem("corssPageData");
-      } else {
-        vm.firstEnter = 1;
-      }
-    });
-  },
-  beforeRouteLeave(to, from, next) {
-    if (to.path == "/cms/productionorderlist/productionplanlist/details") {
-      (this.corssPageData.page_index = this.page_index),
-        (this.corssPageData.page_size = this.page_size),
-        localStorage.setItem(
-          "corssPageData",
-          JSON.stringify(this.corssPageData)
-        );
-    } else {
-      localStorage.removeItem("corssPageData");
-    }
-    next((vm) => {});
-  },
-  created() {
-    // 获取紧急程度
-    this.axios.get("/api/warning_list").then((res) => {
-      this.warningList = res.data.data;
-    });
-    this.axios
-      .get("/api/employee_list")
-      .then((res) => (this.userList = res.data));
-    //this.axios.get('/api/employee_list').then(res => { this.employeeList = res.data })
-    this.currencyPageId = this.$store.state.navgationData[0].sub[0].sub[0].id;
-  },
-  computed: {
-    ...mapState(["persimissionData"]),
-    computedTable() {
-      // if (this.tableheaders.length < 1) {
-      return this.tableColums;
-      // }
-      // return this.func.computedHeader(this.tableheaders, this.tableColums)
-    },
-    set_list() {
-      return [
-        {
-          title: "订单编号",
-          name: "Input",
-          serverName: "order_no",
-          placeholder: "请输入订单编号",
-          value: "",
-        },
-        {
-          title: "项目名称",
-          name: "Input",
-          serverName: "residential_name",
-          placeholder: "请选择项目名称",
-          value: "",
-        },
-        {
-          title: "订单类型",
-          name: "Select",
-          placeholder: "请选择",
-          serverName: "order_type",
-          value: "",
-          option: [
-            { label: "工装", value: 1 },
-            { label: "家装", value: 0 },
-          ],
-        },
-        {
-          title: "计划单号",
-          name: "Input",
-          serverName: "plan_no",
-          placeholder: "请填写计划单号",
-          value: "",
-        },
-        {
-          title: "业务员",
-          name: "Select",
-          serverName: "nickname",
-          placeholder: "请选择",
-          value: "",
-          optionName: "nickname",
-          optionValue: "id",
-          option: this.userList,
-        },
-        {
-          title: "计划开始时间",
-          name: "Input",
-          start_server: "start_time",
-          end_server: "end_time",
-          start_value: "",
-          end_value: "",
-          isDate: true,
-          serverName: "id2",
-          start_placeholder: "开始日期",
-          end_placeholder: "结束日期",
-        },
-        {
-          title: "紧急程度",
-          name: "Select",
-          serverName: "warning_state",
-          placeholder: "请选择",
-          value: "",
-          optionName: "title",
-          optionValue: "id",
-          option: this.warningList,
-        },
-        {
-          title: "订单状态",
-          name: "Select",
-          placeholder: "请选择",
-          serverName: "state",
-          value: "",
-          option: [
-            { label: "未派工", value: 0 },
-            { label: "派工中", value: 1 },
-            { label: "完成", value: 2 },
-          ],
-        },
-      ];
-    },
-  },
-  methods: {
-    handleModalOk(){
-        this.formModalTableData.forEach((element, index) => {
-        element.sort = index;
-      });
-      this.tableModalTableData.forEach((element, index) => {
-        element.sort = index;
-      });
-      this.axios({
-        method: "post",
-        url: "/api/update/table",
-        data: {
-          id: this.currencyPageId,
-          result: {
-            formSet: this.formModalTableData,
-            tableSet: this.tableModalTableData,
-          },
-        },
-      }).then((res) => {
-        this.$Message.success(res.msg);
-        this.init(this.proxyObj);
-      });
-    },
-    init(row) {
-      const { order_no } = this.$route.query;
-      if (order_no) {
-        row.order_no = order_no;
-        this.set_list[0].value = order_no;
-      }
-      row.sub_state = 5;
-      if (this.firstEnter == 1) {
-        this.corssPageData = JSON.parse(localStorage.getItem("corssPageData"));
-        row = this.corssPageData;
-        this.proxyObj = row;
-        this.searchData(row);
-      } else {
-        this.page_index = 1;
-        row.page_index = this.page_index;
-        row.page_size = this.page_size;
-        this.proxyObj = row;
-        this.getData(row);
-      }
-    },
-    searchData(row) {
-      if (this.firstEnter == 1) {
-        this.page_index = this.corssPageData.page_index;
-        this.page_size = this.corssPageData.page_size;
-        this.set_list[0].value = this.corssPageData.order_no;
-        this.set_list[1].value = this.corssPageData.residential_name;
-        this.set_list[3].value = this.corssPageData.warning_state;
-        this.set_list[4].value = this.corssPageData.state;
-        this.set_list[2].start_value = this.corssPageData.start_time
-          ? this.corssPageData.start_time
-          : "";
-        this.set_list[2].end_value = this.corssPageData.end_time
-          ? this.corssPageData.end_time
-          : "";
-        this.corssPageData.type = this.$route.query.type;
-        this.getData(this.corssPageData);
-      } else {
-        this.page_index = 1;
-        row.page_index = this.page_index;
-        row.page_size = this.page_size;
-        this.corssPageData.order_no = this.set_list[0].value;
-        this.corssPageData.residential_name = this.set_list[1].value;
-        this.corssPageData.warning_state = this.set_list[3].value;
-        this.corssPageData.state = this.set_list[4].value;
-        this.corssPageData.start_time = this.func.setDate(
-          this.set_list[2].start_value
-        );
-        this.corssPageData.end_time = this.func.setDate(
-          this.set_list[2].end_value
-        );
-        this.proxyObj = row;
-        this.getData(row);
-      }
-    },
-    changePage(e) {
-      this.page_index = e;
-      this.proxyObj.page_index = this.page_index;
-      this.proxyObj.page_size = this.page_size;
-      this.getData(this.proxyObj);
-    },
-    changeSize(e) {
-      this.page_size = e;
-      this.proxyObj.page_size = this.page_size;
-      this.getData(this.proxyObj);
-    },
-    getData(row) {
-      this.axios("/api/orders_produce_plan_list", { params: row }).then(
-        (res) => {
-          this.firstEnter++;
-          this.tableData = res.data.data;
-          this.total = res.data.total;
-          // this.tableheaders = res.data.tableSet || []
-        }
-      );
-    },
-    setTableColums() {
-      //设置表头
-      this.showTableColums = true;
-    },
-    goDetial(row) {
-      this.$router.push({
-        path: "/cms/productionorderlist/productionplanlist/details",
-        query: {
-          order_no: row.order_no,
-          plan_no: row.plan_no,
-        },
-      });
-    },
-     onDragDrop(a, b, table, type) {
-      if (type == 2 && (a == 0 || b == 0)) {
-        return this.$Message.warning("全选位置不可变");
-      }
-      table.splice(b, 0, ...table.splice(a, 1));
-    },
-    handleDispatchType(row) {
-      console.log("row :>> ", row);
-      this.$router.push({
-        path: "/cms/Dispatching/Dispatching",
-        query: {
-          order_no: row.order_no,
-          plan_no: row.plan_no,
-        },
-      });
-    },
-    dispatchList(row) {
-      this.dispatchOrder({
-        params: {
-          order_no: Array.isArray(row) ? this.selects.join(",") : row.order_no,
-        },
-        then: () => this.getData(this.proxyObj),
-      });
-    },
-    selectTable(e) {
-      let result = [];
-      e.map((v) => result.push(v.order_no));
-      this.selects = result;
-    },
-    setupTableHeader() {
-       this.showModal = true;
-      return;
-      // this.tableheaders.length < 1
-      //   ? (this.tableheaders = this.tableColums.reduce(
-      //       (pre, cur) => pre.concat(cur.key),
-      //       []
-      //     ))
-      //   : "";
-      // this.$setTableheader({
-      //   list: this.tableColums,
-      //   selects: this.tableheaders,
-      //   then: (result) => {
-      //     this.tableheaders = result;
-      //     this.axios
-      //       .post("/api/update/table", { id: this.$route.query.id, result })
-      //       .then((res) => {
-      //         if (res.code == 200) {
-      //           this.$Message.success(res.msg);
-                // let data =[];
-                // for(let i = 0 ; i++ ; i<this.tableColums){
-                //   if(this.tableColums[i].title.indexOf(result)>=0){
-                //              data.push(this.tableColums[i])
-                //   }
-                // }
-                // this.computedTable = data
-       //       }
-      //      });
-     //   },
-    //  });
-    },
-  },
-};
+  components:{
+    typeOne,
+    BSTTwo
+  }
+}
 </script>
+<style scoped>
 
-<style lang="scss" scoped>
-.pageSlotStyle {
-  display: flex;
-  justify-content: center;
-  margin-top: 40px;
-}
-.modal_content {
-  display: flex;
-  justify-content: center;
-  // width: 500px;
-}
-</style>
+</style>

+ 799 - 0
src/views/ProductionOrderList/ProductionPlanlist/type_one.vue

@@ -0,0 +1,799 @@
+<template>
+  <div>
+    <FullPage
+      title="生产排产列表2"
+      :list="set_list"
+      @init="init"
+      @searchData="searchData"
+      @selectTable="selectTable"
+      @changePage="changePage"
+      @changeSize="changeSize"
+      :tableColums="computedTable"
+      :tableData="tableData"
+      :showPage="false"
+      :page_index="page_index"
+      :total="total"
+    >
+      <div slot="titleButton">
+        <Button
+          v-if="persimissionData['分类派工'] || persimissionData.all"
+          type="primary"
+          style="margin-right:10px"
+          @click="handleDispatchType(selects)"
+          ghost
+          >分类派工</Button
+        >
+        <Button
+          v-if="persimissionData['批量派工单'] || persimissionData.all"
+          type="primary"
+          @click="dispatchList(selects)"
+          ghost
+          >批量派工单</Button
+        >
+      </div>
+
+      <div slot="navButton">
+        <Button
+          v-if="persimissionData['表头设置'] || persimissionData.all"
+          @click="setupTableHeader"
+          type="primary"
+          ghost
+          icon="ios-cog"
+          >设置</Button
+        >
+      </div>
+      <template slot="basicTypeSet" slot-scope="{ row }">
+        <div>
+          <span
+            v-for="item in warningList"
+            :key="item.id"
+            :style="{ color: item.color }"
+            v-show="item.id == row.warning_state"
+            >{{ item.title }}</span
+          >
+        </div>
+      </template>
+      <template slot="set" slot-scope="{ row }">
+        <div>
+          <a
+            v-if="persimissionData['详情'] || persimissionData.all"
+            style="margin:0 5px"
+            @click="goDetial(row)"
+            >详情</a
+          >
+          <a
+            v-if="persimissionData['派工单'] || persimissionData.all"
+            style="margin:0 5px"
+            @click="dispatchList(row)"
+            >派工单</a
+          >
+        </div>
+      </template>
+
+      <div>
+        <Modal
+          :width="1064"
+          class-name="vertical-center-modal"
+          v-model="showTableColums"
+          title="设置表头"
+        >
+          <Form>
+            <FormItem label="订单信息:">
+              <div style="width:100%;display:flex;">
+                <CheckboxGroup style="width:100%">
+                  <Checkbox label="香蕉"></Checkbox>
+                  <Checkbox label="苹果"></Checkbox>
+                  <Checkbox label="西瓜"></Checkbox>
+                  <Checkbox label="香蕉"></Checkbox>
+                </CheckboxGroup>
+              </div>
+            </FormItem>
+          </Form>
+        </Modal>
+      </div>
+      <template slot="pageSlot">
+        <div class="pageSlotStyle">
+          <Page
+            :page-size-opts="[10, 20, 30, 40, 100, 1000]"
+            @on-page-size-change="changeSize"
+            @on-change="changePage"
+            :current="page_index"
+            show-total
+            :total="total"
+            show-sizer
+            :page-size="page_size"
+          />
+        </div>
+      </template>
+    </FullPage>
+     <Modal
+      v-model="showModal"
+      title="设置"
+      @on-ok="handleModalOk"
+      @on-cancel="showModal = false"
+    >
+      <div class="modal_content">
+        <Tabs
+          value="name1"
+          style="max-height: 700px; overflow: hidden; overflow-y: auto"
+        >
+          <TabPane label="表单设置" name="name1">
+            <Table
+              :columns="formModalColumns"
+              border
+              draggable
+              @on-drag-drop="(a, b) => onDragDrop(a, b, formModalTableData, 1)"
+              :data="formModalTableData"
+            ></Table>
+          </TabPane>
+          <TabPane label="表头设置" name="name2">
+            <Table
+              :columns="tableModalColumns"
+              border
+              draggable
+              @on-drag-drop="(a, b) => onDragDrop(a, b, tableModalTableData, 2)"
+              :data="tableModalTableData"
+            ></Table>
+          </TabPane>
+        </Tabs>
+      </div>
+    </Modal>
+  </div>
+</template>
+
+<script>
+import { mapState } from "vuex";
+export default {
+  data() {
+    return {
+        tableModalColumns: [
+        {
+          title: "是否展示",
+          align: "center",
+          key: "is_show",
+          minWidth: 60,
+          render: (h, params) => {
+            const { index } = params;
+            const currentRow = JSON.parse(
+              JSON.stringify(this.tableModalTableData[index])
+            );
+            return h("Checkbox", {
+              props: {
+                value: currentRow.is_show,
+              },
+              on: {
+                "on-change": (e) => {
+                  currentRow.is_show = e;
+                  this.tableModalTableData.splice(index, 1, currentRow);
+                },
+              },
+            });
+          },
+        },
+        {
+          title: "字段名",
+          align: "center",
+          key: "value",
+          minWidth: 100,
+        },
+        {
+          title: "展示名称",
+          align: "center",
+          key: "title",
+          minWidth: 100,
+          render: (h, params) => {
+            const { index } = params;
+            const currentRow = JSON.parse(
+              JSON.stringify(this.tableModalTableData[index])
+            );
+            return h("Input", {
+              props: {
+                value: currentRow.title,
+                type: "text",
+                disabled: currentRow.title == "全选" ? true : false,
+              },
+              on: {
+                "on-change": (e) => {
+                  currentRow.title = e.target.value;
+                  this.tableModalTableData.splice(index, 1, currentRow);
+                },
+              },
+            });
+          },
+        },
+      ],
+        tableModalTableData: [
+        { is_show: true, key: "selection", value: "全选", title: "全选" },
+        {
+          is_show: true,
+          key: "order_no",
+          value: "订单编号",
+          title: "订单编号",
+        },
+        {
+          is_show: true,
+          key: "residential_name",
+          value: "项目名称",
+          title: "项目名称",
+        },
+        { is_show: true, key: "nickname", value: "业务员", title: "业务员" },
+        {
+          is_show: true,
+          key: "client_name",
+          value: "客户姓名",
+          title: "客户姓名",
+        },
+        { is_show: true, key: "address", value: "客户地址", title: "客户地址" },
+        {
+          is_show: true,
+          key: "leading_name",
+          value: "负责人",
+          title: "负责人",
+        },
+        {
+          is_show: true,
+          key: "warning_state",
+          value: "紧急程度",
+          title: "紧急程度",
+        },
+        {
+          is_show: true,
+          key: "predict_price",
+          value: "产品总价",
+          title: "产品总价",
+        },
+        {
+          is_show: true,
+          key: "fax_price",
+          value: "折扣金额",
+          title: "折扣金额",
+        },
+        { is_show: true, key: "price", value: "订单金额", title: "订单金额" },
+        { is_show: true, key: "get_money", value: "已收款", title: "已收款" },
+        { is_show: true, key: "unget_money", value: "未收款", title: "未收款" },
+        { is_show: true, key: "remark", value: "备注", title: "备注" },
+        {
+          is_show: true,
+          key: "start_time",
+          value: "订单开始日期",
+          title: "订单开始日期",
+        },
+        {
+          is_show: true,
+          key: "end_time",
+          value: "订单交付日期",
+          title: "订单交付日期",
+        },
+        {
+          is_show: true,
+          key: "complete_rate",
+          value: "生产进度",
+          title: "生产进度",
+        },
+        { is_show: true, key: "state", value: "订单状态", title: "订单状态" },
+        { is_show: true, key: "crt_name", value: "制单人", title: "制单人" },
+        {
+          is_show: true,
+          key: "crt_time",
+          value: "订单创建时间",
+          title: "订单创建时间",
+        },
+        { is_show: true, key: "set", value: "操作", title: "操作" },
+      ],
+       formModalColumns: [
+        {
+          title: "是否展示",
+          align: "center",
+          key: "is_show",
+          minWidth: 60,
+          render: (h, params) => {
+            const { index } = params;
+            const currentRow = JSON.parse(
+              JSON.stringify(this.formModalTableData[index])
+            );
+            return h("Checkbox", {
+              props: {
+                value: currentRow.is_show,
+              },
+              on: {
+                "on-change": (e) => {
+                  currentRow.is_show = e;
+                  this.formModalTableData.splice(index, 1, currentRow);
+                },
+              },
+            });
+          },
+        },
+        {
+          title: "字段名",
+          align: "center",
+          key: "value",
+          minWidth: 100,
+        },
+        {
+          title: "展示名称",
+          align: "center",
+          key: "title",
+          minWidth: 100,
+          render: (h, params) => {
+            const { index } = params;
+            const currentRow = JSON.parse(
+              JSON.stringify(this.formModalTableData[index])
+            );
+            return h("Input", {
+              props: {
+                value: currentRow.title,
+                type: "text",
+              },
+              on: {
+                "on-change": (e) => {
+                  currentRow.title = e.target.value;
+                  this.formModalTableData.splice(index, 1, currentRow);
+                },
+              },
+            });
+          },
+        },
+      ],
+      formModalTableData: [
+        {
+          is_show: true,
+          key: "order_no",
+          value: "订单编号",
+          title: "订单编号",
+        },
+        {
+          is_show: true,
+          key: "residential_name",
+          value: "项目名称",
+          title: "项目名称",
+        },
+        {
+          is_show: true,
+          key: "client_name",
+          value: "客户姓名",
+          title: "客户姓名",
+        },
+        { is_show: true, key: "address", value: "客户地址", title: "客户地址" },
+        { is_show: true, key: "salesman", value: "业务员", title: "业务员" },
+        { is_show: true, key: "state", value: "订单状态", title: "订单状态" },
+        { is_show: true, key: "crt_id", value: "制单人", title: "制单人" },
+        {
+          is_show: true,
+          key: "leading_name",
+          value: "负责人",
+          title: "负责人",
+        },
+        {
+          is_show: true,
+          key: "warning_state",
+          value: "紧急程度",
+          title: "紧急程度",
+        },
+        {
+          is_show: true,
+          key: "",
+          value: "订单创建时间",
+          title: "订单创建时间",
+        },
+      ],
+      tableColums: [
+        {
+          type: "selection",
+          title: "全选",
+          key: "selection",
+          fixed: "left",
+          width: "90",
+          align: "center",
+        },
+        { title: "订单编号", align: "center", key: "order_no", minWidth: 200 },
+        { title: "计划单号", align: "center", key: "plan_no", minWidth: 200 },
+        {
+          title: "订单类型",
+          align: "center",
+          key: "order_type",
+          minWidth: 150,
+          render(h, params) {
+            return h("span", {}, params.row.order_type == 1 ? "工装" : "家装");
+          },
+        },
+        {
+          title: "订单状态",
+          align: "center",
+          key: "state",
+          minWidth: 150,
+          render: (h, params) =>
+            h(
+              "span",
+              {},
+              params.row.state == 0
+                ? "未派工"
+                : params.row.state == 1
+                ? "派工中"
+                : params.row.state == 2
+                ? "完成"
+                : ""
+            ),
+        },
+        { title: "业务员", align: "center", key: "nickname", minWidth: 150 },
+        {
+          title: "紧急程度",
+          align: "center",
+          key: "warning_state",
+          minWidth: 150,
+          slot: "basicTypeSet",
+        },
+        {
+          title: "项目名称",
+          align: "center",
+          key: "residential_name",
+          minWidth: 200,
+        },
+        {
+          title: "计划开始时间",
+          align: "center",
+          minWidth: 200,
+          key: "plan_start_time",
+          render: (h, params) =>
+            h("span", {}, this.func.replaceDate(params.row.plan_start_time, 1)),
+        },
+        {
+          title: "计划结束时间",
+          align: "center",
+          minWidth: 200,
+          key: "plan_end_time",
+          render: (h, params) =>
+            h("span", {}, this.func.replaceDate(params.row.plan_end_time, 1)),
+        },
+        {
+          title: "生产进度",
+          align: "center",
+          key: "complete_rate",
+          minWidth: 100,
+          render: (h, params) =>
+            h("span", {}, parseInt(params.row.complete_rate * 100) + "%"),
+        },
+        {
+          title: "预估交付日期",
+          align: "center",
+          key: "predict_time",
+          minWidth: 200,
+          render: (h, params) =>
+            h("span", {}, this.func.replaceDate(params.row.predict_time, 1)),
+        },
+        {
+          title: "操作",
+          align: "center",
+          key: "set",
+          slot: "set",
+          fixed: "right",
+          width: "150",
+        },
+      ],
+      tableData: [],
+      showModal:false,
+      page_index: 1,
+      currencyPageId:null,
+      page_size: 10,
+      total: 0,
+      proxyObj: {},
+      showTableColums: false,
+      selects: [],
+      tableheaders: [],
+      userList: [],
+      //详情页返回保留搜索数据
+      corssPageData: localStorage.getItem("corssPageData")
+        ? JSON.parse(localStorage.getItem("corssPageData"))
+        : {},
+      warningList: [],
+    };
+  },
+  beforeRouteEnter(to, from, next) {
+    next((vm) => {
+      if (from.path != "/cms/productionorderlist/productionplanlist/details") {
+        localStorage.removeItem("corssPageData");
+      } else {
+        vm.firstEnter = 1;
+      }
+    });
+  },
+  beforeRouteLeave(to, from, next) {
+    if (to.path == "/cms/productionorderlist/productionplanlist/details") {
+      (this.corssPageData.page_index = this.page_index),
+        (this.corssPageData.page_size = this.page_size),
+        localStorage.setItem(
+          "corssPageData",
+          JSON.stringify(this.corssPageData)
+        );
+    } else {
+      localStorage.removeItem("corssPageData");
+    }
+    next((vm) => {});
+  },
+  created() {
+    // 获取紧急程度
+    this.axios.get("/api/warning_list").then((res) => {
+      this.warningList = res.data.data;
+    });
+    this.axios
+      .get("/api/employee_list")
+      .then((res) => (this.userList = res.data));
+    //this.axios.get('/api/employee_list').then(res => { this.employeeList = res.data })
+    this.currencyPageId = this.$store.state.navgationData[0].sub[0].sub[0].id;
+  },
+  computed: {
+    ...mapState(["persimissionData"]),
+    computedTable() {
+      // if (this.tableheaders.length < 1) {
+      return this.tableColums;
+      // }
+      // return this.func.computedHeader(this.tableheaders, this.tableColums)
+    },
+    set_list() {
+      return [
+        {
+          title: "订单编号",
+          name: "Input",
+          serverName: "order_no",
+          placeholder: "请输入订单编号",
+          value: "",
+        },
+        {
+          title: "项目名称",
+          name: "Input",
+          serverName: "residential_name",
+          placeholder: "请选择项目名称",
+          value: "",
+        },
+        {
+          title: "订单类型",
+          name: "Select",
+          placeholder: "请选择",
+          serverName: "order_type",
+          value: "",
+          option: [
+            { label: "工装", value: 1 },
+            { label: "家装", value: 0 },
+          ],
+        },
+        {
+          title: "计划单号",
+          name: "Input",
+          serverName: "plan_no",
+          placeholder: "请填写计划单号",
+          value: "",
+        },
+        {
+          title: "业务员",
+          name: "Select",
+          serverName: "nickname",
+          placeholder: "请选择",
+          value: "",
+          optionName: "nickname",
+          optionValue: "id",
+          option: this.userList,
+        },
+        {
+          title: "计划开始时间",
+          name: "Input",
+          start_server: "start_time",
+          end_server: "end_time",
+          start_value: "",
+          end_value: "",
+          isDate: true,
+          serverName: "id2",
+          start_placeholder: "开始日期",
+          end_placeholder: "结束日期",
+        },
+        {
+          title: "紧急程度",
+          name: "Select",
+          serverName: "warning_state",
+          placeholder: "请选择",
+          value: "",
+          optionName: "title",
+          optionValue: "id",
+          option: this.warningList,
+        },
+        {
+          title: "订单状态",
+          name: "Select",
+          placeholder: "请选择",
+          serverName: "state",
+          value: "",
+          option: [
+            { label: "未派工", value: 0 },
+            { label: "派工中", value: 1 },
+            { label: "完成", value: 2 },
+          ],
+        },
+      ];
+    },
+  },
+  methods: {
+    handleModalOk(){
+        this.formModalTableData.forEach((element, index) => {
+        element.sort = index;
+      });
+      this.tableModalTableData.forEach((element, index) => {
+        element.sort = index;
+      });
+      this.axios({
+        method: "post",
+        url: "/api/update/table",
+        data: {
+          id: this.currencyPageId,
+          result: {
+            formSet: this.formModalTableData,
+            tableSet: this.tableModalTableData,
+          },
+        },
+      }).then((res) => {
+        this.$Message.success(res.msg);
+        this.init(this.proxyObj);
+      });
+    },
+    init(row) {
+      const { order_no } = this.$route.query;
+      if (order_no) {
+        row.order_no = order_no;
+        this.set_list[0].value = order_no;
+      }
+      row.sub_state = 5;
+      if (this.firstEnter == 1) {
+        this.corssPageData = JSON.parse(localStorage.getItem("corssPageData"));
+        row = this.corssPageData;
+        this.proxyObj = row;
+        this.searchData(row);
+      } else {
+        this.page_index = 1;
+        row.page_index = this.page_index;
+        row.page_size = this.page_size;
+        this.proxyObj = row;
+        this.getData(row);
+      }
+    },
+    searchData(row) {
+      if (this.firstEnter == 1) {
+        this.page_index = this.corssPageData.page_index;
+        this.page_size = this.corssPageData.page_size;
+        this.set_list[0].value = this.corssPageData.order_no;
+        this.set_list[1].value = this.corssPageData.residential_name;
+        this.set_list[3].value = this.corssPageData.warning_state;
+        this.set_list[4].value = this.corssPageData.state;
+        this.set_list[2].start_value = this.corssPageData.start_time
+          ? this.corssPageData.start_time
+          : "";
+        this.set_list[2].end_value = this.corssPageData.end_time
+          ? this.corssPageData.end_time
+          : "";
+        this.corssPageData.type = this.$route.query.type;
+        this.getData(this.corssPageData);
+      } else {
+        this.page_index = 1;
+        row.page_index = this.page_index;
+        row.page_size = this.page_size;
+        this.corssPageData.order_no = this.set_list[0].value;
+        this.corssPageData.residential_name = this.set_list[1].value;
+        this.corssPageData.warning_state = this.set_list[3].value;
+        this.corssPageData.state = this.set_list[4].value;
+        this.corssPageData.start_time = this.func.setDate(
+          this.set_list[2].start_value
+        );
+        this.corssPageData.end_time = this.func.setDate(
+          this.set_list[2].end_value
+        );
+        this.proxyObj = row;
+        this.getData(row);
+      }
+    },
+    changePage(e) {
+      this.page_index = e;
+      this.proxyObj.page_index = this.page_index;
+      this.proxyObj.page_size = this.page_size;
+      this.getData(this.proxyObj);
+    },
+    changeSize(e) {
+      this.page_size = e;
+      this.proxyObj.page_size = this.page_size;
+      this.getData(this.proxyObj);
+    },
+    getData(row) {
+      this.axios("/api/orders_produce_plan_list", { params: row }).then(
+        (res) => {
+          this.firstEnter++;
+          this.tableData = res.data.data;
+          this.total = res.data.total;
+          // this.tableheaders = res.data.tableSet || []
+        }
+      );
+    },
+    setTableColums() {
+      //设置表头
+      this.showTableColums = true;
+    },
+    goDetial(row) {
+      this.$router.push({
+        path: "/cms/productionorderlist/productionplanlist/details",
+        query: {
+          order_no: row.order_no,
+          plan_no: row.plan_no,
+        },
+      });
+    },
+     onDragDrop(a, b, table, type) {
+      if (type == 2 && (a == 0 || b == 0)) {
+        return this.$Message.warning("全选位置不可变");
+      }
+      table.splice(b, 0, ...table.splice(a, 1));
+    },
+    handleDispatchType(row) {
+      console.log("row :>> ", row);
+      this.$router.push({
+        path: "/cms/Dispatching/Dispatching",
+        query: {
+          order_no: row.order_no,
+          plan_no: row.plan_no,
+        },
+      });
+    },
+    dispatchList(row) {
+      this.dispatchOrder({
+        params: {
+          order_no: Array.isArray(row) ? this.selects.join(",") : row.order_no,
+        },
+        then: () => this.getData(this.proxyObj),
+      });
+    },
+    selectTable(e) {
+      let result = [];
+      e.map((v) => result.push(v.order_no));
+      this.selects = result;
+    },
+    setupTableHeader() {
+       this.showModal = true;
+      return;
+      // this.tableheaders.length < 1
+      //   ? (this.tableheaders = this.tableColums.reduce(
+      //       (pre, cur) => pre.concat(cur.key),
+      //       []
+      //     ))
+      //   : "";
+      // this.$setTableheader({
+      //   list: this.tableColums,
+      //   selects: this.tableheaders,
+      //   then: (result) => {
+      //     this.tableheaders = result;
+      //     this.axios
+      //       .post("/api/update/table", { id: this.$route.query.id, result })
+      //       .then((res) => {
+      //         if (res.code == 200) {
+      //           this.$Message.success(res.msg);
+                // let data =[];
+                // for(let i = 0 ; i++ ; i<this.tableColums){
+                //   if(this.tableColums[i].title.indexOf(result)>=0){
+                //              data.push(this.tableColums[i])
+                //   }
+                // }
+                // this.computedTable = data
+       //       }
+      //      });
+     //   },
+    //  });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.pageSlotStyle {
+  display: flex;
+  justify-content: center;
+  margin-top: 40px;
+}
+.modal_content {
+  display: flex;
+  justify-content: center;
+  // width: 500px;
+}
+</style>

+ 334 - 0
src/views/ProductionOrderList/ProductionsOrder/BST_two.vue

@@ -0,0 +1,334 @@
+<template>
+  <div>
+    <FullPage title='生产订单列表1'
+              :list='set_list'
+              @init='init'
+              @searchData='searchData'
+              @changePage='changePage'
+              @changeSize='changeSize'
+              @selectTable='selectTable'
+              :tableColums='computedTable'
+              :showPage='false'
+              :tableData='tableData'
+              :page_index='page_index'
+              :total='total'>
+      <div slot='titleButton'>
+        <!-- <Button v-if='persimissionData["批量打印二维码"]||persimissionData.all'
+                type="primary"
+                style="margin-right:10px"
+                ghost>批量打印二维码</Button> -->
+        <Button @click="openModal(selects)"
+                type="primary"
+                ghost>批量下生产排产</Button>
+      </div>
+
+      <div slot='navButton'>
+        <!-- <Button @click="setupTableHeader"
+                v-if='persimissionData["表头设置"]||persimissionData.all'
+                type="primary"
+                ghost
+                icon='ios-cog'>表头设置</Button> -->
+      </div>
+      <template slot="basicTypeSet"
+                slot-scope="{row}">
+        <div>
+          <span v-for="item in warningList"
+                :key="item.id"
+                :style="{color:item.color}"
+                v-show="item.id==row.warning_state">{{item.title}}</span>
+        </div>
+      </template>
+      <template slot='set'
+                slot-scope='{row}'>
+        <div>
+          <!-- <a v-if='persimissionData["原材料预算"]||persimissionData.all'
+             style="margin:0 5px"
+             @click="goOriginalPage(row)">原材料预算</a> -->
+          <!-- <a v-if='persimissionData["打印二维码"]||persimissionData.all'
+             style="margin:0 5px">打印二维码</a> -->
+          <a v-if='persimissionData["详情"]||persimissionData.all'
+             style="margin:0 5px"
+             @click="goDetial(row)">详情</a>
+          <a v-if='persimissionData["下生产计划"]||persimissionData.all'
+             style="margin:0 5px"
+             :disabled="row.state==2"
+             @click="openModal(row)">下生产排产</a>
+        </div>
+      </template>
+      <template slot="pageSlot">
+        <div class="pageSlotStyle">
+          <Page :page-size-opts="[10, 20, 30, 40,100,1000]"
+                @on-page-size-change='changeSize'
+                @on-change='changePage'
+                :current='page_index'
+                show-total
+                :total="total"
+                show-sizer
+                :page-size='page_size' />
+        </div>
+      </template>
+    </FullPage>
+  </div>
+</template>
+
+<script>
+import { mapState } from 'vuex'
+export default {
+  data () {
+    return {
+      tableColums: [
+        { type: 'selection', key: 'selection', title: '全选', fixed: 'left', width: 90, align: 'center' },
+        { title: '订单编号', align: 'center', key: 'order_no', width: '200' },
+        {
+          title: '订单类型', align: 'center', key: 'order_type', width: '200',
+          render: (h, params) => {
+            return h('span', {}, params.row.order_type == 1 ? '工装' : '家装')
+          }
+        },
+        // {
+        //   title: '生产订单编号', align: 'center', key: 'oa_order_no', minWidth: 200,
+        //   render: (h, params) => h('span', {}, params.row.oa_order_no || params.row.order_no)
+        // },
+        {
+          title: '生产状态', align: 'center', key: 'state', minWidth: 150,
+          render: (h, params) => h('span', {},
+            params.row.state == 0 ? '未下计划'
+              : (params.row.state == 1 ? '计划中'
+                : (params.row.state >= 2 ? '计划完成' : '全部'))
+          )
+        },
+        { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 200 },
+        { title: '地址', align: 'center', key: 'address', minWidth: 200 },
+        { title: '客户姓名', align: 'center', key: 'client_name', minWidth: 200 },
+        { title: '手机号', align: 'center', key: 'mobile', minWidth: 200 },
+        // { title: '测量人员', align: 'center', key: 'nickname', minWidth: 200 },
+        { title: '紧急程度', align: 'center', key: 'warning_state', minWidth: 100, slot: 'basicTypeSet', },
+        {
+          title: '下单日期', align: 'center', minWidth: 200, key: 'crt_time',
+          render: (h, params) => h('span', {}, this.func.replaceDate(params.row.crt_time * 1))
+        },
+        // {
+        //   title: '测量开始日期', align: 'center', minWidth: 200, key: 'measure_start_time',
+        //   render: (h, params) => h('span', {}, this.func.replaceDate(params.row.measure_start_time * 1, 1))
+        // },
+        // {
+        //   title: '测量结束日期', align: 'center', minWidth: 200, key: 'measure_end_time',
+        //   render: (h, params) => h('span', {}, this.func.replaceDate(params.row.measure_end_time * 1, 1))
+        // },
+        // {
+        //   title: '实际测量时间', align: 'center', minWidth: 200, key: 'measure_time',
+        //   render: (h, params) => h('span', {}, this.func.replaceDate(params.row.measure_time * 1))
+        // },
+        { title: '操作', align: 'center', key: 'set', slot: 'set', fixed: 'right', width: '320' },
+      ],
+      tableData: [],
+      page_index: 1,
+      page_size: 10,
+      total: 0,
+      planInfo: {
+        order_no: null,
+        start_time: '',
+        end_time: '',
+        state: 3,
+      },
+      selects: [],
+      tableheaders: [],
+      //详情页返回保留搜索数据
+      corssPageData: localStorage.getItem('corssPageData') ? JSON.parse(localStorage.getItem('corssPageData')) : {},
+      userList: [],
+      warningList: [],
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      if (from.path != '/cms/productionorderlist/productionsorder/Decorationlist') {
+        localStorage.removeItem('corssPageData')
+      } else {
+        vm.firstEnter = 1
+      }
+    });
+  },
+  beforeRouteLeave (to, from, next) {
+    if (to.path == '/cms/productionorderlist/productionsorder/Decorationlist') {
+      this.corssPageData.page_index = this.page_index,
+        this.corssPageData.page_size = this.page_size,
+        localStorage.setItem('corssPageData', JSON.stringify(this.corssPageData))
+    } else {
+      localStorage.removeItem('corssPageData')
+    }
+    next(vm => {
+    });
+  },
+  created () {
+    // 获取用户列表
+    this.axios({ method: 'get', url: '/api/user', }).then((res) => { this.userList = res.data.data }).catch((err) => { });
+    // 获取紧急程度
+    this.axios.get('/api/warning_list').then(res => { this.warningList = res.data.data })
+  },
+  computed: {
+    ...mapState(['persimissionData']),
+    computedTable () {
+      // if (this.tableheaders.length < 1) {
+      return this.tableColums
+      // }
+      // return this.func.computedHeader(this.tableheaders, this.tableColums)
+    },
+    set_list () {
+      return [
+        { title: '订单编号', name: 'Input', serverName: 'order_no', placeholder: '请输入订单编号', value: '' },
+        { title: '项目名称', name: 'Input', serverName: 'residential_name', placeholder: '请输入项目名称', value: '' },
+        {
+          title: '订单类型', name: 'Select', serverName: 'order_type', placeholder: '请选择', value: '',
+          option: [
+            { label: '工装', value: 1 },
+            { label: '家装', value: 0 }
+          ]
+        },
+        {
+          title: '测量人员', name: 'Select', serverName: 'type', optionName: 'nickname', optionValue: 'id', placeholder: '请选择', value: '',
+          option: this.userList
+        },
+        { title: '客户名字', name: 'Input', serverName: 'client_name', placeholder: '请输入', value: '' },
+        { title: '手机号', name: 'Input', serverName: 'mobile', placeholder: '请输入', value: '' },
+        { title: '紧急程度', name: 'Select', serverName: 'warning_state', placeholder: '请选择', value: '', optionName: 'title', optionValue: 'id', option: this.warningList },
+        {
+          title: '生产状态', name: 'Select', placeholder: '请选择', serverName: 'state', value: '',
+          option: [
+            { label: '未下计划', value: 0 },
+            { label: '计划中', value: 1 },
+            { label: '计划完成', value: 2 },
+          ]
+        },
+        { title: '下单日期范围', name: 'Input', start_server: 'start_time', end_server: 'end_time', start_value: '', end_value: '', isDate: true, serverName: 'id2', start_placeholder: '开始日期', end_placeholder: '结束日期' },
+      ]
+    }
+  },
+  methods: {
+    init (row) {
+      // row.page_index = this.page_index;
+      // row.page_size = this.page_size;
+      if (this.firstEnter == 1) {
+        this.corssPageData = JSON.parse(localStorage.getItem('corssPageData'))
+        row = this.corssPageData
+        this.proxyObj = row
+        this.searchData(row)
+      } else {
+        this.page_index = 1
+        row.page_index = this.page_index;
+        row.page_size = this.page_size;
+        this.proxyObj = row
+        this.getData(row)
+      }
+    },
+    searchData (row) {
+      if (this.firstEnter == 1) {
+        this.page_index = this.corssPageData.page_index;
+        this.page_size = this.corssPageData.page_size;
+        this.set_list[0].value = this.corssPageData.order_no
+        this.set_list[1].value = this.corssPageData.type
+        this.set_list[2].value = this.corssPageData.client_name
+        this.set_list[3].value = this.corssPageData.mobile
+        this.set_list[4].value = this.corssPageData.warning_state
+        this.set_list[5].value = this.corssPageData.state
+        this.set_list[6].start_value = this.corssPageData.start_time ? this.corssPageData.start_time : ''
+        this.set_list[6].end_value = this.corssPageData.end_time ? this.corssPageData.end_time : ''
+        this.corssPageData.type = this.$route.query.type
+        this.getData(this.corssPageData)
+      } else {
+        this.page_index = 1
+        row.page_index = this.page_index;
+        row.page_size = this.page_size;
+        this.corssPageData.order_no = this.set_list[0].value
+        this.corssPageData.type = this.set_list[1].value
+        this.corssPageData.client_name = this.set_list[2].value
+        this.corssPageData.mobile = this.set_list[3].value
+        this.corssPageData.warning_state = this.set_list[4].value
+        this.corssPageData.state = this.set_list[5].value
+        this.corssPageData.start_time = this.func.setDate(this.set_list[6].start_value)
+        this.corssPageData.end_time = this.func.setDate(this.set_list[6].end_value)
+        this.proxyObj = row
+        this.getData(row)
+      }
+    },
+    changePage (e) {
+      this.page_index = e;
+      this.proxyObj.page_index = this.page_index;
+      this.getData(this.proxyObj)
+    },
+    changeSize (e) {
+      this.page_size = e;
+      this.proxyObj.page_size = this.page_size;
+      this.getData(this.proxyObj)
+    },
+    getData (row) {
+      this.axios('/api/orders_produce_order_list', { params: row }).then(res => {
+        this.tableData = res.data.data;
+        this.firstEnter++
+        this.total = res.data.total;
+        this.tableheaders = res.data.tableSet || []
+      })
+    },
+    goDetial (row) {
+      this.$router.push({
+        path: '/cms/productionorderlist/productionsorder/Decorationlist',
+        query: {
+          order_no: row.order_no,
+          type: 'produce',
+          oa_id:row.oa_id
+        }
+      })
+    },
+    openModal (row) {
+      if (Array.isArray(row)) {
+        if (row.length < 1) { return this.$Message.warning('请选择一项') }
+        this.planInfo.order_no = row.reduce((pre, cur, idx) => `${pre}${cur.order_no}${idx == row.length - 1 ? '' : ','}`, '')
+      } else {
+        this.planInfo.order_no = row.order_no;
+      }
+      this.downProduction({
+        title: '下生产排产',
+        type: 1,
+        params: this.planInfo,
+        then: (e) => { this.getData(this.proxyObj) },
+        cancel: (e) => { },
+      })
+    },
+    goOriginalPage (row) {
+      this.$router.push({
+        path: '/cms/rawmateria/index',
+        query: {
+          order_no: row.order_no,
+          type: 4,
+          residential_name: row.residential_name
+        }
+      })
+    },
+    selectTable (e) {
+      this.selects = e;
+    },
+    setupTableHeader () {
+      this.tableheaders.length < 1 ? this.tableheaders = this.tableColums.reduce((pre, cur) => pre.concat(cur.key), []) : ''
+      this.$setTableheader({
+        list: this.tableColums,
+        selects: this.tableheaders,
+        then: (result) => {
+          this.tableheaders = result
+          this.axios.post('/api/update/table', { id: this.$route.query.id, result }).then(res => {
+            if (res.code == 200) {
+              this.$Message.success(res.msg)
+            }
+          })
+        }
+      })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.pageSlotStyle {
+  display: flex;
+  justify-content: center;
+  margin-top: 40px;
+}
+</style>

+ 8 - 323
src/views/ProductionOrderList/ProductionsOrder/list.vue

@@ -1,334 +1,19 @@
 <template>
   <div>
-    <FullPage title='生产订单列表'
-              :list='set_list'
-              @init='init'
-              @searchData='searchData'
-              @changePage='changePage'
-              @changeSize='changeSize'
-              @selectTable='selectTable'
-              :tableColums='computedTable'
-              :showPage='false'
-              :tableData='tableData'
-              :page_index='page_index'
-              :total='total'>
-      <div slot='titleButton'>
-        <!-- <Button v-if='persimissionData["批量打印二维码"]||persimissionData.all'
-                type="primary"
-                style="margin-right:10px"
-                ghost>批量打印二维码</Button> -->
-        <Button @click="openModal(selects)"
-                type="primary"
-                ghost>批量下生产排产</Button>
-      </div>
-
-      <div slot='navButton'>
-        <!-- <Button @click="setupTableHeader"
-                v-if='persimissionData["表头设置"]||persimissionData.all'
-                type="primary"
-                ghost
-                icon='ios-cog'>表头设置</Button> -->
-      </div>
-      <template slot="basicTypeSet"
-                slot-scope="{row}">
-        <div>
-          <span v-for="item in warningList"
-                :key="item.id"
-                :style="{color:item.color}"
-                v-show="item.id==row.warning_state">{{item.title}}</span>
-        </div>
-      </template>
-      <template slot='set'
-                slot-scope='{row}'>
-        <div>
-          <!-- <a v-if='persimissionData["原材料预算"]||persimissionData.all'
-             style="margin:0 5px"
-             @click="goOriginalPage(row)">原材料预算</a> -->
-          <!-- <a v-if='persimissionData["打印二维码"]||persimissionData.all'
-             style="margin:0 5px">打印二维码</a> -->
-          <a v-if='persimissionData["详情"]||persimissionData.all'
-             style="margin:0 5px"
-             @click="goDetial(row)">详情</a>
-          <a v-if='persimissionData["下生产计划"]||persimissionData.all'
-             style="margin:0 5px"
-             :disabled="row.state==2"
-             @click="openModal(row)">下生产排产</a>
-        </div>
-      </template>
-      <template slot="pageSlot">
-        <div class="pageSlotStyle">
-          <Page :page-size-opts="[10, 20, 30, 40,100,1000]"
-                @on-page-size-change='changeSize'
-                @on-change='changePage'
-                :current='page_index'
-                show-total
-                :total="total"
-                show-sizer
-                :page-size='page_size' />
-        </div>
-      </template>
-    </FullPage>
+    <typeOne v-if="true"/>
+    <BSTTwo v-else/>
   </div>
 </template>
-
 <script>
-import { mapState } from 'vuex'
+import typeOne from '@/views/ProductionOrderList/ProductionsOrder/type_one'
+import BSTTwo from '@/views/ProductionOrderList/ProductionsOrder/BST_two'
 export default {
-  data () {
-    return {
-      tableColums: [
-        { type: 'selection', key: 'selection', title: '全选', fixed: 'left', width: 90, align: 'center' },
-        { title: '订单编号', align: 'center', key: 'order_no', width: '200' },
-        {
-          title: '订单类型', align: 'center', key: 'order_type', width: '200',
-          render: (h, params) => {
-            return h('span', {}, params.row.order_type == 1 ? '工装' : '家装')
-          }
-        },
-        // {
-        //   title: '生产订单编号', align: 'center', key: 'oa_order_no', minWidth: 200,
-        //   render: (h, params) => h('span', {}, params.row.oa_order_no || params.row.order_no)
-        // },
-        {
-          title: '生产状态', align: 'center', key: 'state', minWidth: 150,
-          render: (h, params) => h('span', {},
-            params.row.state == 0 ? '未下计划'
-              : (params.row.state == 1 ? '计划中'
-                : (params.row.state >= 2 ? '计划完成' : '全部'))
-          )
-        },
-        { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 200 },
-        { title: '地址', align: 'center', key: 'address', minWidth: 200 },
-        { title: '客户姓名', align: 'center', key: 'client_name', minWidth: 200 },
-        { title: '手机号', align: 'center', key: 'mobile', minWidth: 200 },
-        // { title: '测量人员', align: 'center', key: 'nickname', minWidth: 200 },
-        { title: '紧急程度', align: 'center', key: 'warning_state', minWidth: 100, slot: 'basicTypeSet', },
-        {
-          title: '下单日期', align: 'center', minWidth: 200, key: 'crt_time',
-          render: (h, params) => h('span', {}, this.func.replaceDate(params.row.crt_time * 1))
-        },
-        // {
-        //   title: '测量开始日期', align: 'center', minWidth: 200, key: 'measure_start_time',
-        //   render: (h, params) => h('span', {}, this.func.replaceDate(params.row.measure_start_time * 1, 1))
-        // },
-        // {
-        //   title: '测量结束日期', align: 'center', minWidth: 200, key: 'measure_end_time',
-        //   render: (h, params) => h('span', {}, this.func.replaceDate(params.row.measure_end_time * 1, 1))
-        // },
-        // {
-        //   title: '实际测量时间', align: 'center', minWidth: 200, key: 'measure_time',
-        //   render: (h, params) => h('span', {}, this.func.replaceDate(params.row.measure_time * 1))
-        // },
-        { title: '操作', align: 'center', key: 'set', slot: 'set', fixed: 'right', width: '320' },
-      ],
-      tableData: [],
-      page_index: 1,
-      page_size: 10,
-      total: 0,
-      planInfo: {
-        order_no: null,
-        start_time: '',
-        end_time: '',
-        state: 3,
-      },
-      selects: [],
-      tableheaders: [],
-      //详情页返回保留搜索数据
-      corssPageData: localStorage.getItem('corssPageData') ? JSON.parse(localStorage.getItem('corssPageData')) : {},
-      userList: [],
-      warningList: [],
-    }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      if (from.path != '/cms/productionorderlist/productionsorder/Decorationlist') {
-        localStorage.removeItem('corssPageData')
-      } else {
-        vm.firstEnter = 1
-      }
-    });
-  },
-  beforeRouteLeave (to, from, next) {
-    if (to.path == '/cms/productionorderlist/productionsorder/Decorationlist') {
-      this.corssPageData.page_index = this.page_index,
-        this.corssPageData.page_size = this.page_size,
-        localStorage.setItem('corssPageData', JSON.stringify(this.corssPageData))
-    } else {
-      localStorage.removeItem('corssPageData')
-    }
-    next(vm => {
-    });
-  },
-  created () {
-    // 获取用户列表
-    this.axios({ method: 'get', url: '/api/user', }).then((res) => { this.userList = res.data.data }).catch((err) => { });
-    // 获取紧急程度
-    this.axios.get('/api/warning_list').then(res => { this.warningList = res.data.data })
-  },
-  computed: {
-    ...mapState(['persimissionData']),
-    computedTable () {
-      // if (this.tableheaders.length < 1) {
-      return this.tableColums
-      // }
-      // return this.func.computedHeader(this.tableheaders, this.tableColums)
-    },
-    set_list () {
-      return [
-        { title: '订单编号', name: 'Input', serverName: 'order_no', placeholder: '请输入订单编号', value: '' },
-        { title: '项目名称', name: 'Input', serverName: 'residential_name', placeholder: '请输入项目名称', value: '' },
-        {
-          title: '订单类型', name: 'Select', serverName: 'order_type', placeholder: '请选择', value: '',
-          option: [
-            { label: '工装', value: 1 },
-            { label: '家装', value: 0 }
-          ]
-        },
-        {
-          title: '测量人员', name: 'Select', serverName: 'type', optionName: 'nickname', optionValue: 'id', placeholder: '请选择', value: '',
-          option: this.userList
-        },
-        { title: '客户名字', name: 'Input', serverName: 'client_name', placeholder: '请输入', value: '' },
-        { title: '手机号', name: 'Input', serverName: 'mobile', placeholder: '请输入', value: '' },
-        { title: '紧急程度', name: 'Select', serverName: 'warning_state', placeholder: '请选择', value: '', optionName: 'title', optionValue: 'id', option: this.warningList },
-        {
-          title: '生产状态', name: 'Select', placeholder: '请选择', serverName: 'state', value: '',
-          option: [
-            { label: '未下计划', value: 0 },
-            { label: '计划中', value: 1 },
-            { label: '计划完成', value: 2 },
-          ]
-        },
-        { title: '下单日期范围', name: 'Input', start_server: 'start_time', end_server: 'end_time', start_value: '', end_value: '', isDate: true, serverName: 'id2', start_placeholder: '开始日期', end_placeholder: '结束日期' },
-      ]
-    }
-  },
-  methods: {
-    init (row) {
-      // row.page_index = this.page_index;
-      // row.page_size = this.page_size;
-      if (this.firstEnter == 1) {
-        this.corssPageData = JSON.parse(localStorage.getItem('corssPageData'))
-        row = this.corssPageData
-        this.proxyObj = row
-        this.searchData(row)
-      } else {
-        this.page_index = 1
-        row.page_index = this.page_index;
-        row.page_size = this.page_size;
-        this.proxyObj = row
-        this.getData(row)
-      }
-    },
-    searchData (row) {
-      if (this.firstEnter == 1) {
-        this.page_index = this.corssPageData.page_index;
-        this.page_size = this.corssPageData.page_size;
-        this.set_list[0].value = this.corssPageData.order_no
-        this.set_list[1].value = this.corssPageData.type
-        this.set_list[2].value = this.corssPageData.client_name
-        this.set_list[3].value = this.corssPageData.mobile
-        this.set_list[4].value = this.corssPageData.warning_state
-        this.set_list[5].value = this.corssPageData.state
-        this.set_list[6].start_value = this.corssPageData.start_time ? this.corssPageData.start_time : ''
-        this.set_list[6].end_value = this.corssPageData.end_time ? this.corssPageData.end_time : ''
-        this.corssPageData.type = this.$route.query.type
-        this.getData(this.corssPageData)
-      } else {
-        this.page_index = 1
-        row.page_index = this.page_index;
-        row.page_size = this.page_size;
-        this.corssPageData.order_no = this.set_list[0].value
-        this.corssPageData.type = this.set_list[1].value
-        this.corssPageData.client_name = this.set_list[2].value
-        this.corssPageData.mobile = this.set_list[3].value
-        this.corssPageData.warning_state = this.set_list[4].value
-        this.corssPageData.state = this.set_list[5].value
-        this.corssPageData.start_time = this.func.setDate(this.set_list[6].start_value)
-        this.corssPageData.end_time = this.func.setDate(this.set_list[6].end_value)
-        this.proxyObj = row
-        this.getData(row)
-      }
-    },
-    changePage (e) {
-      this.page_index = e;
-      this.proxyObj.page_index = this.page_index;
-      this.getData(this.proxyObj)
-    },
-    changeSize (e) {
-      this.page_size = e;
-      this.proxyObj.page_size = this.page_size;
-      this.getData(this.proxyObj)
-    },
-    getData (row) {
-      this.axios('/api/orders_produce_order_list', { params: row }).then(res => {
-        this.tableData = res.data.data;
-        this.firstEnter++
-        this.total = res.data.total;
-        this.tableheaders = res.data.tableSet || []
-      })
-    },
-    goDetial (row) {
-      this.$router.push({
-        path: '/cms/productionorderlist/productionsorder/Decorationlist',
-        query: {
-          order_no: row.order_no,
-          type: 'produce',
-          oa_id:row.oa_id
-        }
-      })
-    },
-    openModal (row) {
-      if (Array.isArray(row)) {
-        if (row.length < 1) { return this.$Message.warning('请选择一项') }
-        this.planInfo.order_no = row.reduce((pre, cur, idx) => `${pre}${cur.order_no}${idx == row.length - 1 ? '' : ','}`, '')
-      } else {
-        this.planInfo.order_no = row.order_no;
-      }
-      this.downProduction({
-        title: '下生产排产',
-        type: 1,
-        params: this.planInfo,
-        then: (e) => { this.getData(this.proxyObj) },
-        cancel: (e) => { },
-      })
-    },
-    goOriginalPage (row) {
-      this.$router.push({
-        path: '/cms/rawmateria/index',
-        query: {
-          order_no: row.order_no,
-          type: 4,
-          residential_name: row.residential_name
-        }
-      })
-    },
-    selectTable (e) {
-      this.selects = e;
-    },
-    setupTableHeader () {
-      this.tableheaders.length < 1 ? this.tableheaders = this.tableColums.reduce((pre, cur) => pre.concat(cur.key), []) : ''
-      this.$setTableheader({
-        list: this.tableColums,
-        selects: this.tableheaders,
-        then: (result) => {
-          this.tableheaders = result
-          this.axios.post('/api/update/table', { id: this.$route.query.id, result }).then(res => {
-            if (res.code == 200) {
-              this.$Message.success(res.msg)
-            }
-          })
-        }
-      })
-    },
+  components:{
+    typeOne,
+    BSTTwo
   }
 }
 </script>
+<style scoped>
 
-<style lang="scss" scoped>
-.pageSlotStyle {
-  display: flex;
-  justify-content: center;
-  margin-top: 40px;
-}
 </style>

+ 334 - 0
src/views/ProductionOrderList/ProductionsOrder/type_one.vue

@@ -0,0 +1,334 @@
+<template>
+  <div>
+    <FullPage title='生产订单列表2'
+              :list='set_list'
+              @init='init'
+              @searchData='searchData'
+              @changePage='changePage'
+              @changeSize='changeSize'
+              @selectTable='selectTable'
+              :tableColums='computedTable'
+              :showPage='false'
+              :tableData='tableData'
+              :page_index='page_index'
+              :total='total'>
+      <div slot='titleButton'>
+        <!-- <Button v-if='persimissionData["批量打印二维码"]||persimissionData.all'
+                type="primary"
+                style="margin-right:10px"
+                ghost>批量打印二维码</Button> -->
+        <Button @click="openModal(selects)"
+                type="primary"
+                ghost>批量下生产排产</Button>
+      </div>
+
+      <div slot='navButton'>
+        <!-- <Button @click="setupTableHeader"
+                v-if='persimissionData["表头设置"]||persimissionData.all'
+                type="primary"
+                ghost
+                icon='ios-cog'>表头设置</Button> -->
+      </div>
+      <template slot="basicTypeSet"
+                slot-scope="{row}">
+        <div>
+          <span v-for="item in warningList"
+                :key="item.id"
+                :style="{color:item.color}"
+                v-show="item.id==row.warning_state">{{item.title}}</span>
+        </div>
+      </template>
+      <template slot='set'
+                slot-scope='{row}'>
+        <div>
+          <!-- <a v-if='persimissionData["原材料预算"]||persimissionData.all'
+             style="margin:0 5px"
+             @click="goOriginalPage(row)">原材料预算</a> -->
+          <!-- <a v-if='persimissionData["打印二维码"]||persimissionData.all'
+             style="margin:0 5px">打印二维码</a> -->
+          <a v-if='persimissionData["详情"]||persimissionData.all'
+             style="margin:0 5px"
+             @click="goDetial(row)">详情</a>
+          <a v-if='persimissionData["下生产计划"]||persimissionData.all'
+             style="margin:0 5px"
+             :disabled="row.state==2"
+             @click="openModal(row)">下生产排产</a>
+        </div>
+      </template>
+      <template slot="pageSlot">
+        <div class="pageSlotStyle">
+          <Page :page-size-opts="[10, 20, 30, 40,100,1000]"
+                @on-page-size-change='changeSize'
+                @on-change='changePage'
+                :current='page_index'
+                show-total
+                :total="total"
+                show-sizer
+                :page-size='page_size' />
+        </div>
+      </template>
+    </FullPage>
+  </div>
+</template>
+
+<script>
+import { mapState } from 'vuex'
+export default {
+  data () {
+    return {
+      tableColums: [
+        { type: 'selection', key: 'selection', title: '全选', fixed: 'left', width: 90, align: 'center' },
+        { title: '订单编号', align: 'center', key: 'order_no', width: '200' },
+        {
+          title: '订单类型', align: 'center', key: 'order_type', width: '200',
+          render: (h, params) => {
+            return h('span', {}, params.row.order_type == 1 ? '工装' : '家装')
+          }
+        },
+        // {
+        //   title: '生产订单编号', align: 'center', key: 'oa_order_no', minWidth: 200,
+        //   render: (h, params) => h('span', {}, params.row.oa_order_no || params.row.order_no)
+        // },
+        {
+          title: '生产状态', align: 'center', key: 'state', minWidth: 150,
+          render: (h, params) => h('span', {},
+            params.row.state == 0 ? '未下计划'
+              : (params.row.state == 1 ? '计划中'
+                : (params.row.state >= 2 ? '计划完成' : '全部'))
+          )
+        },
+        { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 200 },
+        { title: '地址', align: 'center', key: 'address', minWidth: 200 },
+        { title: '客户姓名', align: 'center', key: 'client_name', minWidth: 200 },
+        { title: '手机号', align: 'center', key: 'mobile', minWidth: 200 },
+        // { title: '测量人员', align: 'center', key: 'nickname', minWidth: 200 },
+        { title: '紧急程度', align: 'center', key: 'warning_state', minWidth: 100, slot: 'basicTypeSet', },
+        {
+          title: '下单日期', align: 'center', minWidth: 200, key: 'crt_time',
+          render: (h, params) => h('span', {}, this.func.replaceDate(params.row.crt_time * 1))
+        },
+        // {
+        //   title: '测量开始日期', align: 'center', minWidth: 200, key: 'measure_start_time',
+        //   render: (h, params) => h('span', {}, this.func.replaceDate(params.row.measure_start_time * 1, 1))
+        // },
+        // {
+        //   title: '测量结束日期', align: 'center', minWidth: 200, key: 'measure_end_time',
+        //   render: (h, params) => h('span', {}, this.func.replaceDate(params.row.measure_end_time * 1, 1))
+        // },
+        // {
+        //   title: '实际测量时间', align: 'center', minWidth: 200, key: 'measure_time',
+        //   render: (h, params) => h('span', {}, this.func.replaceDate(params.row.measure_time * 1))
+        // },
+        { title: '操作', align: 'center', key: 'set', slot: 'set', fixed: 'right', width: '320' },
+      ],
+      tableData: [],
+      page_index: 1,
+      page_size: 10,
+      total: 0,
+      planInfo: {
+        order_no: null,
+        start_time: '',
+        end_time: '',
+        state: 3,
+      },
+      selects: [],
+      tableheaders: [],
+      //详情页返回保留搜索数据
+      corssPageData: localStorage.getItem('corssPageData') ? JSON.parse(localStorage.getItem('corssPageData')) : {},
+      userList: [],
+      warningList: [],
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      if (from.path != '/cms/productionorderlist/productionsorder/Decorationlist') {
+        localStorage.removeItem('corssPageData')
+      } else {
+        vm.firstEnter = 1
+      }
+    });
+  },
+  beforeRouteLeave (to, from, next) {
+    if (to.path == '/cms/productionorderlist/productionsorder/Decorationlist') {
+      this.corssPageData.page_index = this.page_index,
+        this.corssPageData.page_size = this.page_size,
+        localStorage.setItem('corssPageData', JSON.stringify(this.corssPageData))
+    } else {
+      localStorage.removeItem('corssPageData')
+    }
+    next(vm => {
+    });
+  },
+  created () {
+    // 获取用户列表
+    this.axios({ method: 'get', url: '/api/user', }).then((res) => { this.userList = res.data.data }).catch((err) => { });
+    // 获取紧急程度
+    this.axios.get('/api/warning_list').then(res => { this.warningList = res.data.data })
+  },
+  computed: {
+    ...mapState(['persimissionData']),
+    computedTable () {
+      // if (this.tableheaders.length < 1) {
+      return this.tableColums
+      // }
+      // return this.func.computedHeader(this.tableheaders, this.tableColums)
+    },
+    set_list () {
+      return [
+        { title: '订单编号', name: 'Input', serverName: 'order_no', placeholder: '请输入订单编号', value: '' },
+        { title: '项目名称', name: 'Input', serverName: 'residential_name', placeholder: '请输入项目名称', value: '' },
+        {
+          title: '订单类型', name: 'Select', serverName: 'order_type', placeholder: '请选择', value: '',
+          option: [
+            { label: '工装', value: 1 },
+            { label: '家装', value: 0 }
+          ]
+        },
+        {
+          title: '测量人员', name: 'Select', serverName: 'type', optionName: 'nickname', optionValue: 'id', placeholder: '请选择', value: '',
+          option: this.userList
+        },
+        { title: '客户名字', name: 'Input', serverName: 'client_name', placeholder: '请输入', value: '' },
+        { title: '手机号', name: 'Input', serverName: 'mobile', placeholder: '请输入', value: '' },
+        { title: '紧急程度', name: 'Select', serverName: 'warning_state', placeholder: '请选择', value: '', optionName: 'title', optionValue: 'id', option: this.warningList },
+        {
+          title: '生产状态', name: 'Select', placeholder: '请选择', serverName: 'state', value: '',
+          option: [
+            { label: '未下计划', value: 0 },
+            { label: '计划中', value: 1 },
+            { label: '计划完成', value: 2 },
+          ]
+        },
+        { title: '下单日期范围', name: 'Input', start_server: 'start_time', end_server: 'end_time', start_value: '', end_value: '', isDate: true, serverName: 'id2', start_placeholder: '开始日期', end_placeholder: '结束日期' },
+      ]
+    }
+  },
+  methods: {
+    init (row) {
+      // row.page_index = this.page_index;
+      // row.page_size = this.page_size;
+      if (this.firstEnter == 1) {
+        this.corssPageData = JSON.parse(localStorage.getItem('corssPageData'))
+        row = this.corssPageData
+        this.proxyObj = row
+        this.searchData(row)
+      } else {
+        this.page_index = 1
+        row.page_index = this.page_index;
+        row.page_size = this.page_size;
+        this.proxyObj = row
+        this.getData(row)
+      }
+    },
+    searchData (row) {
+      if (this.firstEnter == 1) {
+        this.page_index = this.corssPageData.page_index;
+        this.page_size = this.corssPageData.page_size;
+        this.set_list[0].value = this.corssPageData.order_no
+        this.set_list[1].value = this.corssPageData.type
+        this.set_list[2].value = this.corssPageData.client_name
+        this.set_list[3].value = this.corssPageData.mobile
+        this.set_list[4].value = this.corssPageData.warning_state
+        this.set_list[5].value = this.corssPageData.state
+        this.set_list[6].start_value = this.corssPageData.start_time ? this.corssPageData.start_time : ''
+        this.set_list[6].end_value = this.corssPageData.end_time ? this.corssPageData.end_time : ''
+        this.corssPageData.type = this.$route.query.type
+        this.getData(this.corssPageData)
+      } else {
+        this.page_index = 1
+        row.page_index = this.page_index;
+        row.page_size = this.page_size;
+        this.corssPageData.order_no = this.set_list[0].value
+        this.corssPageData.type = this.set_list[1].value
+        this.corssPageData.client_name = this.set_list[2].value
+        this.corssPageData.mobile = this.set_list[3].value
+        this.corssPageData.warning_state = this.set_list[4].value
+        this.corssPageData.state = this.set_list[5].value
+        this.corssPageData.start_time = this.func.setDate(this.set_list[6].start_value)
+        this.corssPageData.end_time = this.func.setDate(this.set_list[6].end_value)
+        this.proxyObj = row
+        this.getData(row)
+      }
+    },
+    changePage (e) {
+      this.page_index = e;
+      this.proxyObj.page_index = this.page_index;
+      this.getData(this.proxyObj)
+    },
+    changeSize (e) {
+      this.page_size = e;
+      this.proxyObj.page_size = this.page_size;
+      this.getData(this.proxyObj)
+    },
+    getData (row) {
+      this.axios('/api/orders_produce_order_list', { params: row }).then(res => {
+        this.tableData = res.data.data;
+        this.firstEnter++
+        this.total = res.data.total;
+        this.tableheaders = res.data.tableSet || []
+      })
+    },
+    goDetial (row) {
+      this.$router.push({
+        path: '/cms/productionorderlist/productionsorder/Decorationlist',
+        query: {
+          order_no: row.order_no,
+          type: 'produce',
+          oa_id:row.oa_id
+        }
+      })
+    },
+    openModal (row) {
+      if (Array.isArray(row)) {
+        if (row.length < 1) { return this.$Message.warning('请选择一项') }
+        this.planInfo.order_no = row.reduce((pre, cur, idx) => `${pre}${cur.order_no}${idx == row.length - 1 ? '' : ','}`, '')
+      } else {
+        this.planInfo.order_no = row.order_no;
+      }
+      this.downProduction({
+        title: '下生产排产',
+        type: 1,
+        params: this.planInfo,
+        then: (e) => { this.getData(this.proxyObj) },
+        cancel: (e) => { },
+      })
+    },
+    goOriginalPage (row) {
+      this.$router.push({
+        path: '/cms/rawmateria/index',
+        query: {
+          order_no: row.order_no,
+          type: 4,
+          residential_name: row.residential_name
+        }
+      })
+    },
+    selectTable (e) {
+      this.selects = e;
+    },
+    setupTableHeader () {
+      this.tableheaders.length < 1 ? this.tableheaders = this.tableColums.reduce((pre, cur) => pre.concat(cur.key), []) : ''
+      this.$setTableheader({
+        list: this.tableColums,
+        selects: this.tableheaders,
+        then: (result) => {
+          this.tableheaders = result
+          this.axios.post('/api/update/table', { id: this.$route.query.id, result }).then(res => {
+            if (res.code == 200) {
+              this.$Message.success(res.msg)
+            }
+          })
+        }
+      })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.pageSlotStyle {
+  display: flex;
+  justify-content: center;
+  margin-top: 40px;
+}
+</style>

+ 1 - 0
src/views/cms.vue

@@ -74,6 +74,7 @@ export default {
     ...mapMutations(["updateCrumbs"]),
     ...mapActions(["undata_side_navData"]),
     menuSelect(name, data) {
+      console.log(this.$children)
       let permisssions_id = "";
       sessionStorage.setItem("open-menu", name);
       sessionStorage.removeItem("crumbs");

+ 142 - 31
src/views/leadMatch/roomList/edit.vue

@@ -3,8 +3,9 @@
     <Toptitle :title="$route.query.type==1?'房间编辑':$route.query.type == 2?'房间查看':'房间新增'">
       <slot name="titleButton" class="btn_set">
           <div class="btn_set">
-           <Upload
+           <!-- <Upload
               :headers="headers"
+              multiple
               name="your_file"
               :data="uploadData"
               :show-upload-list="false"
@@ -16,7 +17,18 @@
               v-if="$route.query.type != 2"
             >
               <Button style="margin-left:10px" type="primary">导入</Button>
-            </Upload>
+            </Upload> -->
+          <div class="inputWrap"  v-if="$route.query.type != 2">
+    <button class="inputWrapButton"
+            @click="onClickBtn">图纸导入</button>
+    <input type="file"
+           multiple
+         
+           @change="onChange"
+           ref='file'
+
+           class="inputmultiple" />
+  </div>
         <Button style="margin-left:10px" @click="$router.go(-1)">返回</Button>
         <Button style="margin-left:10px" v-if="$route.query.type != 2" @click="saveData">保存</Button>
         </div>
@@ -78,6 +90,7 @@
   </div>
 </template>
 <script>
+import axios from "axios";
 export default {
   data() {
     return {
@@ -100,7 +113,7 @@ export default {
             { title: "房间号", key: "number", align: "center", minWidth: 70 }
       ],
       showType: false,
-      headers: { Authorization: localStorage.getItem("token") },//请求头
+      headers: { Authorization: localStorage.getItem("token") },
       //进入页面需要获取的数值
       infoNumber:[],
       cut_order_id:'',
@@ -108,6 +121,7 @@ export default {
       number:[],
       region:[],
       cut_order_product_id:'',
+      uploadData_type:true,
     };
   },
   created(){
@@ -242,6 +256,13 @@ export default {
                 cancel:()=>{}
             })
       },
+          objToForm (obj) {
+      let Form = new FormData();
+      for (let i in obj) {
+        Form.append(i, obj[i]);
+      }
+      return Form;
+    },
     initData(row) {
           this.add_tableColumns = [];
           this.axios.post('/api/cut_order_open',{
@@ -268,34 +289,46 @@ export default {
              this.$forceUpdate();
               })
     },
-    handleBeforeUpload() {},
-     uploadError(err) {
-      this.$Message.error(err.msg || "导入失败");
-    },
-    uploadSuccess(res) {
-      if (res.code == 200) {
-        this.$Message.success("导入成功");
-         this.cut_order_id = res.data.cut_order_id;
-        this.formData.project_number = res.data.project_number;
-        this.formData.product_name = res.data.project_name;
-        this.formData.id = res.data.cut_order_id;
-        this.formData.project_abbreviation = res.data.abbreviation;
-        this.formData.start_time =this.func.replaceDate(res.data.crt_time);
-         if(this.infoNumber.length == 0){
-             this.infoNumber.push(res.data.children)
-             this.infoNumber[0].showType = false
-        }else{
-            this.infoNumber.push(res.data.children);
-        this.infoNumber.forEach((item,index)=>{
-          if(item.cut_order_product_id == res.data.children.cut_order_product_id){
-              this.infoNumber.pop();
-              this.infoNumber.splice(index,1,res.data.children)
-          }
-        })}
-      } else {
-        this.$Message.warning(res.msg || "导入失败");
-      }
-      },
+    // handleBeforeUpload(e) {
+    //   console.log(this.uploadData_type)
+    //     if(this.uploadData_type){
+    //       this.uploadData.type = 3
+    //     }else{
+    //       this.uploadData.type = 4
+    //     }
+    //     return false
+    // },
+    //  uploadError(err) {
+    //   this.$Message.error(err.msg || "导入失败");
+    // },
+  // async uploadSuccess(res) {
+  //     if (res.code == 200) {
+  //       this.$Message.success("导入成功");
+  //        this.cut_order_id = res.data.cut_order_id;
+  //       this.formData.project_number = res.data.project_number;
+  //       this.formData.product_name = res.data.project_name;
+  //       this.formData.id = res.data.cut_order_id;
+  //       this.formData.project_abbreviation = res.data.abbreviation;
+  //       this.formData.start_time =this.func.replaceDate(res.data.crt_time);
+  //       this.uploadData_type = false;
+  //       this.uploadData.project_number = res.data.project_number;
+  //       console.log(this.uploadData.project_number)
+  //       this.$forceUpdate();
+  //        if(this.infoNumber.length == 0){
+  //            this.infoNumber.push(res.data.children)
+  //            this.infoNumber[0].showType = false
+  //       }else{
+  //           this.infoNumber.push(res.data.children);
+  //       this.infoNumber.forEach((item,index)=>{
+  //         if(item.cut_order_product_id == res.data.children.cut_order_product_id){
+  //             this.infoNumber.pop();
+  //             this.infoNumber.splice(index,1,res.data.children)
+  //         }
+  //       })}
+  //     } else {
+  //       this.$Message.warning(res.msg || "导入失败");
+  //     }
+  //     },
     show(item,index) {
         item.showType = !item.showType
         if(item.showType){           //全部未展开
@@ -315,6 +348,54 @@ export default {
             this.$forceUpdate();
         }
     },
+     async onChange (e) {
+      let fileList = e.target.files;
+       for (let i in fileList) {
+        if (!isNaN(Number(i))) {
+          this.headers["Content-Type"] = "application/x-www-form-urlencoded";
+            let data = this.objToForm({
+              ...this.uploadData,
+              your_file: fileList[i],
+            });
+      
+            await axios({
+              url: this.$store.state.ip + '/api/cut_order_room_import',
+              headers: this.headers,
+              method: "post",
+              data,
+            }).then((res) => {
+              if (res.data.code == 200) {
+                this.$Message.success("导入成功");
+         this.cut_order_id = res.data.data.cut_order_id;
+        this.formData.project_number = res.data.data.project_number;
+        this.formData.product_name = res.data.data.project_name;
+        this.formData.id = res.data.data.cut_order_id;
+        this.formData.project_abbreviation = res.data.data.abbreviation;
+        this.formData.start_time =this.func.replaceDate(res.data.data.crt_time);
+        this.uploadData_type = false;
+        this.uploadData.project_number = res.data.data.project_number;
+        this.$forceUpdate();
+         if(this.infoNumber.length == 0){
+             this.infoNumber.push(res.data.data.children)
+             this.infoNumber[0].showType = false
+        }else{
+            this.infoNumber.push(res.data.data.children);
+        this.infoNumber.forEach((item,index)=>{
+          if(item.cut_order_product_id == res.data.data.children.cut_order_product_id){
+              this.infoNumber.pop();
+              this.infoNumber.splice(index,1,res.data.data.children)
+          }
+        })}
+              }
+            })
+            // await setTimeout(() => { }, 1000);
+        }
+      }
+        },
+    //点击事件
+    onClickBtn () {
+      this.$refs.file.click()
+    }
   },
 };
 </script>
@@ -367,4 +448,34 @@ export default {
 .btn_set{
     display: flex;
 }
+.inputWrapButton {
+  height: 32px;
+  line-height: 32px;
+  padding: 0 15px;
+  user-select: none;
+  border-radius: 4px;
+  font-size: 14px;
+  display: inline-block;
+  color: #fff;
+  background-color: #2d8cf0;
+  border-color: #2d8cf0;
+  outline: 0;
+  border: none;
+  cursor: pointer;
+  transition: color 0.2s linear, background-color 0.2s linear,
+    border 0.2s linear, box-shadow 0.2s linear;
+  &:hover {
+    background-color: #70b1f7;
+  }
+}
+.inputWrap {
+  position: relative;
+  display: inline-block;
+}
+.inputmultiple {
+  width: 100%;
+  height: 100%;
+  display: none;
+  user-select: none;
+}
 </style>

+ 105 - 6
src/views/leadMatch/weightMemo/edit.vue

@@ -3,8 +3,9 @@
     <Toptitle :title="$route.query.type==1?'码单编辑':$route.query.type == 2?'码单查看':'码单新增'">
       <slot name="titleButton" class="btn_set">
           <div class="btn_set">
-           <Upload
+           <!-- <Upload
               :headers="headers"
+              multiple
               name="your_file"
               :data="uploadData"
               :show-upload-list="false"
@@ -16,7 +17,18 @@
               v-if="$route.query.type != 2"
             >
               <Button style="margin-left:10px" type="primary">导入</Button>
-            </Upload>
+            </Upload> -->
+              <div class="inputWrap"  v-if="$route.query.type != 2">
+    <button class="inputWrapButton"
+            @click="onClickBtn">图纸导入</button>
+    <input type="file"
+           multiple
+         
+           @change="onChange"
+           ref='file'
+
+           class="inputmultiple" />
+           </div>
         <Button style="margin-left:10px" @click="$router.go(-1)">返回</Button>
         <Button style="margin-left:10px" v-if="$route.query.type != 2" @click="saveData">保存</Button>
         </div>
@@ -83,6 +95,7 @@
   </div>
 </template>
 <script>
+import axios from "axios";
 export default {
   data() {
     return {
@@ -181,10 +194,9 @@ export default {
       }
         ];
     },
-    uploadData(){
+      uploadData(){
         return {type:this.infoNumber.length==0?this.$route.query.type:4,
-            project_number:this.formData.project_number
-        }
+         project_number:this.formData.project_number}
     },
   },
   methods: {
@@ -247,7 +259,9 @@ export default {
     initData() {
 
     },
-    handleBeforeUpload() {},
+   handleBeforeUpload(row) {
+     
+    },
      uploadError(err) {
       this.$Message.error(err.msg || "导入失败");
     },
@@ -297,6 +311,61 @@ export default {
             this.$forceUpdate();
         }
     },
+     async onChange (e) {
+      let fileList = e.target.files;
+       for (let i in fileList) {
+        if (!isNaN(Number(i))) {
+          this.headers["Content-Type"] = "application/x-www-form-urlencoded";
+            let data = this.objToForm({
+              ...this.uploadData,
+              your_file: fileList[i],
+            });
+      
+            await axios({
+              url: this.$store.state.ip + '/api/cut_order_import',
+              headers: this.headers,
+              method: "post",
+              data,
+            }).then((res) => {
+              console.log(res)
+              if (res.data.code == 200) {
+                   this.$Message.success("导入成功");
+        this.cut_order_id = res.data.data.cut_order_id;
+        this.formData.project_number = res.data.data.project_number;
+        this.formData.product_name = res.data.data.project_name;
+         this.formData.project_abbreviation = res.data.data.abbreviation;
+        this.formData.id = res.data.data.cut_order_id;
+        this.formData.start_time =this.func.replaceDate(res.data.data.crt_time);
+        console.log(this.formData.start_time)
+        if(this.infoNumber.length == 0){
+             this.infoNumber.push(res.data.data.children)
+             this.infoNumber[0].showType = false
+        }else{
+            this.infoNumber.push(res.data.data.children);
+        this.infoNumber.forEach((item,index)=>{
+          if(item.cut_order_product_id == res.data.data.children.cut_order_product_id){
+              this.infoNumber.pop();
+              this.infoNumber.splice(index,1,res.data.data.children)
+          }
+        })}
+
+        }
+              })
+            // await setTimeout(() => { }, 1000);
+        }
+      }
+        },
+          objToForm (obj) {
+      let Form = new FormData();
+      for (let i in obj) {
+        Form.append(i, obj[i]);
+      }
+      return Form;
+    },
+    //点击事件
+    onClickBtn () {
+      this.$refs.file.click()
+    }
   },
 };
 </script>
@@ -349,4 +418,34 @@ export default {
 .btn_set{
     display: flex;
 }
+.inputWrap {
+  position: relative;
+  display: inline-block;
+}
+.inputmultiple {
+  width: 100%;
+  height: 100%;
+  display: none;
+  user-select: none;
+}
+.inputWrapButton {
+  height: 32px;
+  line-height: 32px;
+  padding: 0 15px;
+  user-select: none;
+  border-radius: 4px;
+  font-size: 14px;
+  display: inline-block;
+  color: #fff;
+  background-color: #2d8cf0;
+  border-color: #2d8cf0;
+  outline: 0;
+  border: none;
+  cursor: pointer;
+  transition: color 0.2s linear, background-color 0.2s linear,
+    border 0.2s linear, box-shadow 0.2s linear;
+  &:hover {
+    background-color: #70b1f7;
+  }
+}
 </style>