Selaa lähdekoodia

Merge branch 'hw' of http://121.41.102.225:8099/Nidong/jiufang

Andy 4 vuotta sitten
vanhempi
commit
0237abad37

+ 9 - 0
src/routerMap/index.js

@@ -805,6 +805,15 @@ const routerMap = [
       require(["@/views/BidSystem/ProductDeOrder/infoDetail"], resolve),
   },
   {
+    path: "/cms/BidSystem/DeepeningOrder/infodetail",
+    name: "BidSystemDeepeningOrderInfoDetail", // 报价系统→生产拆单->详情/新增
+    meta: {
+      index: 3,
+    },
+    component: (resolve) =>
+      require(["@/views/BidSystem/DeepeningOrder/infoDetail"], resolve),
+  },
+  {
     path: "/cms/BidSystem/ProductDeOrder/detail",
     name: "BidSystemProductDeOrderDetail", // 报价系统→生产拆单→拆单
     meta: {

+ 1142 - 0
src/views/BidSystem/DeepeningOrder/infoDetail.vue

@@ -0,0 +1,1142 @@
+<template>
+  <div class="changeDetail">
+    <Toptitle :title="type == 3 ? '生产拆单详情' : type == 10?'深化单新增':'生产拆单新增'">
+      <slot name="titleButton">
+        <!-- <Button type="primary" style="margin-right: 10px" v-if="type == 6||type ==10"
+          >开启拆单</Button
+        > -->
+        <Button type="primary" style="margin-right: 10px" v-if="type == 3"
+          >批量下生产</Button
+        >
+        <Button
+          @click="goback()"
+          type="primary"
+          ghost
+          style="margin-right: 10px"
+          >返回</Button
+        >
+        <Button
+          type="primary"
+          style="margin-right: 10px"
+          v-if="type == 6||type == 10"
+          @click="save"
+          >保存</Button
+        >
+      </slot>
+    </Toptitle>
+    <div class="content">
+      <div class="form">
+        <Form class="form_content" :label-width="100">
+          <FormItem label="项目编号:">
+            <Input
+              v-if="type == 6||type == 10"
+              v-model="saveData.order_no"
+              placeholder="请输入项目编码"
+            />
+            <span style="width: 120px" v-else>{{ formData.order_no }}</span>
+          </FormItem>
+          <FormItem label="项目名称:">
+            <Input
+              v-if="type == 6||type == 10"
+              v-model="saveData.residential_name"
+              placeholder="请输入项目名称"
+            />
+            <span v-else>{{ formData.residential_name }}</span>
+          </FormItem>
+          <FormItem label="项目简称:">
+            <Input
+              v-if="type == 6||type == 10"
+              v-model="saveData.abbreviation"
+              placeholder="请输入项目简称"
+            />
+            <span v-else>{{ formData.abbreviation }}</span>
+          </FormItem>
+          <FormItem label="客户名称:">
+            <Select
+              filterable
+              clearable
+              v-model="saveData.custom_title"
+              @on-change="handleCustomSelect"
+              v-if="type == 6||type == 10"
+            >
+              <Option
+                v-for="(item, index) in custom_title_list"
+                :key="index"
+                :label="item.title"
+                :value="item.id"
+              ></Option>
+            </Select>
+            <span v-else>{{ formData.custom_title }}</span>
+          </FormItem>
+          <FormItem label="紧急程度:">
+            <Select clearable v-model="saveData.warning_state" v-if="type == 6||type == 10">
+              <Option
+                v-for="(item, index) in warning_state_list"
+                :key="index"
+                :label="item.title"
+                :value="item.id"
+              ></Option>
+            </Select>
+            <span v-else>{{ formData.warning_state }}</span>
+          </FormItem>
+          <FormItem label="项目定金:">
+            <Input
+              v-if="type == 6||type == 10"
+              v-model="saveData.front_money"
+              placeholder="请输入项目定金"
+            />
+            <span v-else>{{ formData.front_money }}</span>
+          </FormItem>
+          <FormItem label="详细地址:">
+            <Select
+              clearable
+              filterable
+              v-if="type == 6||type == 10"
+              class="auto-width"
+              @on-change="handleClientDetailChange"
+              v-model="saveData.custom_detail_id"
+            >
+              <Option
+                v-for="item in clientDetailList_address"
+                :label="item.address"
+                :key="item.id"
+                :value="item.id"
+              ></Option>
+            </Select>
+            <span v-else>{{ formData.address }}</span>
+          </FormItem>
+          <FormItem label="手机号:">
+            <Select
+              clearable
+              filterable
+              v-if="type == 6||type == 10"
+              v-model="saveData.custom_detail_mobile"
+            >
+              <Option
+                v-for="item in clientDetailList_mobile"
+                :label="item.mobile"
+                :key="item.id"
+                :value="item.mobile"
+              ></Option>
+            </Select>
+            <!-- <span v-else>{{ formData.mobile }}</span> -->
+            <span v-else>{{
+              clientDetailList_mobile.filter(
+                (v) => v.mobile == saveData.custom_detail_mobile
+              ).length > 0
+                ? clientDetailList_mobile.filter(
+                    (v) => v.mobile == saveData.custom_detail_mobile
+                  )[0].mobile
+                : formData.mobile
+            }}</span>
+          </FormItem>
+          <FormItem label="开始日期:">
+            <DatePicker
+              type="date"
+              v-model="saveData.start_time"
+              placeholder="年/月/日"
+              style="width: 150px"
+              v-if="type == 6||type == 10"
+            ></DatePicker>
+            <span v-else>{{ formData.start_time }}</span>
+          </FormItem>
+          <FormItem label="交付日期:">
+            <DatePicker
+              type="date"
+              v-model="saveData.end_time"
+              placeholder="年/月/日"
+              style="width: 150px"
+              v-if="type == 6||type == 10"
+            ></DatePicker>
+            <span v-else>{{ formData.end_time }}</span>
+          </FormItem>
+          <FormItem label="业务员:">
+            <Select
+              filterable
+              clearable
+              v-model="saveData.nickname"
+              v-if="type == 6||type == 10"
+            >
+              <Option
+                v-for="(item, index) in nickname_list"
+                :key="index"
+                :label="item.nickname"
+                :value="item.id"
+              ></Option>
+            </Select>
+            <span v-else>{{ formData.nickname }}</span>
+          </FormItem>
+          <FormItem label="备注:">
+            <Input
+              v-if="type == 6||type == 10"
+              v-model="saveData.remark"
+              type="textarea"
+              placeholder="请输入备注"
+            />
+            <span v-else>{{ formData.remark }}</span>
+          </FormItem>
+        </Form>
+      </div>
+      <Card style="width: 100%" class="card">
+        <div class="form_middle">
+          <Form class="form_middle_content" :label-width="100">
+            <FormItem label="区域编码:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.area_code"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in area_code"
+                  :key="index"
+                  :label="item.area_code"
+                  :value="item.area_code"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="区域名称:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.area_title"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in area_title"
+                  :key="index"
+                  :label="item.area_title"
+                  :value="item.area_title"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="户型:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.house_type"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in house_type"
+                  :key="index"
+                  :label="item.house_type"
+                  :value="item.house_type"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="楼栋:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.house"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in house"
+                  :key="index"
+                  :label="item.house"
+                  :value="item.house"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="单元:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.unit"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in unit"
+                  :key="index"
+                  :label="item.unit"
+                  :value="item.unit"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="楼层:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.layer"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in layer"
+                  :key="index"
+                  :label="item.layer"
+                  :value="item.layer"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="房号:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.number"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in number"
+                  :key="index"
+                  :label="item.number"
+                  :value="item.number"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="位置:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.position"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in position"
+                  :key="index"
+                  :label="item.position"
+                  :value="item.position"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="产品分类:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.product_type"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in product_type"
+                  :key="index"
+                  :label="item.product_type"
+                  :value="item.product_type"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="图号:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.url_number"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in url_number"
+                  :key="index"
+                  :label="item.url_number"
+                  :value="item.url_number"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="产品名称:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.product_title"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in product_title"
+                  :key="index"
+                  :label="item.product_title"
+                  :value="item.product_title"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="材质:">
+              <Select
+                filterable
+                clearable
+                v-model="searchData.material"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in material"
+                  :key="index"
+                  :label="item"
+                  :value="item"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="颜色:">
+              <Select
+                filterable
+                clearable
+                v-model="searchData.color"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in color"
+                  :key="index"
+                  :label="item"
+                  :value="item"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="工艺:">
+              <Select
+                filterable
+                clearable
+                v-model="searchData.work"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in work"
+                  :key="index"
+                  :label="item"
+                  :value="item"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="左右式:">
+              <Select
+                filterable
+                multiple
+                v-model="searchData.fashion"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in fashion"
+                  :key="index"
+                  :label="
+                    item.fashion === 0
+                      ? '无'
+                      : item.fashion === 1
+                      ? '左式'
+                      : '右式'
+                  "
+                  :value="item.fashion"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="拆单状态:">
+              <Select
+                filterable
+                clearable
+                v-model="searchData.state"
+                size="small"
+                style="width: 120px"
+              >
+                <Option
+                  v-for="(item, index) in state"
+                  :key="index"
+                  :label="item.state === 0 ? '未拆单' : '已拆单'"
+                  :value="item.state"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem>
+              <Button
+                @click="search"
+                style="margin-right: 10px"
+                type="primary"
+                ghost
+                >搜索</Button
+              >
+            </FormItem>
+          </Form>
+        </div>
+        <Tabs type="card" @on-click="getData">
+          <TabPane
+            v-for="tab in tabs"
+            :key="tab"
+            :label="tab == 1 ? '汇总' : '明细'"
+            style="margin: 0 auto"
+          >
+            <div v-show="tab === 1">
+              <Table :columns="totalColumns" :data="totalData" border>
+                <template slot="setSlot" slot-scope="{ row }">
+                  <a @click="handleGoPage(row)">详情</a>
+                </template>
+                <template slot="urlSet" slot-scope="{ index }">
+                  <div
+                    class="items"
+                    v-show="totalData[index].url.length !== 0 ? true : false"
+                  >
+                    <img
+                      @click="looks(totalData[index].url)"
+                      v-for="(el, idx) in totalData[index].url"
+                      :key="idx"
+                      :src="$store.state.ip + el"
+                      alt=""
+                    />
+                  </div>
+                </template>
+              </Table>
+              <Page
+                :page-size-opts="[10, 20, 30, 40, 100, 1000]"
+                @on-page-size-change="changeTotalSize"
+                @on-change="changeTotalPage"
+                :current="page_index"
+                show-total
+                :total="total"
+                show-sizer
+                :page-size="page_size"
+                style="text-align: center; margin-top: 10px"
+              />
+            </div>
+            <div v-show="tab === 2">
+              <Table :columns="detailColumns" :data="detailData" border>
+                <template slot="setSlot" slot-scope="{ row }">
+                  <a @click="handleGoPage(row)">详情</a>
+                </template>
+                <template slot="urlSet" slot-scope="{ index }">
+                  <div
+                    class="items"
+                    v-show="detailData[index].url.length !== 0 ? true : false"
+                  >
+                    <img
+                      @click="looks(detailData[index].url)"
+                      v-for="(el, idx) in detailData[index].url"
+                      :key="idx"
+                      :src="$store.state.ip + el"
+                      alt=""
+                    />
+                  </div>
+                </template>
+              </Table>
+              <Page
+                :page-size-opts="[10, 20, 30, 40, 100, 1000]"
+                @on-page-size-change="changeDetailSize"
+                @on-change="changeDetailPage"
+                :current="page_index"
+                show-total
+                :total="total"
+                show-sizer
+                :page-size="page_size"
+                style="text-align: center; margin-top: 10px"
+              />
+            </div>
+          </TabPane>
+          <div slot="extra" class="upload">
+            <Button
+              @click="handleTabsAdd"
+              size="small"
+              style="margin-right: 10px"
+              type="primary"
+              ghost
+              v-if="false"
+              >新增</Button
+            >
+            <Upload
+              :headers="headers"
+              name="your_file"
+              :data="uploadData"
+              :show-upload-list="false"
+              :on-error="uploadError"
+              :on-success="uploadSuccess"
+              :before-upload="handleBeforeUpload"
+              :action="$route.query.type == 10?$store.state.ip + '/api/deep_import_new':$store.state.ip + '/api/explode_save_import_new'"
+              style="margin-right: 10px"
+            >
+              <Button size="small" type="primary" ghost>导入</Button>
+            </Upload>
+          </div>
+        </Tabs>
+      </Card>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      ruleValidate: {
+        name: [
+          {
+            required: true,
+            message: "The name cannot be empty",
+            trigger: "blur",
+          },
+        ],
+      },
+      totalColumns: [
+        { type: "selection", align: "center", width: 60 },
+        { title: "序号", align: "center", type: "index", minWidth: 200 },
+        {
+          title: "产品分类",
+          align: "center",
+          key: "product_type",
+          minWidth: 200,
+        },
+        {
+          title: "产品名称",
+          align: "center",
+          key: "product_title",
+          minWidth: 200,
+        },
+        { title: "图号", align: "center", key: "url_number", minWidth: 200 },
+        { title: "型号", align: "center", key: "model", minWidth: 200 },
+        { title: "数量", align: "center", key: "num", minWidth: 200 },
+        { title: "长", align: "center", key: "long", minWidth: 200 },
+        { title: "宽", align: "center", key: "wide", minWidth: 200 },
+        { title: "高", align: "center", key: "high", minWidth: 200 },
+        { title: "材质", align: "center", key: "material", minWidth: 200 },
+        { title: "颜色", align: "center", key: "color", minWidth: 200 },
+        { title: "工艺", align: "center", key: "work", minWidth: 200 },
+        {
+          title: "图纸",
+          align: "center",
+          key: "url",
+          minWidth: 200,
+          slot: "urlSet",
+        },
+        {
+          title: "左右式",
+          align: "center",
+          key: "fashion",
+          minWidth: 200,
+          render: (h, params) => {
+            const { row } = params;
+            return h(
+              "span",
+              {},
+              row.left_right_mode == 1
+                ? "左式"
+                : row.left_right_mode == 2
+                ? "右式"
+                : "无"
+            );
+          },
+        },
+        { title: "备注", align: "center", key: "remark", minWidth: 200 },
+        {
+          title: "拆单状态",
+          align: "center",
+          key: "state",
+          minWidth: 200,
+          render: (h, params) => {
+            const { row } = params;
+            return h("span", {}, row.state == 0 ? "未拆单" : "已拆单");
+          },
+        },
+        { title: "操作", align: "center", minWidth: 200, slot: "setSlot" },
+      ],
+      totalData: [],
+      headers: { Authorization: localStorage.getItem("token") },
+      detailColumns: [
+        { type: "selection", align: "center", width: 60 },
+        { title: "序号", align: "center", type: "index", minWidth: 200 },
+        { title: "区域编码", align: "center", key: "area_code", minWidth: 200 },
+        {
+          title: "区域名称",
+          align: "center",
+          key: "area_title",
+          minWidth: 200,
+        },
+        { title: "户型", align: "center", key: "house_type", minWidth: 200 },
+        { title: "楼栋", align: "center", key: "house", minWidth: 200 },
+        { title: "单元", align: "center", key: "unit", minWidth: 200 },
+        { title: "楼层", align: "center", key: "layer", minWidth: 200 },
+        { title: "房号", align: "center", key: "number", minWidth: 200 },
+        { title: "位置", align: "center", key: "position", minWidth: 200 },
+        {
+          title: "产品分类",
+          align: "center",
+          key: "product_type",
+          minWidth: 200,
+        },
+        {
+          title: "产品名称",
+          align: "center",
+          key: "product_title",
+          minWidth: 200,
+        },
+        {
+          title: "计量单位",
+          align: "center",
+          key: "product_unit",
+          minWidth: 200,
+        },
+        { title: "图号", align: "center", key: "url_number", minWidth: 200 },
+        { title: "型号", align: "center", key: "model", minWidth: 200 },
+        // { title: "数量", align: "center", key: "num", minWidth: 200 },
+        { title: "长", align: "center", key: "long", minWidth: 200 },
+        { title: "宽", align: "center", key: "wide", minWidth: 200 },
+        { title: "高", align: "center", key: "high", minWidth: 200 },
+        { title: "材质", align: "center", key: "material", minWidth: 200 },
+        { title: "颜色", align: "center", key: "color", minWidth: 200 },
+        { title: "工艺", align: "center", key: "work", minWidth: 200 },
+        {
+          title: "图纸",
+          align: "center",
+          key: "url",
+          minWidth: 200,
+          slot: "urlSet",
+        },
+        {
+          title: "左右式",
+          align: "center",
+          key: "fashion",
+          minWidth: 200,
+          render: (h, params) => {
+            const { row } = params;
+            return h(
+              "span",
+              {},
+              row.left_right_mode == 1
+                ? "左式"
+                : row.left_right_mode == 2
+                ? "右式"
+                : "无"
+            );
+          },
+        },
+        { title: "备注", align: "center", key: "remark", minWidth: 200 },
+        {
+          title: "拆单状态",
+          align: "center",
+          key: "state",
+          minWidth: 200,
+          render: (h, params) => {
+            const { row } = params;
+            return h("span", {}, row.state == 0 ? "未拆单" : "已拆单");
+          },
+        },
+        { title: "操作", align: "center", minWidth: 200, slot: "setSlot" },
+      ],
+      detailData: [],
+      saveData: {
+        abbreviation: "",
+        address: "",
+        custom_title: "",
+        end_time: "",
+        front_money: "",
+        mobile: "",
+        nickname: "",
+        order_no: "",
+        remark: "",
+        residential_name: "",
+        start_time: "",
+        warning_state: "",
+        custom_detail_mobile: "",
+        custom_detail_id: "",
+      },
+      formData: {},
+      custom_title_list: [],
+      warning_state_list: [],
+      nickname_list: [],
+      searchData: {
+        area_code: [],
+        area_title: [],
+        house_type: [],
+        product_type: [],
+        fashion: [],
+        house: [],
+        unit: [],
+        layer: [],
+        number: [],
+        position: [],
+        url_number: [],
+        product_title: [],
+        material: "",
+        color: "",
+        work: "",
+        state: "",
+      },
+      area_code: [],
+      area_title: [],
+      house_type: [],
+      house: [],
+      unit: [],
+      layer: [],
+      number: [],
+      position: [],
+      url_number: [],
+      product_title: [],
+      product_type: [],
+      fashion: [],
+      material: [],
+      color: [],
+      work: [],
+      state: [],
+      search_state: false,
+      copy_form: [],
+      type: this.$route.query.type,
+      formData: {},
+      tabs: 2,
+      total: 0,
+      page_index: 1,
+      page_size: 10,
+      save_state: false,
+      currency_tag: 0,
+      clientDetailList: [],
+      clientDetailList_respon: [],
+      clientDetailList_mobile: [],
+      clientDetailList_address: [],
+    };
+  },
+  computed: {
+    uploadData() {
+      return { order_no: this.saveData.order_no || this.$route.query.order_no };
+    },
+  },
+  created() {
+    if (this.$route.query.type == 3) {
+      this.axios
+        .get("/api/order_area_orders", {
+          params: {
+            order_no: this.$route.query.order_no,
+            oa_id: this.$route.query.oa_id,
+          },
+        })
+        .then((res) => {
+          this.formData = res.data;
+        });
+      this.getData();
+    } else {
+      this.axios.get("/api/custom_list").then((res) => {
+        this.custom_title_list = res.data.data;
+      });
+      this.axios.get("/api/warning_list").then((res) => {
+        this.warning_state_list = res.data.data;
+      });
+      this.axios
+        .get("/api/employee_list", { params: { type: 2 } })
+        .then((res) => {
+          this.nickname_list = res.data;
+        });
+    }
+  },
+  methods: {
+    looks(arr) {
+      // const array = [{ img_url: img }];
+      const array = arr.map((v) => {
+        return { img_url: v };
+      });
+      this.$previewImg({
+        list: array,
+        baseUrl: this.$store.state.ip,
+        baseImgField: "img_url",
+        baseTitleField: "",
+      });
+    },
+    handleBeforeUpload() {console.log(1)},
+    handleClientDetailChange(val) {
+      val && (this.info.custom_detail_id = val);
+    },
+    handleCustomSelect(id) {
+      id &&
+        this.axios({
+          method: "get",
+          url: "/api/custom_detail",
+          params: { id },
+        }).then((res) => {
+          this.clientDetailList = res.data.list;
+          // 去重负责人
+          this.clientDetailList_respon = this.unique(res.data.list);
+          // 赋值默认负责人
+          this.saveData.custom_detail_name = this.clientDetailList_respon[0].service_name;
+          // 取出手机号码是该负责人的
+          this.clientDetailList_mobile = this.clientDetailList.filter(
+            (item) => item.service_name == this.saveData.custom_detail_name
+          );
+          // 赋值默认手机号码
+          this.saveData.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
+          // 去重手机号码
+          this.clientDetailList_mobile = this.unique(
+            this.clientDetailList_mobile
+          );
+          // 取出地址是该负责人的
+          this.clientDetailList_address = this.clientDetailList.filter(
+            (item) => item.service_name == this.saveData.custom_detail_name
+          );
+          // 赋值默认地址
+          this.saveData.custom_detail_id =
+            this.clientDetailList_respon[0].id || 0;
+          this.saveData.service_id = res.data.detail.service_id;
+          // this.$forceUpdate();
+        });
+    },
+    unique(array) {
+      let arr = JSON.parse(JSON.stringify(array));
+      for (var i = 0; i < arr.length; i++) {
+        for (var j = i + 1; j < arr.length; j++) {
+          if (arr[i].service_name == arr[j].service_name) {
+            //第一个等同于第二个,splice方法删除第二个
+            arr.splice(j, 1);
+            j--;
+          }
+        }
+      }
+      return arr;
+    },
+    handleGoPage(row) {
+      this.$router.push({
+        path: "/cms/BidSystem/ProductDeOrder/deorderdetail",
+        query: {
+          type: 3,
+          order_no: this.$route.query.order_no || this.saveData.order_no,
+          oa_id: row.oa_id,
+          orders_area_product_detail_id: row.id,
+        },
+      });
+    },
+
+    handleTabsChange(name) {
+      this.currency_tag = name;
+      this.getData(name);
+    },
+    changeTotalSize(e) {
+      this.page_size = e;
+      this.getData(0);
+    },
+    changeTotalPage(e) {
+      this.page_index = e;
+      this.getData(0);
+    },
+    changeDetailSize(e) {
+      this.page_size = e;
+      this.getData(1);
+    },
+    changeDetailPage(e) {
+      this.page_index = e;
+      this.getData(1);
+    },
+    getData(type) {
+      if (type === 1) {
+        if (this.search_state) {
+            console.log(2)
+          this.axios
+            .post("/api/order_area_details", {
+              order_no: this.$route.query.order_no || this.saveData.order_no,
+              oa_id: this.$route.query.oa_id,
+              page_index: this.page_index,
+              page_size: this.page_size,
+              ...this.searchData,
+            })
+            .then((res) => {
+              console.log(res);
+              this.detailData = res.data.data;
+              this.total = res.data.total;
+            });
+        } else {
+        //   this.$route.query.order_no &&
+        console.log(1)
+            this.axios
+              .post("/api/order_area_details", {
+                order_no: this.$route.query.order_no || this.saveData.order_no,
+                oa_id: this.$route.query.oa_id,
+                page_index: this.page_index,
+                page_size: this.page_size,
+              })
+              .then((res) => {
+                console.log(res);
+                this.detailData = res.data.data;
+                this.total = res.data.total;
+                this.area_code = res.data.area_code;
+                this.area_title = res.data.area_title;
+                this.color = res.data.color;
+                this.fashion = res.data.fashion;
+                this.house = res.data.house;
+                this.house_type = res.data.house_type;
+                this.layer = res.data.layer;
+                this.material = res.data.material;
+                this.number = res.data.number;
+                this.position = res.data.position;
+                this.product_title = res.data.product_title;
+                this.product_type = res.data.product_type;
+                this.state = res.data.state;
+                this.unit = res.data.unit;
+                this.url_number = res.data.url_number;
+                this.work = res.data.work;
+                this.copy_form = this.searchData;
+              });
+        }
+      } else if (type === 0) {
+        console.log("111 :>> ", 111);
+        this.axios
+          .post("/api/order_area_details", {
+            type: 1,
+            order_no: this.$route.query.order_no || this.saveData.order_no,
+            page_index: this.page_index,
+            oa_id: this.$route.query.oa_id,
+            page_size: this.page_size,
+            ...this.searchData,
+          })
+          .then((res) => {
+            console.log(res);
+            this.detailData = res.data.data;
+            this.totalData = res.data.data;
+            this.total = res.data.total;
+            this.area_code = res.data.area_code;
+            this.area_title = res.data.area_title;
+            this.color = res.data.color;
+            this.fashion = res.data.fashion;
+            this.house = res.data.house;
+            this.house_type = res.data.house_type;
+            this.layer = res.data.layer;
+            this.material = res.data.material;
+            this.number = res.data.number;
+            this.position = res.data.position;
+            this.product_title = res.data.product_title;
+            this.product_type = res.data.product_type;
+            this.state = res.data.state;
+            this.unit = res.data.unit;
+            this.url_number = res.data.url_number;
+            this.work = res.data.work;
+            this.copy_form = this.searchData;
+          });
+      } else {
+        this.axios
+          .post("/api/order_area_details", {
+            type: this.$route.query.type,
+            oa_id: this.$route.query.oa_id,
+            order_no: this.$route.query.order_no || this.saveData.order_no,
+            ...{ page_index: this.page_index, page_size: this.page_size },
+            ...this.searchData,
+          })
+          .then((res) => {
+            console.log(res.msg.house_type, this.house_type);
+
+            this.totalData = res.data.data;
+            this.total = res.data.total;
+            this.area_code = res.data.area_code;
+            this.area_title = res.data.area_title;
+            this.color = res.data.color;
+            this.fashion = res.data.fashion;
+            this.house = res.data.house;
+            this.house_type = res.data.house_type;
+            this.layer = res.data.layer;
+            this.material = res.data.material;
+            this.number = res.data.number;
+            this.position = res.data.position;
+            this.product_title = res.data.product_title;
+            this.product_type = res.data.product_type;
+            this.state = res.data.state;
+            this.unit = res.data.unit;
+            this.url_number = res.data.url_number;
+            this.work = res.data.work;
+            this.copy_form = this.searchData;
+          });
+      }
+    },
+    uploadError(err) {
+      this.$Message.error(err.msg || "导入失败");
+    },
+    uploadSuccess(res) {
+      if (res.code == 200) {
+        this.$Message.success("导入成功");
+        this.search_state = true;
+        this.getData(this.currency_tag);
+      } else {
+        this.$Message.warning(res.msg || "导入失败");
+      }
+      // this.page_index = 1;
+      //   this.page_size = 10;
+      //   this.axios
+      //     .post("/api/order_area_details", {
+      //       ...this.$route.query,
+      //       ...{ page_index: this.page_index, page_size: this.page_size },
+      //       order_no:this.saveData.order_no
+      //     })
+      //     .then((res) => {
+      //         console.log(res)
+      //       this.totalData = res.msg.data;
+      //       this.total = res.msg.total;
+      //       this.area_code = res.msg.area_code;
+      //       this.area_title = res.msg.area_title;
+      //       this.color = res.msg.color;
+      //       this.fashion = res.msg.fashion;
+      //       this.house = res.msg.house;
+      //       this.house_type = res.msg.house_type;
+      //       this.layer = res.msg.layer;
+      //       this.material = res.msg.material;
+      //       this.number = res.msg.number;
+      //       this.position = res.msg.position;
+      //       this.product_title = res.msg.product_title;
+      //       this.product_type = res.msg.product_type;
+      //       this.state = res.msg.state;
+      //       this.unit = res.msg.unit;
+      //       this.url_number = res.msg.url_number;
+      //       this.work = res.msg.work;
+      //       this.copy_form = this.searchData;
+      //     });
+    },
+    save() {
+      if (
+        !this.saveData.order_no &&
+        !this.saveData.residential_name &&
+        !this.saveData.abbreviation &&
+        !this.saveData.custom_title &&
+        !this.saveData.warning_state
+      ) {
+        this.$message.error("请填写必要信息!");
+      } else {
+        this.axios
+          .post("/api/order_area_save", { ...this.saveData })
+          .then((res) => {
+            this.$message.success(res.msg);
+            this.save_state = true;
+          });
+      }
+    },
+    goback() {
+      this.$router.go(-1);
+    },
+    handleTabsAdd() {
+      this.tabs++;
+    },
+    search() {
+      this.search_state = true;
+      this.getData(this.currency_tag);
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.changeDetail {
+  .content {
+    overflow: auto;
+    height: 680px;
+    .form_content {
+      display: flex;
+      flex-wrap: wrap;
+    }
+    .card {
+      .form_middle {
+        .form_middle_content {
+          display: flex;
+          flex-wrap: wrap;
+        }
+      }
+    }
+  }
+}
+.ivu-form-item {
+  width: 250px;
+}
+.upload {
+  display: flex;
+  justify-content: space-around;
+}
+.items {
+  width: auto;
+  height: 40px;
+  margin-bottom: 10px;
+  overflow: hidden;
+  border-radius: 5px;
+  position: relative;
+  img {
+    max-width: 40px;
+    max-height: 40px;
+  }
+}
+</style>

+ 15 - 0
src/views/BidSystem/DeepeningOrder/list.vue

@@ -36,6 +36,13 @@
           style="margin-right: 10px"
           >导出</Button
         >
+         <Button
+          @click="gopage()"
+          type="primary"
+          ghost
+          style="margin-right: 10px"
+          >新增</Button
+        >
       </div>
       <!-- <div slot='navButton'
            style="display:flex;">
@@ -397,6 +404,14 @@ export default {
           break;
       }
     },
+     gopage() {
+      this.$router.push({
+        path: "/cms/BidSystem/DeepeningOrder/infodetail",
+        query: {
+          type: 10,
+        },
+      });
+    },
     init(row) {
       this.page_index = 1;
       //1 深化   换接口 弃用

+ 18 - 18
src/views/BidSystem/ProductDeOrder/infoDetail.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="changeDetail">
-    <Toptitle :title="type == 3 ? '生产拆单详情' : '生产拆单新增'">
+    <Toptitle :title="type == 3 ? '生产拆单详情' : type == 10?'深化单新增':'生产拆单新增'">
       <slot name="titleButton">
-        <Button type="primary" style="margin-right: 10px" v-if="type == 6"
+        <Button type="primary" style="margin-right: 10px" v-if="type == 6||type ==10"
           >开启拆单</Button
         >
         <Button type="primary" style="margin-right: 10px" v-if="type == 3"
@@ -18,7 +18,7 @@
         <Button
           type="primary"
           style="margin-right: 10px"
-          v-if="type == 6"
+          v-if="type == 6||type == 10"
           @click="save"
           >保存</Button
         >
@@ -29,7 +29,7 @@
         <Form class="form_content" :label-width="100">
           <FormItem label="项目编号:">
             <Input
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               v-model="saveData.order_no"
               placeholder="请输入项目编码"
             />
@@ -37,7 +37,7 @@
           </FormItem>
           <FormItem label="项目名称:">
             <Input
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               v-model="saveData.residential_name"
               placeholder="请输入项目名称"
             />
@@ -45,7 +45,7 @@
           </FormItem>
           <FormItem label="项目简称:">
             <Input
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               v-model="saveData.abbreviation"
               placeholder="请输入项目简称"
             />
@@ -57,7 +57,7 @@
               clearable
               v-model="saveData.custom_title"
               @on-change="handleCustomSelect"
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
             >
               <Option
                 v-for="(item, index) in custom_title_list"
@@ -69,7 +69,7 @@
             <span v-else>{{ formData.custom_title }}</span>
           </FormItem>
           <FormItem label="紧急程度:">
-            <Select clearable v-model="saveData.warning_state" v-if="type == 6">
+            <Select clearable v-model="saveData.warning_state" v-if="type == 6||type == 10">
               <Option
                 v-for="(item, index) in warning_state_list"
                 :key="index"
@@ -81,7 +81,7 @@
           </FormItem>
           <FormItem label="项目定金:">
             <Input
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               v-model="saveData.front_money"
               placeholder="请输入项目定金"
             />
@@ -91,7 +91,7 @@
             <Select
               clearable
               filterable
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               class="auto-width"
               @on-change="handleClientDetailChange"
               v-model="saveData.custom_detail_id"
@@ -109,7 +109,7 @@
             <Select
               clearable
               filterable
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               v-model="saveData.custom_detail_mobile"
             >
               <Option
@@ -136,7 +136,7 @@
               v-model="saveData.start_time"
               placeholder="年/月/日"
               style="width: 150px"
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
             ></DatePicker>
             <span v-else>{{ formData.start_time }}</span>
           </FormItem>
@@ -146,7 +146,7 @@
               v-model="saveData.end_time"
               placeholder="年/月/日"
               style="width: 150px"
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
             ></DatePicker>
             <span v-else>{{ formData.end_time }}</span>
           </FormItem>
@@ -155,7 +155,7 @@
               filterable
               clearable
               v-model="saveData.nickname"
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
             >
               <Option
                 v-for="(item, index) in nickname_list"
@@ -168,7 +168,7 @@
           </FormItem>
           <FormItem label="备注:">
             <Input
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               v-model="saveData.remark"
               type="textarea"
               placeholder="请输入备注"
@@ -532,7 +532,7 @@
               style="margin-right: 10px"
               type="primary"
               ghost
-              v-if="type == 6"
+              v-if="false"
               >新增</Button
             >
             <Upload
@@ -543,7 +543,7 @@
               :on-error="uploadError"
               :on-success="uploadSuccess"
               :before-upload="handleBeforeUpload"
-              :action="$store.state.ip + '/api/explode_save_import_new'"
+              :action="$route.query.type == 10?$store.state.ip + '/api/deep_import_new':$store.state.ip + '/api/explode_save_import_new'"
               style="margin-right: 10px"
             >
               <Button size="small" type="primary" ghost>导入</Button>
@@ -828,7 +828,7 @@ export default {
         baseTitleField: "",
       });
     },
-    handleBeforeUpload() {},
+    handleBeforeUpload() {console.log(1)},
     handleClientDetailChange(val) {
       val && (this.info.custom_detail_id = val);
     },

+ 1 - 1
src/views/BidSystem/ProductDeOrder/list.vue

@@ -35,7 +35,7 @@
           icon="md-return-left"
           style="margin-right: 10px"
           >导出</Button
-        >
+        > 
         <Button
           @click="gopage()"
           type="primary"

+ 340 - 1
src/views/OrderMannage/BusinessOrderlist/list.vue

@@ -25,6 +25,7 @@
           style="margin-right: 10px"
           >强制删除</Button
         >
+        <Button @click="PrintRow" type="primary" ghost style="margin-right: 10px">批量打印</Button>
         <Upload
           name="your_file"
           :show-upload-list="false"
@@ -308,6 +309,185 @@
         >
       </div>
     </Modal>
+    <Modal v-model="showPrint" title="确认打印" width="300" @on-ok="printOk">
+         <div style="text-align:center">是否打印?</div>
+    </Modal>
+     <div class="print-table" ref="print" style="position: absolute;top:900px;left:100px;background-color:red">
+           <table cellspacing="0" cellpadding="0" v-for="(item,index) in newArr" :key="index" class="print-cell">
+                <thead>
+                <tr>
+                    <td colspan="23" style="border: 0;">
+                        <div class="table-header">
+                            <img class="left-img" :src='$store.state.ip + showTable.logo' alt="" v-show="showTable.logo?true:false">
+                            <h1 class="table-title">{{showTable.title}}</h1><img class="right-img1" :src='$store.state.ip + showTable.right_logo1' alt="" v-show="showTable.right_logo1?true:false"><img class="right-img2" :src='$store.state.ip + showTable.right_logo2' alt="" v-show="showTable.right_logo2?true:false">
+                        </div>
+                    </td>
+                </tr>
+                <tr>
+                    <td colspan="23">
+                        <p style="text-align: left;padding-left: 20px;"><span class="part_content"
+                                style="font-size:16px;margin-right:40px">{{showTable.part_content}}</span><span class="custom">{{showTable.custom}}</span></p>
+                    </td>
+                </tr>
+                <tr class="header">
+                    <td rowspan="2">
+                        <p>序号</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">位置</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">材质</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">型号</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">工艺</p>
+                    </td>
+                    <td rowspan="2">
+                        <p style="width:80px ;">木皮/颜色</p>
+                    </td>
+                    <td>
+                        <p>门洞尺寸(MM)</p>
+                    </td>
+                    <td>
+                        <p>门扇尺寸(MM)</p>
+                    </td>
+                    <td>
+                        <p>门套尺寸 (MM)</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>数量</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>单位</p>
+                    </td>
+                    <td>
+                        <p>平方</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>单价</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>附加</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>金额</p>
+                    </td>
+                    <td rowspan="2">
+                        <p>备注</p>
+                    </td>
+                </tr>
+                <tr class="header">
+
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+                    <td>
+                        <p>高*宽*厚度</p>
+                    </td>
+
+                    <td>
+                        <p>米</p>
+                    </td>
+                </tr>
+            </thead>
+                <tbody class="content" >
+                   <tr v-for="(_item,_index) in item" :key="_index">
+                                <td>
+                                    <p>{{_item.sort}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.postion}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.process}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.model}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.workmanship}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.color}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.measure1}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.measure2}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.measure3}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.num}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.unit}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.square}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.unit_price}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.ext}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.price}}</p>
+                                </td>
+                                <td>
+                                    <p>{{_item.remark}}</p>
+                                </td>
+                     </tr>
+                    </tbody>
+                   <tfoot>
+                <tr>
+                    <td class="amount-index" align="center">{{showTable.list.length + 1}}</td>
+                    <td colspan="11"></td>
+                    <td colspan="2">合计:</td>
+                    <td class="xt_total">{{showTable.foot.xt_total}}</td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="12" class="remark" style="padding-left: 20px;">{{showTable.foot.remark}}</td>
+                    <td colspan="2">返点:</td>
+                    <td class="return">{{showTable.foot.return}}</td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="12" class="remark1" style="padding-left: 20px;">{{showTable.foot.remark1}}</td>
+                    <td colspan="2">尾款:</td>
+                    <td class="end_price">{{showTable.foot.end_price}}</td>
+                    <td></td>
+                </tr>
+
+                <tr>
+                    <td colspan="16" style="padding-left: 20px;">
+                        <span class="amount_detail" style="height: 24px;">{{showTable.foot.amount_detail}}</span>
+                    </td>
+                </tr>
+
+                <tr>
+                    <td colspan="16" class="order_info" style="padding-left: 20px;">
+                        <!-- 客户备注:<span
+                            class="customer_remark">{{showTable.foot.customer_remark}}</span> -->
+                            订货日期:<span class="crt_time">{{showTable.foot.crt_time}}</span>交货日期:<span
+                            class="end_time">{{showTable.foot.end_time}}</span>业务经理:<span class="saleman">{{showTable.foot.saleman}}</span>制单人:<span
+                            class="crt_id">{{showTable.foot.crt_id}}</span>审核:<span class="oa">{{showTable.foot.oa}}</span>客户确认:<span class="is_confirm">{{showTable.foot.is_confirm}}</span></td>
+                </tr>
+            </tfoot>
+              </table>
+        </div>
   </div>
 </template>
 
@@ -316,6 +496,14 @@ import { mapState } from "vuex";
 export default {
   data() {
     return {
+      showTableContentStr:[],
+      showTable:{
+                list:[],
+                foot:{}
+            },
+       newArr:'',
+      printData:[],
+      showPrint:false,
       tableColums: [
         {
           type: "selection",
@@ -951,6 +1139,47 @@ export default {
     });
   },
   methods: {
+    chunk(array, size) {
+            //获取数组的长度,如果你传入的不是数组,那么获取到的就是undefined
+            const length = array.length
+            //判断不是数组,或者size没有设置,size小于1,就返回空数组
+            if (!length || !size || size < 1) {
+              return []
+            }
+            //核心部分
+            let index = 0 //用来表示切割元素的范围start
+            let resIndex = 0 //用来递增表示输出数组的下标
+          
+            //根据length和size算出输出数组的长度,并且创建它。
+            let result = new Array(Math.ceil(length / size))
+            //进行循环
+            while (index < length) {
+              //循环过程中设置result[0]和result[1]的值。该值根据array.slice切割得到。
+              result[resIndex++] = array.slice(index, (index += size))
+            }
+            //输出新数组
+            return result
+          },
+    PrintRow(){
+         this.printData.forEach(v=>{
+           this.axios({
+            method:'get',
+            url:'/api/printe_order_detail',
+            params:{
+               ...v
+            }
+        }).then(res=>{
+            console.log(res)
+            this.showTableContentStr = res.msg.list
+            this.showTable = res.msg
+            this.newArr = this.chunk(this.showTableContentStr,15)
+        });
+         })
+         this.showPrint = true;
+    },
+    printOk(){
+     
+    },
     init(row) {
       this.page_index = 1;
       row.page_index = this.page_index;
@@ -1120,8 +1349,14 @@ export default {
     },
     selectTable(e) {
       let result = [];
+      let printData=[];
+      e.map(item=>{
+        printData.push({order_no:item.order_no,box_id:item.box_id})
+      })
       e.map((v) => result.push(v.order_no));
       this.selectIds = result;
+      this.printData = printData;
+      console.log(this.printData);
     },
     delItems(row) {
       this.confirmDelete({
@@ -1257,7 +1492,7 @@ export default {
 .pageSlotStyle {
   display: flex;
   justify-content: center;
-  margin-top: 40px;
+  margin-top: 20px;
 }
 .modal_content {
   display: flex;
@@ -1268,4 +1503,108 @@ export default {
   display: flex;
   justify-content: center;
 }
+
+.printcontent{
+    overflow-y: auto;
+    overflow-x: auto;
+}
+ 
+
+    h1 {
+        text-align: center;
+        font-size: 18px;
+        margin-bottom: 10px;
+        margin-top: 20px;
+    }
+
+    p {
+        text-align: center;
+    }
+
+    table {
+        width: 100%;
+        border-collapse: collapse;
+    }
+
+    td {
+        border: 1px solid #000;
+
+    }
+
+    .right-img1 {
+        position: absolute;
+        right: 0;
+        width: 150px;
+        margin-bottom: 10px;
+        height: 60px;
+        top: 0;
+    }
+
+    .right-img2 {
+        position: absolute;
+        width: 150px;
+        right: 180px;
+        margin-bottom: 10px;
+        height: 60px;
+        top: 0;
+    }
+
+    .table-header {
+        position: relative;
+        height: 76px;
+        line-height: 76px;
+    }
+
+    .left-img {
+        position: absolute;
+        left: 0;
+        width: 150px;
+        height: 60px;
+        top: 0;
+    }
+
+    .table-box {
+        padding: 0;
+        width: 1000px;
+        margin: 0 auto;
+        margin-top: 40px;
+    }
+
+    .order_info span {
+        margin-right: 28px;
+    }
+
+    .pageSeparator {
+        visibility: hidden;
+        page-break-after: always;
+        overflow: hidden;
+        height: 0px;
+    }
+    #show-table {
+        padding: 15px;
+    }
+    .print-table{
+        display: none;
+    }
+    @media print {
+        button {
+            display: none;
+        }
+        .print-table{
+            display: block;
+            width: 100%;
+        }
+        .print-cell{
+            color: black;
+            margin:16mm 8mm;
+            width: 262mm;
+            height: auto;
+        }
+        #show-table{
+           display: none;
+           
+        }
+        @page {
+        }
+    }
 </style>

+ 10 - 6
src/views/OrderMannage/BusinessOrderlist/printlist.vue

@@ -164,13 +164,15 @@
 
                 <tr>
                     <td colspan="16" style="padding-left: 20px;">
-                        <p class="amount_detail" style="height: 24px;">{{showTable.foot.amount_detail}}</p>
+                        <span class="amount_detail" style="height: 24px;">{{showTable.foot.amount_detail}}</span>
                     </td>
                 </tr>
 
                 <tr>
-                    <td colspan="16" class="order_info" style="padding-left: 20px;">客户备注:<span
-                            class="customer_remark">{{showTable.foot.customer_remark}}</span>订货日期:<span class="crt_time">{{showTable.foot.crt_time}}</span>交货日期:<span
+                    <td colspan="16" class="order_info" style="padding-left: 20px;">
+                        <!-- 客户备注:<span
+                            class="customer_remark">{{showTable.foot.customer_remark}}</span> -->
+                            订货日期:<span class="crt_time">{{showTable.foot.crt_time}}</span>交货日期:<span
                             class="end_time">{{showTable.foot.end_time}}</span>业务经理:<span class="saleman">{{showTable.foot.saleman}}</span>制单人:<span
                             class="crt_id">{{showTable.foot.crt_id}}</span>审核:<span class="oa">{{showTable.foot.oa}}</span>客户确认:<span class="is_confirm">{{showTable.foot.is_confirm}}</span></td>
                 </tr>
@@ -338,13 +340,15 @@
 
                 <tr>
                     <td colspan="16" style="padding-left: 20px;">
-                        <p class="amount_detail" style="height: 24px;">{{showTable.foot.amount_detail}}</p>
+                        <span class="amount_detail" style="height: 24px;">{{showTable.foot.amount_detail}}</span>
                     </td>
                 </tr>
 
                 <tr>
-                    <td colspan="16" class="order_info" style="padding-left: 20px;">客户备注:<span
-                            class="customer_remark">{{showTable.foot.customer_remark}}</span>订货日期:<span class="crt_time">{{showTable.foot.crt_time}}</span>交货日期:<span
+                    <td colspan="16" class="order_info" style="padding-left: 20px;">
+                        <!-- 客户备注:<span
+                            class="customer_remark">{{showTable.foot.customer_remark}}</span> -->
+                            订货日期:<span class="crt_time">{{showTable.foot.crt_time}}</span>交货日期:<span
                             class="end_time">{{showTable.foot.end_time}}</span>业务经理:<span class="saleman">{{showTable.foot.saleman}}</span>制单人:<span
                             class="crt_id">{{showTable.foot.crt_id}}</span>审核:<span class="oa">{{showTable.foot.oa}}</span>客户确认:<span class="is_confirm">{{showTable.foot.is_confirm}}</span></td>
                 </tr>

+ 43 - 3
src/views/PartsMannage/edit.vue

@@ -59,7 +59,7 @@
           />
           <span v-else>{{ info.company }}</span>
         </FormItem>
-        <FormItem label="关联产品分类" prop="p_id">
+        <!-- <FormItem label="关联产品分类" prop="p_id">
           <div style="display:flex;align-items:center;width:100%;">
             <Dropdown v-if="type != 3">
               <Button :disabled="type == 3" type="primary" ghost
@@ -77,7 +77,7 @@
               nowSelectObj.title || ""
             }}</Button>
           </div>
-        </FormItem>
+        </FormItem> -->
       </Form>
       <div class="edit-table-log">
         <div>
@@ -104,6 +104,31 @@
         :data="tableData"
         :width="tableWidth"
       >
+       <template slot-scope="{ index }" slot="product_id">
+          <div>
+            <Select
+              filterable
+              clearable
+              v-if="type != 3"
+              label-in-value
+              v-model="tableData[index].product_id"
+            >
+              <Option
+                v-for="item of productList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.title"
+              ></Option>
+            </Select>
+            <span v-else>{{
+              productList.length > 0 && tableData[index].product_id
+                ? productList.filter(
+                    (item) => item.id == tableData[index].product_id
+                  )[0].title
+                : ""
+            }}</span>
+          </div>
+        </template>
         <template slot-scope="{ index }" slot="spare_parts">
           <Input
             v-if="type != 3"
@@ -439,13 +464,20 @@ export default {
       label:[{title:'是',id:1},{title:'否',id:0}],
       tableColums: [
         {
+          title: "产品名称",
+          align: "center",
+          key: "product_id",
+          slot: "product_id",
+          resizable: true,
+          width: 150,
+        },
+        {
           title: "零部件名称",
           align: "center",
           key: "spare_parts",
           slot: "spare_parts",
           resizable: true,
           width: 150,
-          fixed: "left",
         },
         {
           title: "物料名称",
@@ -640,6 +672,8 @@ export default {
       ],
       productTypes: [],
       nowSelectObj: {},
+      //产品名称列表
+      productList:[],
       // 木板列表
       materialWoodList: [],
       // 木皮列表
@@ -671,6 +705,9 @@ export default {
     this.axios("/api/material", { params: { sub_type_id: 1 } }).then((res) => {
       this.materialWoodList = res.data.data;
     });
+    this.axios("/api/product").then(res=>{
+      this.productList = res.data.data
+    });
     this.axios("/api/material", { params: { sub_type_id: 2 } }).then((res) => {
       this.materialWoodSkinList = res.data.data;
     });
@@ -754,6 +791,9 @@ export default {
           : (sendData.top[i] = postInfo[i]);
       }
       sendData.detail = [...this.tableData, ...this.metalsTableData];
+      sendData.detail.map(v=>{
+        delete v.product_title
+      })
       this.axios.post("/api/parts_save", sendData).then((res) => {
         if (res.code == 200) {
           this.$Message.success(res.msg);

+ 248 - 35
src/views/ProductMannage/index.vue

@@ -144,7 +144,7 @@
               <Button type="primary" ghost style="border-radius:10px"
                 >无</Button
               >
-               <Button type="primary" ghost style="border-radius:10px;margin-left:20px" @click="add" 
+              <Button type="primary" ghost style="border-radius:10px;margin-left:10px" @click="add" v-if="add_show"
                 ><Icon type="md-add" :size='20'/></Button
               >
             </div>
@@ -155,7 +155,7 @@
                 :key="part.id"
                 id="content_left_item"
               >
-              <svg t="1638267575516" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3395" width="200" height="200" style="position: relative;left: 6px;top: -10px;" @click="edit(part)"><path d="M1005.037624 158.992107 899.701554 264.044722 759.214916 123.967406 864.587825 18.915815c19.389606-19.335371 50.835805-19.335371 70.225411 0l70.224388 70.047356C1024.42723 108.297518 1024.42723 139.656737 1005.037624 158.992107zM267.31879 614.19145l140.484591 140.091642-187.231265 46.62183L267.31879 614.19145zM864.587825 299.04998l-421.387259 420.210457L302.75179 579.203588l421.352467-420.211481L864.587825 299.04998zM113.70518 181.723831l0 728.575594 728.57764 0L842.28282 363.868241l109.289102-72.858378 0 692.146916c0 27.535123-8.895601 36.429701-36.432771 36.429701L54.296115 1019.58648c-27.535123 0-49.875944-22.305005-49.875944-49.841152L4.420171 108.866477c0-27.535123 8.858762-36.429701 36.428677-36.429701l692.14794 0L623.709733 181.723831 113.70518 181.723831z" p-id="3396" fill="#707070"></path></svg>
+              <svg t="1638267575516" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3395" width="200" height="200" style="position: relative;left: 6px;top: -10px;" @click="edit(part,3)"><path d="M1005.037624 158.992107 899.701554 264.044722 759.214916 123.967406 864.587825 18.915815c19.389606-19.335371 50.835805-19.335371 70.225411 0l70.224388 70.047356C1024.42723 108.297518 1024.42723 139.656737 1005.037624 158.992107zM267.31879 614.19145l140.484591 140.091642-187.231265 46.62183L267.31879 614.19145zM864.587825 299.04998l-421.387259 420.210457L302.75179 579.203588l421.352467-420.211481L864.587825 299.04998zM113.70518 181.723831l0 728.575594 728.57764 0L842.28282 363.868241l109.289102-72.858378 0 692.146916c0 27.535123-8.895601 36.429701-36.432771 36.429701L54.296115 1019.58648c-27.535123 0-49.875944-22.305005-49.875944-49.841152L4.420171 108.866477c0-27.535123 8.858762-36.429701 36.428677-36.429701l692.14794 0L623.709733 181.723831 113.70518 181.723831z" p-id="3396" fill="#707070"></path></svg>
               <!-- <Icon type="md-create" style="position: relative;left: 10px;top: -8px;" color='black' :size='10'/> -->
                 <Button
                   type="primary"
@@ -164,10 +164,10 @@
                   @click="handlePartClick(part, 3)"
                   >{{ part.title }}</Button
                 >
-              <svg t="1638267935515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5634" width="200" height="200" style="position: relative;left: -8px;top: -10px;" @click="del"><path d="M585.412525 512.594747L973.601616 124.418586c19.600808-19.600808 19.600808-51.898182 0-71.49899l-2.120404-2.120404c-19.600808-19.600808-51.898182-19.600808-71.49899 0L511.793131 439.518384 123.61697 50.799192c-19.600808-19.600808-51.898182-19.600808-71.49899 0l-2.120404 2.120404c-20.11798 19.600808-20.11798 51.898182 0 71.49899l388.189091 388.189091L49.997576 900.783838c-19.587879 19.600808-19.587879 51.898182 0 71.49899l2.120404 2.120404c19.600808 19.600808 51.898182 19.600808 71.49899 0L511.793131 586.214141l388.189091 388.176162c19.600808 19.600808 51.898182 19.600808 71.49899 0l2.120404-2.120404c19.600808-19.600808 19.600808-51.898182 0-71.49899L585.412525 512.594747z m0 0" p-id="5635" fill="#707070"></path></svg>
+              <svg t="1638267935515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5634" width="200" height="200" style="position: relative;left: -8px;top: -10px;" @click="del(part)"><path d="M585.412525 512.594747L973.601616 124.418586c19.600808-19.600808 19.600808-51.898182 0-71.49899l-2.120404-2.120404c-19.600808-19.600808-51.898182-19.600808-71.49899 0L511.793131 439.518384 123.61697 50.799192c-19.600808-19.600808-51.898182-19.600808-71.49899 0l-2.120404 2.120404c-20.11798 19.600808-20.11798 51.898182 0 71.49899l388.189091 388.189091L49.997576 900.783838c-19.587879 19.600808-19.587879 51.898182 0 71.49899l2.120404 2.120404c19.600808 19.600808 51.898182 19.600808 71.49899 0L511.793131 586.214141l388.189091 388.176162c19.600808 19.600808 51.898182 19.600808 71.49899 0l2.120404-2.120404c19.600808-19.600808 19.600808-51.898182 0-71.49899L585.412525 512.594747z m0 0" p-id="5635" fill="#707070"></path></svg>
                 <!-- <Icon type="md-close" style="position: relative;left: -10px;top: -8px;" color='black' :size='20'/> -->
               </div>
-               <Button type="primary" ghost style="border-radius:10px;margin-left:10px" @click="add" 
+               <Button type="primary" ghost style="border-radius:10px;margin-left:10px" @click="add"
                 ><Icon type="md-add" :size='20'/></Button
               >
             </div>
@@ -178,16 +178,16 @@
             <span style="padding-right:10px"
               >默认部件:{{ defaultPart.title }}</span
             >
-            <span
-              >高:<Input v-model="defaultPart.formula_l" style="width:50px"
+            <span style="margin-right:10px"
+              >高:<Input v-model="defaultPart.formula_l" style="width:50px" disabled
             /></span>
-            <span
-              >宽:<Input v-model="defaultPart.formula_w" style="width:50px"
+            <span style="margin-right:10px"
+              >宽:<Input v-model="defaultPart.formula_w" style="width:50px" disabled
             /></span>
-            <span
-              >厚:<Input v-model="defaultPart.formula_h" style="width:50px"
+            <span style="margin-right:10px"
+              >厚:<Input v-model="defaultPart.formula_h" style="width:50px" disabled
             /></span>
-            <span>是否为空: <vxe-switch v-model="defaultPart.is_null"></vxe-switch> </span>
+            <span>是否为空: <vxe-switch v-model="defaultPart.is_null" disabled></vxe-switch> </span>
           </div>
           <div class="show_modal_content_right_top">
             <Button type="primary" @click="handleAddChangeable"
@@ -241,31 +241,32 @@
       title="批量修改部件"
       width="400"
      :draggable='true'
+     @on-ok='edit_part'
     >
-    <Form :model='formData' >
+    <Form>
       <FormItem >
         <span>默认部件:</span>
-       <Select v-model="formData.edit_part" style="width:140px">
-     <Option v-for="item in productPartList" :key="item.id" :value="item.id">
+       <Select v-model="formData.part_id" style="width:140px" filterable clearable>
+     <Option v-for="item in partsList" :key="item.id" :value="item.id">
      {{item.title}}
      </Option>
        </Select>
       </FormItem>
       <FormItem >
-         <span>高:</span><Input type="number" style='width:60px;margin-right:20px' v-model="defaultPart.formula_l"/>
-         <span>宽:</span><Input type="number" style='width:60px;margin-right:20px' v-model="defaultPart.formula_w"/>
-         <span>厚:</span><Input type="number" style='width:60px' v-model="defaultPart.formula_h"/>
+         <span>高:</span><Input type="number" style='width:60px;margin-right:20px' v-model="formData.formula_l"/>
+         <span>宽:</span><Input type="number" style='width:60px;margin-right:20px' v-model="formData.formula_w"/>
+         <span>厚:</span><Input type="number" style='width:60px' v-model="formData.formula_h"/>
       </FormItem>
       <FormItem>
-        <span>是否为空: <vxe-switch v-model="defaultPart.is_null"></vxe-switch> </span>
+        <span>是否为空: <vxe-switch v-model="formData.is_null"></vxe-switch> </span>
       </FormItem>
     </Form>
     </Modal>
 
-    <Modal  title="批量修改部件"
+    <Modal  title="批量删除部件"
       width="400"
       v-model="del_showModel"
-      
+      @on-ok='del_part'
       >
       <div style="text-align:center">是否确定删除该部件?</div>
       
@@ -276,23 +277,24 @@
       title="批量增加部件"
       width="400"
      :draggable='true'
+     @on-ok='add_part'
     >
-    <Form :model='formData' >
+    <Form :model='addData' >
       <FormItem >
         <span>默认部件:</span>
-       <Select v-model="formData.edit_part" style="width:140px">
-     <Option v-for="item in productPartList" :key="item.id" :value="item.id">
+       <Select v-model="addData.part_id" style="width:140px" filterable clearable>
+     <Option v-for="item in partsList" :key="item.id" :value="item.id">
      {{item.title}}
      </Option>
        </Select>
       </FormItem>
       <FormItem >
-         <span>高:</span><Input type="number" style='width:60px;margin-right:20px' v-model="defaultPart.formula_l"/>
-         <span>宽:</span><Input type="number" style='width:60px;margin-right:20px' v-model="defaultPart.formula_w"/>
-         <span>厚:</span><Input type="number" style='width:60px' v-model="defaultPart.formula_h"/>
+         <span>高:</span><Input type="number" style='width:60px;margin-right:20px' v-model="addData.formula_l"/>
+         <span>宽:</span><Input type="number" style='width:60px;margin-right:20px' v-model="addData.formula_w"/>
+         <span>厚:</span><Input type="number" style='width:60px' v-model="addData.formula_h"/>
       </FormItem>
       <FormItem>
-        <span>是否为空: <vxe-switch v-model="defaultPart.is_null"></vxe-switch> </span>
+        <span>是否为空: <vxe-switch v-model="addData.is_null"></vxe-switch> </span>
       </FormItem>
     </Form>
     </Modal>
@@ -307,11 +309,26 @@ export default {
   components: { KeyBoard },
   data() {
     return {
+      select_id:[],
+      add_show:false,
+      title:'',
+      part_id:null,
       add_showModel:false,
       edit_showModel:false,
       del_showModel:false,
       formData:{
-        edit_part:null,
+        part_id:'',
+        formula_l:'',
+         formula_w:'',
+          formula_h:'',
+          is_null:'',
+      },
+       addData:{
+        part_id:'',
+        formula_l:'',
+         formula_w:'',
+          formula_h:'',
+          is_null:'',
       },
       list: [
         {
@@ -603,7 +620,10 @@ export default {
   beforeRouteEnter(to, from, next) {
     next((vm) => {
       vm.getData(vm.proxyObj);
-    });
+      vm.productPartList =[];
+        vm.defaultPart = [];
+        vm.changeableTableData = []
+    })
   },
   created() {
     // 获取部件列表
@@ -642,14 +662,164 @@ export default {
     },
   },
   methods: {
+    add_part(){
+      const temp_product = this.tableData.filter((item) => item.isSelect);
+      const product_id = temp_product.map((item) => item.id);
+      let part_list_id = [];
+     this.productPartList.forEach(m=>{
+        part_list_id.push(m.id)
+      })
+      this.addData.is_null = this.addData.is_null?1:0;
+      this.axios.post('/api/support_product_parts_add',{product_id:product_id,...this.addData,part_list:part_list_id}).then(res=>{
+        if(res.code == 200){
+          this.$Message.success(res.msg);
+        this.axios.post("/api/support_product_get_part", {
+          type:2,
+          basic_product_id: [this.$route.query.id],
+          product_id,
+          part_id: []
+        })
+        .then((res) => {
+          console.log(res);
+          this.productPartList = res.data;
+          this.productPartList.map((item) => {
+            (item.isSelect = false)
+            if(item.id == this.addData.part_id){
+              item.isSelect = true;
+               this.axios.post("/api/support_product_get_part", {
+          type:3,
+          basic_product_id: [this.$route.query.id],
+          product_id,
+          part_id:[this.addData.part_id],
+        })
+        .then((res) => {
+          console.log(res);
+          this.changeableTableData = res.data.list;
+          this.defaultPart = res.data.head;
+          this.defaultPart.is_null = (res.data.head.is_null == 0||!res.data.head.is_null)?false:true
+          this.partsList.forEach(m=>{
+            if(m.id == this.addData.part_id){
+              this.defaultPart.title = m.title
+            }
+          })
+        
+        });
+      this.$forceUpdate();
+            }
+            });
+        });
+      this.$forceUpdate();
+        }
+        
+      })
+    },
     replaceItem(){
        this.showModal = true;
     },
+    edit_part(){
+     const temp_product = this.tableData.filter((item) => item.isSelect);
+      const product_id = temp_product.map((item) => item.id);
+      const temp_part = this.productPartList.filter((item) => item.isSelect);
+      const part_list = this.productPartList.filter((item) => !item.isSelect);
+      let part_list_id = [];
+      part_list.forEach(m=>{
+        part_list_id.push(m.id)
+      })
+      const part_id = temp_part.map((item) => item.id);
+      this.formData.is_null = this.formData.is_null?1:0;
+       let parts_id = Number(part_id.toString()) ;
+       this.axios.post('/api/support_product_parts_edit',{
+        product_id:product_id,
+        part_id:parts_id,
+        children:{...this.formData},
+        part_list:part_list_id
+       }).then(res=>{
+         if(res.code == 200){
+           this.$Message.success(res.msg);
+            this.axios
+        .post("/api/support_product_get_part", {
+          type:2,
+          basic_product_id: [this.$route.query.id],
+          product_id,
+          part_id: [],
+        })
+        .then((res) => {
+          console.log(res);
+          this.productPartList = res.data;
+          this.productPartList.map((item) =>{
+            (item.isSelect = false);
+            if(item.id == this.formData.part_id){
+              item.isSelect = true;
+             this.title = item.title
+            }});
+
+        });
+          this.axios
+        .post("/api/support_product_get_part", {
+          type:3,
+          basic_product_id: [this.$route.query.id],
+          product_id:product_id,
+          part_id:[this.formData.part_id],
+        })
+        .then((res) => {
+          console.log(res);
+          this.changeableTableData = res.data.list;
+          if(res.data.head instanceof Array){
+            res.data.head.is_null = false;
+          }else{
+            res.data.head.is_null = res.data.head.is_null == 0?false:true;
+          }
+          this.defaultPart = res.data.head;
+          console.log(this.defaultPart)
+          this.defaultPart.title =this.title;
+        });
+      this.$forceUpdate();
+         }
+       })
+    },
     add(){
+      this.addData = {
+        part_id:'',
+        formula_l:'',
+         formula_w:'',
+          formula_h:'',
+          is_null:'',
+      }
     this.add_showModel = true;
     },
-    del(){
+    del(part){
      this.del_showModel = true;
+     this.part_id = part.id;
+    },
+    del_part(){
+     const temp_product = this.tableData.filter((item) => item.isSelect);
+      const product_id = temp_product.map((item) => item.id);
+      const temp_part = this.productPartList.filter((item) => item.isSelect);
+      const part_id = temp_part.map((item) => item.id);
+     this.axios.post('/api/support_product_parts_del',{product_id:product_id,part_id:this.part_id}).then(res=>{
+       if(res.code == 200){
+             this.$Message.success(res.msg);
+             this.changeableTableData = [];
+             this.defaultPart = [];
+        this.axios
+        .post("/api/support_product_get_part", {
+          type:2,
+          basic_product_id: [this.$route.query.id],
+          product_id:product_id,
+          part_id: [],
+        })
+        .then((res) => {
+          this.productPartList = res.data;
+          this.productPartList.map((item) => {
+            (item.isSelect = false);
+            if(item.id == part_id){
+              item.isSelect =true;
+            }
+            });
+        });
+      this.$forceUpdate();
+       }
+     })
     },
     init(row) {
       this.pageIndex = 1;
@@ -689,6 +859,7 @@ export default {
       product.map((item) => {
         item.isSelect = this.isSelectAll;
       });
+      this.add_show = false;
       let ids = product.map((item) => item.id);
       this.isSelectAll &&
         this.axios
@@ -702,6 +873,7 @@ export default {
             console.log(res);
             this.productPartList = res.data;
             this.productPartList.map((item) => (item.isSelect = false));
+            this.add_show = true
           });
     },
     handleProductClick(product, type) {
@@ -709,6 +881,7 @@ export default {
       this.currentProductList = product;
       const temp_product = this.tableData.filter((item) => item.isSelect);
       const product_id = temp_product.map((item) => item.id);
+      this.select_id = product_id;
       // 判断是否全选,全选标题选中
       let flag = true;
       this.tableData.map((item) => {
@@ -750,7 +923,10 @@ export default {
           console.log(res);
           this.changeableTableData = res.data.list;
           this.defaultPart = res.data.head;
+          this.formData = res.data.head;
+          this.formData.is_null = res.data.head.is_null == 0?false:true;
           this.defaultPart.title = part.title;
+          this.formData.part_id = part.id;
         });
       this.$forceUpdate();
     },
@@ -772,6 +948,10 @@ export default {
       const product_id = temp_product.map((item) => item.id);
       const temp_part = this.productPartList.filter((item) => item.isSelect);
       const part_id = temp_part.map((item) => item.id);
+      console.log(product_id)
+      if(part_id.length == 0){
+        return this.$Message.warning('请选择部件')
+      }
       this.axios
         .post("/api/support_product_batch", {
           type: 3,
@@ -787,6 +967,13 @@ export default {
             this.tableData.map((item) => (item.isSelect = false));
             this.productPartList = [];
             this.changeableTableData = [];
+            this.defaultPart =  {
+        title: "",
+        formula_l: "",
+        formula_w: "",
+        formula_h: "",
+        is_null: "",
+      },
             this.showModal = false;
           }
         });
@@ -819,12 +1006,40 @@ export default {
       // this.proxyObj.sortList = sortList;
       this.getData(this.proxyObj);
     },
-    edit(val){
+    edit(val,type){
       this.productPartList.forEach(v=>{
         v.isSelect = false;
       })
-      val.isSelect = !val.isSelect
-      console.log(val)
+      val.isSelect = !val.isSelect;
+       const temp_product = this.tableData.filter((item) => item.isSelect);
+      const product_id = temp_product.map((item) => item.id);
+     
+       this.axios
+        .post("/api/support_product_get_part", {
+          type,
+          basic_product_id: [this.$route.query.id],
+          product_id,
+          part_id:[val.id],
+        })
+        .then((res) => {
+          this.formData = res.data.head;
+          this.formData.part_id = val.id;
+         this.changeableTableData = res.data.list;
+         this.defaultPart = JSON.parse(JSON.stringify(res.data.head)) ;
+         this.defaultPart.title = val.title;
+         if(res.data.head instanceof Array){
+            this.formData.is_null = false;
+            this.formData.formula_l = '';
+            this.formData.formula_w = '';
+            this.formData.formula_h = '';
+            this.defaultPart.is_null = false;
+         }else{
+           this.formData.is_null=res.data.head.is_null == 0?false:true;
+          this.defaultPart.is_null = this.defaultPart.is_null == 0?false:true;
+         }
+        });
+      this.$forceUpdate();
+     
       this.edit_showModel = true;
     },
     goPage(n, row) {
@@ -887,8 +1102,6 @@ export default {
         justify-content: flex-start;
         align-items: flex-start;
         flex-wrap: wrap;
-        .show_modal_content_left_item_detail {
-        }
       }
     }
   }

+ 11 - 0
src/views/ProductionOrderList/ProductionsOrder/BST_list.vue

@@ -53,6 +53,9 @@
              style="margin:0 5px"
              :disabled="row.state==2"
              @click="openModal(row)">下生产排产</a>
+              <a v-if="row.part_state == 0"
+             style="margin:0 5px"
+             @click="del(row)">删除</a>
         </div>
       </template>
       <template slot="pageSlot">
@@ -205,6 +208,14 @@ export default {
     }
   },
   methods: {
+    del(row){
+       this.axios.get('/api/orders_produce_order_del',{params:{order_no:row.order_no}}).then(res=>{
+         if(res.code == 200){
+           this.$Message.success(res.msg);
+           this.getData(this.proxyObj)
+         }
+       })
+    },
     init (row) {
       // row.page_index = this.page_index;
       // row.page_size = this.page_size;

+ 2 - 2
vue.config.js

@@ -1,11 +1,11 @@
 const axios_default_ip =
   process.env.NODE_ENV == "dev"
-    ? "http://124.71.176.88:882"
+    ? "http://121.41.102.225:82"
     : process.env.NODE_ENV == "test-prd"
     ? "http://124.71.176.88:882" //测试服
     : process.env.NODE_ENV == "prd_other"
     ? "http://121.37.173.82:82" //贝斯特
-    : "http://124.71.176.88:82";
+    : "http://124.71.176.88:882";
 //  http://124.71.176.88:882  //江山
 // 'http://121.41.102.225:82' :测试