mushencc 2 роки тому
батько
коміт
8aff8e0ca9

+ 36 - 0
src/routerMap/index.js

@@ -554,6 +554,15 @@ const routerMap = [
     component: (resolve) => require(["@/views/BusinessManagement/Construction/detail"], resolve),
   },
   {
+    path: "/cms/BusinessManagement/Construction/his_detail",
+    name: "ConstructionDetailHis", //历史施工单单列表详情
+    meta: {
+      index: 3,
+      canMultipleOpen: true
+    },
+    component: (resolve) => require(["@/views/BusinessManagement/Construction/his_detail"], resolve),
+  },
+  {
     path: "/cms/BusinessManagement/MaterialReturn/index",
     name: "MaterialReturn", //退料列表
     meta: {
@@ -761,5 +770,32 @@ const routerMap = [
     },
     component: (resolve) => require(["@/views/Report/BillingMaterialTotal/index"], resolve),
   },
+  {
+    path: "/cms/BusinessManagement/Opening/index",
+    name: "OpeningIndex", // 期初列表
+    meta: {
+      index: 3,
+      canMultipleOpen: true
+    },
+    component: (resolve) => require(["@/views/BusinessManagement/Opening/index"], resolve),
+  },
+  {
+    path: "/cms/BusinessManagement/Opening/detail",
+    name: "OpeningDetail", // 期初详情
+    meta: {
+      index: 3,
+      canMultipleOpen: true
+    },
+    component: (resolve) => require(["@/views/BusinessManagement/Opening/detail"], resolve),
+  },
+  {
+    path: "/cms/BasicSettings/TeamManage/index",
+    name: "TeamManage", // 班组
+    meta: {
+      index: 3,
+      canMultipleOpen: true
+    },
+    component: (resolve) => require(["@/views/BasicSettings/TeamManage/index"], resolve),
+  },
 ];
 export default routerMap;

+ 1 - 1
src/views/BasicSettings/OwnerManage/index.vue

@@ -435,4 +435,4 @@ export default {
   max-height: calc(100% - 150px);
   border: 1px solid #fff;
 }
-</style>
+</style>

+ 391 - 0
src/views/BasicSettings/TeamManage/index.vue

@@ -0,0 +1,391 @@
+<template>
+  <div>
+    <Toptitle>
+      <template #left>
+        <Button type="primary" @click="is_open = !is_open">{{
+          is_open ? "收缩" : "展开"
+        }}</Button>
+      </template>
+      <template #right>
+        <Button
+          type="primary"
+          @click="handleConnectUser"
+          style="margin-right: 10px"
+          >人员绑定</Button
+        >
+        <Button type="primary" @click="handleAdd">新增</Button>
+      </template>
+    </Toptitle>
+    <div
+      :style="
+        is_open
+          ? 'max-height:200px;transition: all .5s;'
+          : 'max-height:0px;overflow: hidden;transition: all .5s;'
+      "
+    >
+      <Form :label-width="80" style="display: flex; flex-wrap: wrap">
+        <FormItem label="班组名称">
+          <Input v-model="searchData.title" clearable style="width: 200px" />
+        </FormItem>
+        <FormItem :label-width="20">
+          <Button type="primary" @click="handleSearch">查询</Button>
+        </FormItem>
+      </Form>
+    </div>
+    <div class="table_content">
+      <vxe-grid
+        v-bind="gridOptions"
+        @checkbox-change="handleSelect"
+        @checkbox-all="handleSelectAll"
+      >
+        <template #crt_time="{ row }">
+          <span>{{ func.replaceDateNoHMS(row.crt_time) }}</span>
+        </template>
+        <template #upd_time="{ row }">
+          <span>{{ func.replaceDateNoHMS(row.upd_time) }}</span>
+        </template>
+        <template #set="{ row }">
+          <a @click="handleEdit(row)">修改</a>
+          <a style="margin-left: 10px" @click="handleDel(row)">删除</a>
+          <a style="margin-left: 10px" @click="handleDetail(row)">人员详情</a>
+        </template>
+      </vxe-grid>
+    </div>
+
+    <Footer
+      :pageSize="pageSize"
+      :pageIndex="pageIndex"
+      :total="total"
+      @changeSize="changeSize"
+      @changePage="changePage"
+    ></Footer>
+    <Modal
+      :title="sort == 1 ? '新增' : '编辑'"
+      width="30"
+      :closable="false"
+      :mask-closable="false"
+      v-model="is_show"
+    >
+      <Form
+        :label-width="80"
+        ref="formValidate"
+        :model="formData"
+        :rules="ruleValidate"
+      >
+        <FormItem label="班组编码" class="form_item" prop="code">
+          <Input v-model="formData.code" placeholder="请输入" />
+        </FormItem>
+        <FormItem label="班组名称" class="form_item" prop="title">
+          <Input v-model="formData.title" placeholder="请输入" />
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button style="margin-right: 10px" @click="is_show = false"
+          >取消</Button
+        >
+        <Button type="primary" @click="handleSubmit('formValidate')"
+          >确认</Button
+        >
+      </div>
+    </Modal>
+    <Modal
+      v-model="is_choose"
+      width="650px"
+      :closeable="false"
+      :mask-closable="false"
+      title="人员绑定"
+    >
+      <!-- <ChooseTap :list="chooseFormData"></ChooseTap> -->
+      <Form :label-width="50">
+        <FormItem label="部门" class="form_item1">
+          <Select
+            filterable
+            clearable
+            v-model="department_id"
+            transfer
+            style="width: 200px"
+            @on-change="handleSelectDepartment"
+          >
+            <Option
+              v-for="item in departList"
+              :key="item.id"
+              :value="item.id"
+              :label="item.title"
+            />
+          </Select>
+        </FormItem>
+      </Form>
+      <Transfer
+        :data="data3"
+        :target-keys="targetKeys3"
+        :list-style="listStyle"
+        :render-format="render3"
+        :titles="['待选', '已选']"
+        :operations="['左移', '右移']"
+        filterable
+        @on-change="handleChange3"
+      >
+        <div :style="{ float: 'right', margin: '5px' }">
+          <Button size="small" @click="reloadMockData">重置</Button>
+        </div>
+      </Transfer>
+      <div slot="footer">
+        <Button @click="is_choose = false" style="margin-right: 10px"
+          >取消</Button
+        >
+        <Button @click="handleChooseSure" type="primary">确认</Button>
+      </div>
+    </Modal>
+    <Modal
+      :closable="false"
+      :mask-closable="false"
+      title="人员详情"
+      width="30"
+      v-model="is_detail"
+    >
+      <vxe-grid v-bind="modalGridOptions"> </vxe-grid>
+      <div slot="footer">
+        <Button @click="is_detail = false" style="margin-right: 10px"
+          >取消</Button
+        >
+      </div>
+    </Modal>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      proxyData: {},
+      department_id: '',
+      is_choose: false,
+      chooseFormData: [],
+      selectData: [],
+      is_open: false,
+      pageSize: 10,
+      pageIndex: 1,
+      total: 0,
+      sort: null,
+      is_show: false,
+      listStyle: {
+        width: '250px',
+        height: '300px'
+      },
+      formData: {
+        code: '',
+        title: ''
+      },
+      searchData: {},
+      ruleValidate: {
+        code: [
+          { required: true, message: '请输班组编码', trigger: 'blur' }
+        ],
+        title: [
+          { required: true, message: '请输入班组名称', trigger: 'blur' }
+        ]
+      },
+      gridOptions: {
+        border: true,
+        resizable: true,
+        maxHeight: 'auto',
+        showOverflow: true,
+        align: 'left',
+        columns: [
+          { type: 'checkbox', width: 40 },
+          { type: 'seq', width: 50, title: '序号', showHeaderOverflow: true },
+          { field: 'title', title: '班组名称', showHeaderOverflow: true },
+          { field: 'code', title: '班组编号', showHeaderOverflow: true },
+          { field: 'crt_time', title: '创建时间', showHeaderOverflow: true, slots: { default: 'crt_time' } },
+          { field: 'upd_time', title: '更新时间', showHeaderOverflow: true, slots: { default: 'upd_time' } },
+          { field: 'set', title: '操作', showHeaderOverflow: true, slots: { default: 'set' } },
+        ],
+        data: []
+      },
+      modalGridOptions: {
+        border: true,
+        resizable: true,
+        maxHeight: 'auto',
+        showOverflow: true,
+        align: 'left',
+        columns: [
+          { field: 'code', title: '人员编号', showHeaderOverflow: true },
+          { field: 'emp_name', title: '人员名称', showHeaderOverflow: true }
+        ],
+        data: []
+      },
+      is_detail: false,
+      data3: [],
+      targetKeys3: [],
+      department_id: "",
+      departList: []
+    }
+  },
+  created() {
+    //获取人员
+    this.axios.post('/api/employeeList').then(res => {
+      this.chooseFormData = res.data.data;
+      this.data3 = this.getMockData();
+    })
+    //获取部门
+    this.axios.post('/api/departList').then(res => {
+      this.departList = res.data;
+    })
+  },
+  mounted() {
+    this.initData();
+  },
+  methods: {
+    handleSearch() {
+      this.proxyData = JSON.parse(JSON.stringify(this.searchData));
+      this.pageIndex = 1;
+      this.initData(this.proxyData);
+    },
+    handleSelectDepartment() {
+      this.axios.post('/api/employeeList', { depart_id: this.department_id }).then(res => {
+        this.chooseFormData = res.data.data;
+        this.reloadMockData();
+      })
+    },
+    reloadMockData() {
+      this.data3 = this.getMockData();
+      this.targetKeys3 = [];
+    },
+    handleChange3(newTargetKeys) {
+      this.targetKeys3 = newTargetKeys;
+    },
+    render3(item) {
+      return item.label;
+    },
+    getMockData() {
+      let mockData = [];
+      for (let i = 0; i < this.chooseFormData.length-1; i++) {
+        mockData.push({
+          key: this.chooseFormData[i].id,
+          label: this.chooseFormData[i].emp_name,
+        });
+      }
+      return mockData;
+    },
+    handleDetail(row) {
+      this.axios.post('/api/teamDetail', { id: row.id }).then(res => {
+        this.modalGridOptions.data = res.data;
+        this.is_detail = true;
+      })
+    },
+    handleChooseSure() {
+      if (this.targetKeys3.length == 0) {
+        return this.$Message.warning('请选择需要绑定的人员!');
+      }
+      let team_id = this.selectData.map(v => {
+        return v.id
+      })
+      let employee_id = this.targetKeys3;
+      this.axios.post('/api/employeeTeam', { type: 1, insert: { team_id, employee_id } }).then(res => {
+        if (res.code == 200) {
+          this.$Message.success(res.msg);
+          this.initData(this.proxyData);
+          this.is_choose = false;
+        }
+      })
+    },
+    handleSelectAll(e) {
+      this.selectData = e.records;
+    },
+    handleSelect(e) {
+      this.selectData = e.records;
+    },
+    initData(row) {
+      this.axios.post('/api/teamList', { ...row, page_size: this.pageSize, page_index: this.pageIndex }).then(res => {
+        this.gridOptions.data = res.data.data;
+        this.total = res.data.total;
+      })
+    },
+    changePage(e) {
+      this.pageIndex = e;
+      this.initData(this.proxyData);
+    },
+    changeSize(e) {
+      this.pageSize = e;
+      this.pageIndex = 1;
+      this.initData(this.proxyData);
+    },
+    handleSubmit(name) {
+      this.$refs[name].validate((valid) => {
+        if (valid) {
+          this.handleSure();
+        } else {
+          this.$Message.warning('请填写完整信息!');
+        }
+      })
+    },
+    handleConnectUser() {
+      if (this.selectData.length == 0) {
+        return this.$Message.warning('请先选择角色!');
+      }
+      this.data3 = this.getMockData();
+      this.department_id = '';
+      this.is_choose = true;
+    },
+    handleSure() {
+      switch (this.sort) {
+        case 1://新增
+          this.axios.post('/api/teamAdd', { ...this.formData }).then(res => {
+            if (res.code == 200) {
+              this.$Message.success(res.msg);
+              this.initData(this.proxyData);
+            }
+          })
+          break;
+        case 2://编辑
+          this.axios.post('/api/teamEdit', { ...this.formData }).then(res => {
+            if (res.code == 200) {
+              this.$Message.success(res.msg);
+              this.initData(this.proxyData);
+            }
+          })
+          break;
+      }
+      this.is_show = false;
+    },
+    handleDel(row) {
+      this.axios.post('/api/teamDel', { id: row.id }).then(res => {
+        if (res.code == 200) {
+          this.$Message.success(res.msg);
+          if (this.pageIndex != 1 && this.gridOptions.data.length == 1) {
+            this.pageIndex--;
+          }
+          this.initData(this.proxyData);
+        }
+      })
+    },
+    handleAdd() {
+      this.sort = 1;
+      this.is_show = true;
+      this.formData = {
+        code: '',
+        title: ''
+      }
+
+    },
+    handleEdit(row) {
+      this.sort = 2;
+      this.$set(this.formData, 'code', row.code);
+      this.$set(this.formData, 'title', row.title);
+      this.$set(this.formData, 'id', row.id);
+      this.is_show = true;
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+.form_item {
+  margin-bottom: 15px !important;
+}
+.form_item1 {
+  margin-top: -8px !important;
+}
+.table_content {
+  height: calc(100% - 150px);
+}
+</style>

+ 3 - 1
src/views/BasicSettings/partCombination/index.vue

@@ -596,6 +596,7 @@ export default {
     },
     handleRemove(rowIndex) {
       if (this.modalGridOptions.data.length == 1) {
+        this.modalGridOptions.data = [{ title: '', expend_meters: '', car_depart_id: '', car_depart_meter: '' }]
         return
       }
       this.modalGridOptions.data.splice(rowIndex, 1)
@@ -605,9 +606,10 @@ export default {
     },
     handleRemove1(rowIndex) {
       if (this.modalGridOptions1.data.length == 1) {
+        this.modalGridOptions1.data = [{ title: '', expend_meters: '', car_depart_id: '', car_depart_meter: '' }]
         return
       }
-      this.modalGridOptions.data.splice(rowIndex, 1)
+      this.modalGridOptions1.data.splice(rowIndex, 1)
     },
     initData(row) {
       this.axios.post('/api/carDepartCombineList', { ...row, page_index: this.pageIndex, page_size: this.pageSize }).then(res => {

+ 105 - 15
src/views/BusinessManagement/BillingMaterial/detail.vue

@@ -2,13 +2,7 @@
   <div>
     <Toptitle>
       <template #right>
-        <Button
-          type="primary"
-          @click="handleCheck"
-          style="margin-right: 10px"
-          v-show="type != 1"
-          >审核</Button
-        >
+        <span v-show="oa_state === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
         <Button
           ghost
           style="margin-right: 10px"
@@ -17,14 +11,20 @@
           v-show="type != 3 && !formData.status"
           >保存</Button
         >
-        <Button
-          @click="
-            $router.push({
-              path: '/cms/BusinessManagement/BillingMaterial/index',
-            })
-          "
-          >返回</Button
+<!--        <Button-->
+<!--          @click="-->
+<!--            $router.push({-->
+<!--              path: '/cms/BusinessManagement/BillingMaterial/index',-->
+<!--            })-->
+<!--          "-->
+<!--          >返回</Button-->
+<!--        >-->
+        <Button style="margin-right:10px" type="primary" @click="handleCheck" v-show="type != 1&& formData.status==0"
+        >审核</Button
         >
+        <Button style="margin-right: 10px" type="success" ghost v-show="type != 1&&oa_state==1&& formData.status==1" @click="handlePassModal(1)">通过</Button>
+        <Button style="margin-right: 10px" type="error" ghost v-show="type != 1&&oa_state==1&& formData.status==1" @click="handlePassModal(0)">驳回</Button>
+        <Button type="warning" ghost v-show="type != 1 && formData.status==1" @click="handleOaModal">审核详情</Button>
       </template>
     </Toptitle>
     <div class="content">
@@ -171,12 +171,53 @@
         </vxe-grid>
       </div>
     </div>
+    <Modal v-model="is_oa" width="30" title="原因" :closable="false" :mask-closable="false">
+      <Form>
+        <FormItem :label-width="60" label="原因">
+          <Input clearable v-model="oa_remark" placeholder="请输入"/>
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button @click="is_oa = false" style="margin-right: 10px">取消</Button>
+        <Button type="primary" ghost @click="handlePass">确认</Button>
+      </div>
+    </Modal>
+    <Modal v-model="is_oaDetail" width="80" title="审核详情" :closable="false" :mask-closable="false">
+      <vxe-grid
+          v-bind="oaGridOptions"
+      >
+        <template #crt_time="{row}">
+          <span>{{func.replaceDateNoHMS(row.crt_time)}}</span>
+        </template>
+        <template #state="{row}">
+          <span>{{row.state==0?'未审核':row.state==1?'审核通过':'审核驳回'}}</span>
+        </template>
+      </vxe-grid>
+      <div slot="footer">
+        <Button @click="is_oaDetail = false" style="margin-right: 10px">取消</Button>
+      </div>
+    </Modal>
   </div>
 </template>
 <script>
 export default {
   data() {
     return {
+      oaGridOptions:{
+        border: true,
+        resizable: true,
+        showOverflow: true,
+        align: 'left',
+        columns: [
+          { field: 'sort', width: 80, title: '排序', showHeaderOverflow: true },
+          { field: 'crt_time', title: '时间', showHeaderOverflow: true, minWidth: 100, slots: { default: 'crt_time' } },
+          { field: 'state', title: '状态', showHeaderOverflow: true, minWidth: 100, slots: {default: 'state' } },
+          { field: 'remark', title: '原因', showHeaderOverflow: true, minWidth: 100 },
+        ],
+        data: [
+
+        ]
+      },
       type: '',
       rollFilmList: [],
       formData: {
@@ -215,6 +256,13 @@ export default {
       areaList: [],
       menuList: [],
       regionalList: [],
+      oa_state:'',
+      oa_state_m:'',
+      oa_id:"",
+      oa_remark:'',
+      is_oa:false,
+      is_oaDetail:false,
+      is_o:true
     }
   },
   created() {
@@ -242,6 +290,39 @@ export default {
     }
   },
   methods: {
+    handleOaModal(){
+      let menu_id = this.menuList.find(v => v.uri == '/cms/BusinessManagement/BillingMaterial/index').id;
+      this.axios.post('/api/oaOrderList',{menu_id,order_no:this.$route.query.order_number}).then(res=>{
+        this.oaGridOptions.data = res.data;
+        this.is_oaDetail = true;
+      })
+
+    },
+    handlePassModal(e){
+      this.oa_state_m  = e;
+      this.oa_remark = '';
+      this.is_oa = true;
+    },
+    handlePass(){
+      if (this.is_o) {
+        this.is_o = false
+        let data = {
+          id:this.oa_id,
+          state:this.oa_state_m,
+          remark:this.oa_remark
+        }
+        this.axios.post('/api/oaCheck',data).then(res=>{
+          if(res.code === 200){
+            this.$Message.success(res.msg)
+            this.is_oa=false
+            this.initData()
+          }
+          setTimeout(()=>{
+            this.is_o = true
+          },2000)
+        })
+      }
+    },
     handleChangeNumber(row) {
       if (row.number && row.price) {
         row.total_price = (row.number * row.price * 1).toFixed(2);
@@ -307,6 +388,15 @@ export default {
       this.axios.post('/api/materialChargeDetail', { order_number: this.$route.query.order_number }).then(res => {
         res.data.apply_time = this.func.replaceDateNoHMS(res.data.apply_time);
         this.formData = JSON.parse(JSON.stringify(res.data));
+        if ( this.formData.status === 1 ) {
+          let menu_id = this.menuList.find(v => v.uri == '/cms/BusinessManagement/BillingMaterial/index').id;
+          this.axios.post('/api/oaOrderState',{menu_id,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state = res.data.state;
+              this.oa_id = res.data.id
+            }
+          })
+        }
         this.handleSelectArea(this.formData.area);
         delete this.formData.sub;
         this.gridOptions.data = JSON.parse(JSON.stringify(res.data.sub));
@@ -425,4 +515,4 @@ export default {
   margin: 10px 0;
   border: 1px solid #cccbcb;
 }
-</style>
+</style>

+ 24 - 17
src/views/BusinessManagement/BillingMaterial/index.vue

@@ -213,25 +213,32 @@ export default {
     },
 
     handleDel(row) {
-      let order_number;
-      if (row) {
-        order_number = [row.order_number];
-      } else {
-        order_number = this.selectData.map(v => {
-          return v.order_number;
-        })
-      }
-
-      this.axios.post('/api/materialChargeDel', { order_number }).then(res => {
-        if (res.code == 200) {
-          this.$Message.success(res.msg);
-          if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
-            this.pageIndex--;
+      this.$Modal.confirm({
+        title:'删除',
+        content:'确认删除嘛?',
+        onOk:()=>{
+          let order_number;
+          if (row) {
+            order_number = [row.order_number];
+          } else {
+            order_number = this.selectData.map(v => {
+              return v.order_number;
+            })
           }
-          this.selectData = [];
-          this.initData(this.proxyData);
+
+          this.axios.post('/api/materialChargeDel', { order_number }).then(res => {
+            if (res.code == 200) {
+              this.$Message.success(res.msg);
+              if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
+                this.pageIndex--;
+              }
+              this.selectData = [];
+              this.initData(this.proxyData);
+            }
+          })
         }
       })
+
     },
     handleSearch() {
       this.pageIndex = 1;
@@ -264,4 +271,4 @@ export default {
 .table_content {
   height: calc(100% - 250px);
 }
-</style>
+</style>

+ 116 - 7
src/views/BusinessManagement/Construction/detail.vue

@@ -2,6 +2,7 @@
   <div>
     <Toptitle>
       <template #right>
+        <span v-show="oa_state === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
         <Button
           type="primary"
           ghost
@@ -10,9 +11,12 @@
           style="margin-right: 10px"
           >保存</Button
         >
-        <Button type="primary" @click="handleCheck" v-show="type != 1"
+        <Button style="margin-right:10px" type="primary" @click="handleCheck" v-show="type != 1&& formData.status==0"
           >审核</Button
         >
+        <Button style="margin-right: 10px" type="success" ghost v-show="type != 1&&oa_state==1&& formData.status==1" @click="handlePassModal(1)">通过</Button>
+        <Button style="margin-right: 10px" type="error" ghost v-show="type != 1&&oa_state==1&& formData.status==1" @click="handlePassModal(0)">驳回</Button>
+        <Button type="warning" ghost v-show="type != 1 && formData.status==1" @click="handleOaModal">审核详情</Button>
       </template>
     </Toptitle>
     <div class="content">
@@ -816,6 +820,32 @@
         </Form>
       </div>
     </div>
+    <Modal v-model="is_oa" width="30" title="原因" :closable="false" :mask-closable="false">
+      <Form>
+        <FormItem :label-width="60" label="原因">
+          <Input clearable v-model="oa_remark" placeholder="请输入"/>
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button @click="is_oa = false" style="margin-right: 10px">取消</Button>
+        <Button type="primary" ghost @click="handlePass">确认</Button>
+      </div>
+    </Modal>
+    <Modal v-model="is_oaDetail" width="80" title="审核详情" :closable="false" :mask-closable="false">
+      <vxe-grid
+          v-bind="oaGridOptions"
+      >
+        <template #crt_time="{row}">
+          <span>{{func.replaceDateNoHMS(row.crt_time)}}</span>
+        </template>
+        <template #state="{row}">
+          <span>{{row.state==0?'未审核':row.state==1?'审核通过':'审核驳回'}}</span>
+        </template>
+      </vxe-grid>
+      <div slot="footer">
+        <Button @click="is_oaDetail = false" style="margin-right: 10px">取消</Button>
+      </div>
+    </Modal>
   </div>
 </template>
 <script>
@@ -845,11 +875,27 @@ export default {
       companyList: [],
       fourShopList: [],
       storehouseList: [],
+      oaGridOptions:{
+        border: true,
+        resizable: true,
+        showOverflow: true,
+        align: 'left',
+        columns: [
+          { field: 'sort', width: 80, title: '排序', showHeaderOverflow: true },
+          { field: 'crt_time', title: '时间', showHeaderOverflow: true, minWidth: 100, slots: { default: 'crt_time' } },
+          { field: 'state', title: '状态', showHeaderOverflow: true, minWidth: 100, slots: {default: 'state' } },
+          { field: 'remark', title: '原因', showHeaderOverflow: true, minWidth: 100 },
+        ],
+        data: [
+
+        ]
+      },
       formData: {
         construction_time: new Date(),
         sub: [
           {
-            roll_film_combine_id: '', gridOptions: {
+            roll_film_combine_id: '',
+            gridOptions: {
               border: true,
               resizable: true,
               showOverflow: true,
@@ -889,6 +935,13 @@ export default {
       },
       is_create: false,
       constructionPersonList: [],
+      oa_state:'',
+      oa_state_m:'',
+      oa_id:"",
+      oa_remark:'',
+      is_oa:false,
+      is_oaDetail:false,
+      is_o:true
     }
   },
   created() {
@@ -962,6 +1015,39 @@ export default {
     }
   },
   methods: {
+    handleOaModal(){
+      let menu_id = this.menuList.find(v => v.uri == '/cms/BusinessManagement/Construction/index').id;
+      this.axios.post('/api/oaOrderList',{menu_id,order_no:this.$route.query.order_number}).then(res=>{
+        this.oaGridOptions.data = res.data;
+        this.is_oaDetail = true;
+      })
+
+    },
+    handlePassModal(e){
+       this.oa_state_m  = e;
+       this.oa_remark = '';
+       this.is_oa = true;
+    },
+    handlePass(){
+      if (this.is_o) {
+        this.is_o = false
+        let data = {
+          id:this.oa_id,
+          state:this.oa_state_m,
+          remark:this.oa_remark
+        }
+        this.axios.post('/api/oaCheck',data).then(res=>{
+          if(res.code === 200){
+            this.$Message.success(res.msg)
+            this.is_oa=false
+            this.initData()
+          }
+          setTimeout(()=>{
+            this.is_o = true
+          },2000)
+        })
+      }
+    },
     handleChangeCarType(e) {
       if (e) {
         this.SureCarFilesList = this.carFilesList.filter(v => v.car_type_id == e);
@@ -1040,7 +1126,7 @@ export default {
       })
     },
     looks(img, type) {
-      const array = [];
+      let array = [];
       if (type) {
         img.forEach(v => {
           let obj = {};
@@ -1123,11 +1209,34 @@ export default {
           this.$Message.success(res.msg);
           this.initData();
         }
+        if(res.code == 201&&res.msg == 'construction_rule'){
+          this.$Modal.info({
+            title:'审核确认',
+            content:'有重复的车架号,是否继续审核?',
+            onOk:()=>{
+              this.axios.post('/api/checkAll',{ order_number: this.$route.query.order_number, opt_case: 5, menu_id, is_confirm:1}).then(res=>{
+                if (res.code == 200) {
+                  this.$Message.success(res.msg);
+                  this.initData();
+                }
+              })
+            }
+          })
+        }
       })
     },
     initData() {
       this.axios.post('/api/constructionDetail', { order_number: this.$route.query.order_number }).then(res => {
         this.formData = JSON.parse(JSON.stringify(res.data));
+        if ( this.formData.status === 1 ) {
+          let menu_id = this.menuList.find(v => v.uri == '/cms/BusinessManagement/Construction/index').id;
+          this.axios.post('/api/oaOrderState',{menu_id,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state = res.data.state;
+              this.oa_id = res.data.id
+            }
+          })
+        }
         this.formData.is_big = this.carFilesList.find(v => v.car_type_id == this.formData.car_type).is_big;
         this.SureRollFilmCombineList = this.rollFilmCombineList.filter(v => (v.company_id == this.formData.company_id && (this.formData.basic_type_item_id ? this.workProductList.find(x => x.id == this.formData.basic_type_item_id).b_r_f_id.split(',').map(b => b * 1).indexOf(v.basic_roll_film_id) != -1 : true)
         ));
@@ -1268,7 +1377,7 @@ export default {
         row.basic_roll_film_id = this.rollFilmList.find(v => v.id == e).b_r_f_id;
         row.basic_roll_film_name = this.rollFilmList.find(v => v.id == e).b_r_f_name;
         row.roll_film_number_arr = this.rollFilmList.find(v => v.id == e).roll_film_number_arr;
-        row.warranty_day = this.rollFilmList.find(v => v.id == e).warranty_day;
+        row.warranty_year = this.rollFilmList.find(v => v.id == e).warranty_year;
         row.roll_film_number = '';
       } else {
         row.roll_film_name = '';
@@ -1276,7 +1385,7 @@ export default {
         row.basic_roll_film_name = '';
         row.roll_film_number_arr = [];
         row.roll_film_number = '';
-        row.warranty_day = '';
+        row.warranty_year = '';
       }
     },
     handleSelectCarDepart(e, row) {
@@ -1307,12 +1416,12 @@ export default {
         let roll_film_name = this.SureRollFilmCombineList.find(v => v.id == e).roll_film_name;
         let basic_roll_film_name = this.SureRollFilmCombineList.find(v => v.id == e).roll_film_type;
         let basic_roll_film_id = this.SureRollFilmCombineList.find(v => v.id == e).basic_roll_film_id;
-        let warranty_day = this.rollFilmList.find(v => v.id == roll_film_id).warranty_day;
+        let warranty_year = this.rollFilmList.find(v => v.id == roll_film_id).warranty_year;
         this.axios.post('/api/carDepartCombineDetail', { id }).then(res => {
           let car_depart_sub = this.formData.is_big ? res.data.car_depart_sub_big : res.data.car_depart_sub; //如果是大型车就拿big的不是就是拿另外一个非大型车的
           let data = this.carDepartList.filter(v => car_depart_sub.indexOf(v.id) != -1);
           data.forEach(v => {
-            v.warranty_day = warranty_day;
+            v.warranty_year = warranty_year;
             v.car_depart_name = v.title;
             // v.disable = true;
             v.basic_roll_film_id = basic_roll_film_id;

+ 441 - 0
src/views/BusinessManagement/Construction/his_detail.vue

@@ -0,0 +1,441 @@
+<template>
+  <div>
+    <Toptitle>
+    </Toptitle>
+    <div class="content">
+      <div class="content_title">历史施工单</div>
+
+      <Form :label-width="100" class="form">
+        <FormItem label="施工单号" class="item">
+          <span>{{formData.order_number}}</span>
+        </FormItem>
+        <!-- <FormItem label="原施工单号" class="item"></FormItem> -->
+        <FormItem label="施工日期" class="item">
+          <span>{{formData.construction_time}}</span>
+        </FormItem>
+        <FormItem label="施工技师" class="item">
+          <Select
+              transfer
+              clearable
+              filterable
+              v-model="formData.construction_person"
+          >
+            <Option
+                v-for="item in employeeList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.emp_name"
+            />
+          </Select>
+        </FormItem>
+        <FormItem label="4s店名称" class="item">
+          <Select
+              transfer
+              filterable
+              clearable
+              v-model="formData.four_shop_id"
+          >
+            <Option
+                v-for="item in fourShopList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.title"
+            />
+          </Select>
+        </FormItem>
+        <FormItem label="所属仓库" class="item">
+          <Select
+              transfer
+              filterable
+              clearable
+              placeholder="自动带出"
+              v-model="formData.storehouse_id"
+          >
+            <Option
+                v-for="item in storehouseList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.title"
+            />
+          </Select>
+        </FormItem>
+        <FormItem label="所属集团" class="item">
+          <Select
+              transfer
+              filterable
+              clearable
+              placeholder="自动带出"
+              v-model="formData.company_id"
+          >
+            <Option
+                v-for="item in companyList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.title"
+            />
+          </Select>
+        </FormItem>
+        <FormItem label="所属区域" class="item">
+          <Select
+              transfer
+              filterable
+              clearable
+              placeholder="自动带出"
+              v-model="formData.area"
+          >
+            <Option
+                v-for="item in areaList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.title"
+            />
+          </Select>
+        </FormItem>
+        <FormItem label="区域经理" class="item">
+          <Select
+              transfer
+              filterable
+              clearable
+              placeholder="自动带出"
+              v-model="formData.regional_manager"
+          >
+            <Option
+                v-for="item in employeeList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.emp_name"
+            />
+          </Select>
+        </FormItem>
+        <FormItem label="联系人" class="item">
+          <span>{{formData.contract_person}}</span>
+        </FormItem>
+        <FormItem label="联系方式" class="item">
+          <span>{{formData.contract_phone}}</span>
+        </FormItem>
+        <FormItem label="4s店地址" class="item">
+          <span>{{formData.address}}</span>
+        </FormItem>
+        <FormItem label="施工产品类型" class="item">
+          <Select
+              transfer
+              filterable
+              clearable
+              v-model="formData.basic_type_item_id"
+              @on-change="handleChangeBasicType"
+          >
+            <Option
+                v-for="item in workProductList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.title"
+            />
+          </Select>
+        </FormItem>
+        <FormItem label="业务类型" class="item">
+          <Select
+              transfer
+              filterable
+              clearable
+              v-model="formData.basic_type_bussiness_id"
+          >
+            <Option
+                v-for="item in workList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.title"
+            />
+          </Select>
+        </FormItem>
+        <FormItem label="车架号" class="item">
+          <span>{{formData.vin_no}}</span>
+        </FormItem>
+        <FormItem label="审核时间" class="item">
+          <span>{{formData.upd_time}}</span>
+        </FormItem>
+      </Form>
+
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      is_ready: true,
+      headers: { 'Authorization': localStorage.getItem('token') },
+      img_type: [],
+      menuList: [],
+      type: '',
+      employeeList: [],
+      rollFilmList: [],
+      basicRollFilmList: [],
+      carDepartList: [],
+      SureRollFilmCombineList: [],
+      rollFilmCombineList: [],
+      ownerList: [],
+      carFilesList: [],
+      SureCarFilesList: [],
+      specialList: [],
+      workList: [],
+      workProductList: [],
+      areaList: [],
+      companyList: [],
+      fourShopList: [],
+      storehouseList: [],
+      oaGridOptions:{
+        border: true,
+        resizable: true,
+        showOverflow: true,
+        align: 'left',
+        columns: [
+          { field: 'sort', width: 80, title: '排序', showHeaderOverflow: true },
+          { field: 'crt_time', title: '时间', showHeaderOverflow: true, minWidth: 100, slots: { default: 'crt_time' } },
+          { field: 'state', title: '状态', showHeaderOverflow: true, minWidth: 100, slots: {default: 'state' } },
+          { field: 'remark', title: '原因', showHeaderOverflow: true, minWidth: 100 },
+        ],
+        data: [
+
+        ]
+      },
+      formData: {},
+      is_create: false,
+      constructionPersonList: [],
+      oa_state:'',
+      oa_state_m:'',
+      oa_id:"",
+      oa_remark:'',
+      is_oa:false,
+      is_oaDetail:false,
+      is_o:true
+    }
+  },
+  created() {
+    //获取4s店列表
+    this.axios.post('/api/foursShopList').then(res => {
+      this.fourShopList = res.data.data;
+    })
+    //获取仓库
+    this.axios.post('/api/storehouseList').then(res => {
+      this.storehouseList = res.data.data;
+    })
+    //获取集团
+    this.axios.post('/api/companyList').then(res => {
+      this.companyList = res.data.data;
+    })
+    //获取区域
+    this.axios.post('/api/areaList').then(res => {
+      this.areaList = this.getArr(res.data);
+    })
+    //获取业务类型
+    this.axios.post('/api/basicTypeList', { type: 1 }).then(res => {
+      this.workList = res.data.data;
+    })
+    //获取车辆品牌
+    this.axios.post('/api/carTypeList').then(res => {
+      this.carTypeList = this.getArr(res.data);
+    })
+    //获取车辆型号
+    this.axios.post('/api/carFilesList').then(res => {
+      this.carFilesList = res.data.data;
+      this.SureCarFilesList = JSON.parse(JSON.stringify(res.data.data));
+    })
+    //获取车架号
+    this.axios.post('/api/ownerList').then(res => {
+      this.ownerList = res.data.data;
+    })
+    //获取套餐档案
+    this.axios.post('/api/rollFilmCombineList', { roll_film_id: 1 }).then(res => {
+      this.rollFilmCombineList = res.data.data;
+    })
+    //获取车辆部位
+    this.axios.post('/api/carDepartList').then(res => {
+      this.carDepartList = res.data.data;
+    })
+
+    //获取人员列表
+    this.axios.post('/api/employeeList', { all_emp: 1 }).then(res => {
+      this.employeeList = res.data.data;
+    })
+    //获取列表
+    this.axios.post('/api/menuList').then(res => {
+      this.menuList = res.data;
+    })
+  },
+  async mounted() {
+    this.type = this.$route.query.type;
+    //获取施工产品类型
+    await this.axios.post('/api/basicTypeList', { type: 2 }).then(res => {
+      this.workProductList = res.data.data;
+    })
+    if (this.type != 1) {
+      this.is_ready = false;
+      await this.initData();
+    }
+  },
+  methods: {
+    handleCheck() {
+      let menu_id = this.menuList.find(v => v.uri == '/cms/BusinessManagement/Construction/index').id;
+      this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: 5, menu_id }).then(res => {
+        if (res.code == 200) {
+          this.$Message.success(res.msg);
+          this.initData();
+        }
+      })
+    },
+    initData() {
+      this.axios.post('/api/constructionDetail', { order_number: this.$route.query.order_number }).then(res => {
+        res.data.construction_time = res.data.construction_time+'';
+        this.formData = JSON.parse(JSON.stringify(res.data))
+
+        this.formData.construction_time = this.func.replaceDateNoHMS(this.formData.construction_time);
+        this.formData.upd_time = this.func.replaceDateNoHMS(this.formData.upd_time);
+      })
+    },
+    handleSave() {
+      let img = [];
+      let key = Object.keys(this.imgData);
+      key.forEach(v => {
+        if (this.imgData[v] && this.imgData[v].length != 0) {
+
+          let obj = {};
+          if (v === '3' || v === '1') {
+
+            obj.type = v;
+            obj.src = this.imgData[v].toString();
+            img.push(obj);
+          } else {
+            obj.type = v;
+            obj.src = this.imgData[v];
+            img.push(obj);
+          }
+        }
+      })
+      let data = JSON.parse(JSON.stringify(this.formData));
+      data.sub.forEach(v => {
+        v.detail = JSON.parse(JSON.stringify(v.gridOptions.data));
+        delete v.gridOptions;
+      })
+      data.construction_time = data.construction_time ? Date.parse(data.construction_time).toString().slice(0, 10) : '';
+      data.img = img;
+      if (this.type == 1) {
+        this.axios.post('/api/constructionAdd', { ...data }).then(res => {
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.$router.push({ path: '/cms/BusinessManagement/Construction/index' })
+          }
+        })
+      } else {
+        this.axios.post('/api/constructionEdit', { ...data }).then(res => {
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.$router.push({ path: '/cms/BusinessManagement/Construction/index' })
+          }
+        })
+      }
+    },
+    handleSelectRollFilm(e, row) {
+      if (e) {
+        row.roll_film_name = this.rollFilmList.find(v => v.id == e).title;
+        row.basic_roll_film_id = this.rollFilmList.find(v => v.id == e).b_r_f_id;
+        row.basic_roll_film_name = this.rollFilmList.find(v => v.id == e).b_r_f_name;
+        row.roll_film_number_arr = this.rollFilmList.find(v => v.id == e).roll_film_number_arr;
+        row.warranty_day = this.rollFilmList.find(v => v.id == e).warranty_day;
+        row.roll_film_number = '';
+      } else {
+        row.roll_film_name = '';
+        row.basic_roll_film_id = '';
+        row.basic_roll_film_name = '';
+        row.roll_film_number_arr = [];
+        row.roll_film_number = '';
+        row.warranty_day = '';
+      }
+    },
+    handleSelectCarDepart(e, row) {
+      if (e) {
+        row.car_depart_name = this.carDepartList.find(v => v.id == e).title;
+        row.meter = this.carDepartList.find(v => v.id == e).expend_meters;
+      } else {
+        row.car_depart_name = '';
+        row.meter = '';
+      }
+    },
+    getArr(arr) {
+      let data = [];
+      arr.forEach(ele => {
+
+        if (ele.children.length != 0) {
+          data = [...data, ...this.getArr(ele.children)];
+        } else {
+          data.push(ele);
+        }
+      });
+      return data;
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+.content {
+  height: calc(100% - 40px);
+  overflow: auto;
+  .content_title {
+    font-size: 26px;
+    letter-spacing: 20px;
+    font-weight: bold;
+    text-align: center;
+  }
+}
+.form {
+  display: flex;
+  flex-wrap: wrap;
+  .item {
+    width: 25%;
+  }
+}
+.bdy {
+  border: 1px solid #e8e5e5;
+  margin: 10px 0;
+  padding: 10px;
+  .title {
+    font-size: 20px;
+    font-weight: bold;
+  }
+}
+.total_img {
+  display: flex;
+  flex-wrap: wrap;
+  img {
+    max-width: 108px;
+    max-height: 108px;
+  }
+  .img_item {
+    position: relative;
+    .img_title {
+      text-align: center;
+    }
+  }
+}
+.upd_file {
+  width: 108px;
+  height: 108px;
+  cursor: pointer;
+  background-color: #f4f5f7;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.img_content {
+  position: relative;
+}
+.delete-img {
+  position: absolute;
+  right: 0px;
+  top: 0px;
+  color: red;
+  cursor: pointer;
+}
+.btn {
+  cursor: pointer;
+}
+</style>

+ 46 - 31
src/views/BusinessManagement/Construction/index.vue

@@ -238,19 +238,19 @@ export default {
         align: 'left',
         columns: [
           { type: 'checkbox', width: 50, fixed: 'left' },
-          { field: 'set', title: '操作', showHeaderOverflow: true, slots: { default: 'set' }, fixed: 'left', width: 160, align: 'center' },
-          { field: 'crt_time', title: '制单日期', showHeaderOverflow: true, width: 100 },
-          { field: 'order_number', title: '单据编号', showHeaderOverflow: true, width: 100 },
-          { field: 'four_shop_name', title: '4s店名称', showHeaderOverflow: true, width: 100 },
-          { field: 'company_name', title: '所属集团', showHeaderOverflow: true, width: 100 },
-          { field: 'area_name', title: '所属区域', showHeaderOverflow: true, width: 100 },
-          { field: 'regional_manager', title: '区域经理', showHeaderOverflow: true, width: 100 },
-          { field: 'basic_type_item_name', title: '施工产品类型', showHeaderOverflow: true, width: 120 },
-          { field: 'basic_type_bussiness_name', title: '业务类型', showHeaderOverflow: true, width: 100 },
-          { field: 'basic_type_special_name', title: '特殊情况', showHeaderOverflow: true, width: 100 },
-          { field: 'car_type_name', title: '车辆型号', showHeaderOverflow: true, width: 100 },
-          { field: 'vin_no', title: '车架号', showHeaderOverflow: true, width: 100 },
-          { field: 'construction_person', title: '施工技师', showHeaderOverflow: true, width: 100 }
+          { field: 'set', title: '操作', showHeaderOverflow: true, slots: { default: 'set' }, fixed: 'left', minWidth: 160, align: 'center' },
+          { field: 'crt_time', title: '制单日期', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'order_number', title: '单据编号', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'four_shop_name', title: '4s店名称', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'company_name', title: '所属集团', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'area_name', title: '所属区域', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'regional_manager', title: '区域经理', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'basic_type_item_name', title: '施工产品类型', showHeaderOverflow: true, minWidth: 120 },
+          { field: 'basic_type_bussiness_name', title: '业务类型', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'basic_type_special_name', title: '特殊情况', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'car_type_name', title: '车辆型号', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'vin_no', title: '车架号', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'construction_person', title: '施工技师', showHeaderOverflow: true, minWidth: 100 }
         ],
         data: []
       },
@@ -310,10 +310,18 @@ export default {
           this.$router.push({ path: '/cms/BusinessManagement/Construction/detail', query: { type: 1, title: "新增施工单" } })
           break;
         case 2://编辑
-          this.$router.push({ path: '/cms/BusinessManagement/Construction/detail', query: { type: 2, title: '编辑施工单', order_number: row.order_number } })
+            if(row.type == 0){
+              this.$router.push({ path: '/cms/BusinessManagement/Construction/detail', query: { type: 2, title: '编辑施工单', order_number: row.order_number } })
+            }else{
+              return this.$Message.warning('此条数据不能编辑')
+            }
           break;
         case 3://详情
-          this.$router.push({ path: '/cms/BusinessManagement/Construction/detail', query: { type: 3, title: '施工单详情', order_number: row.order_number } })
+            if(row.type==0){
+              this.$router.push({ path: '/cms/BusinessManagement/Construction/detail', query: { type: 3, title: '施工单详情', order_number: row.order_number } })
+            }else{
+              this.$router.push({ path: '/cms/BusinessManagement/Construction/his_detail', query: { type: 3, title: '历史施工单详情', order_number: row.order_number } })
+            }
           break;
       }
     },
@@ -338,25 +346,32 @@ export default {
     },
 
     handleDel(row) {
-      let order_number;
-      if (row) {
-        order_number = [row.order_number];
-      } else {
-        order_number = this.selectData.map(v => {
-          return v.order_number;
-        })
-      }
-
-      this.axios.post('/api/constructionDel', { order_number }).then(res => {
-        if (res.code == 200) {
-          this.$Message.success(res.msg);
-          if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
-            this.pageIndex--;
+      this.$Modal.confirm({
+        title:'删除',
+        content:'确认删除嘛?',
+        onOk:()=>{
+          let order_number;
+          if (row) {
+            order_number = [row.order_number];
+          } else {
+            order_number = this.selectData.map(v => {
+              return v.order_number;
+            })
           }
-          this.selectData = [];
-          this.initData(this.proxyData);
+
+          this.axios.post('/api/constructionDel', { order_number }).then(res => {
+            if (res.code == 200) {
+              this.$Message.success(res.msg);
+              if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
+                this.pageIndex--;
+              }
+              this.selectData = [];
+              this.initData(this.proxyData);
+            }
+          })
         }
       })
+
     },
     handleSearch() {
       this.pageIndex = 1;

+ 159 - 20
src/views/BusinessManagement/InventorySheet/detail.vue

@@ -24,14 +24,15 @@
           <Input
             disabled
             placeholder="自动生成"
+            style="width:200px"
             v-model="formData.order_number"
           />
         </FormItem>
-        <FormItem label="制单日期" class="item">
-          <DatePicker v-model="formData.crt_time" placeholder="年/月/日" />
-        </FormItem>
+<!--        <FormItem label="制单日期" class="item">-->
+<!--          <DatePicker v-model="formData.crt_time" placeholder="年/月/日" />-->
+<!--        </FormItem>-->
         <FormItem label="盘点人" class="item">
-          <Select clearable filterable transfer v-model="formData.inventory_id">
+          <Select clearable filterable transfer v-model="formData.inventory_id" style="width:200px">
             <Option
               v-for="item in employeeList"
               :key="item.id"
@@ -78,6 +79,10 @@
             @click="handleClick(10)"
             >审核</Button
           >
+          <span v-show="oa_state === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
+          <Button style="margin-right: 10px" size="small" type="success" ghost v-show="type != 1&&oa_state==1&& formData.status==1" @click="handlePassModal(1,'status')">通过</Button>
+          <Button style="margin-right: 10px" size="small" type="error" ghost v-show="type != 1&&oa_state==1&& formData.status==1" @click="handlePassModal(0,'status')">驳回</Button>
+          <Button type="warning" size="small" ghost v-show="type != 1 && formData.status==1" @click="handleOaModal(249)">审核详情</Button>
         </div>
         <div style="max-height: 430px; border: 1px solid #ffffff">
           <vxe-grid v-bind="gridOptions1">
@@ -153,6 +158,10 @@
             @click="handleClick(11)"
             >审核</Button
           >
+          <span v-show="oa_state_in === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
+          <Button style="margin-right: 10px" size="small" type="success" ghost v-show="type != 1&&oa_state_in==1&& formData.in_status==1" @click="handlePassModal(1,'in')">通过</Button>
+          <Button style="margin-right: 10px" size="small" type="error" ghost v-show="type != 1&&oa_state_in==1&& formData.in_status==1" @click="handlePassModal(0,'in')">驳回</Button>
+          <Button type="warning" size="small" ghost v-show="type != 1 && formData.in_status==1" @click="handleOaModal(251)">审核详情</Button>
         </div>
         <div style="max-height: 430px; border: 1px solid #ffffff">
           <vxe-grid v-bind="gridOptions2"></vxe-grid>
@@ -171,22 +180,67 @@
             @click="handleClick(12)"
             >审核</Button
           >
+          <span v-show="oa_state_out === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
+          <Button style="margin-right: 10px" size="small" type="success" ghost v-show="type != 1&&oa_state_out==1&& formData.out_status==1" @click="handlePassModal(1,'out')">通过</Button>
+          <Button style="margin-right: 10px" size="small" type="error" ghost v-show="type != 1&&oa_state_out==1&& formData.out_status==1" @click="handlePassModal(0,'out')">驳回</Button>
+          <Button type="warning" size="small" ghost v-show="type != 1 && formData.out_status==1" @click="handleOaModal(250)">审核详情</Button>
         </div>
         <div style="max-height: 430px; border: 1px solid #ffffff">
           <vxe-grid v-bind="gridOptions3"></vxe-grid>
         </div>
       </div>
     </div>
+    <Modal v-model="is_oa" width="30" title="原因" :closable="false" :mask-closable="false">
+      <Form>
+        <FormItem :label-width="60" label="原因">
+          <Input clearable v-model="oa_remark" placeholder="请输入"/>
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button @click="is_oa = false" style="margin-right: 10px">取消</Button>
+        <Button type="primary" ghost @click="handlePass">确认</Button>
+      </div>
+    </Modal>
+    <Modal v-model="is_oaDetail" width="80" title="审核详情" :closable="false" :mask-closable="false">
+      <vxe-grid
+          v-bind="oaGridOptions"
+      >
+        <template #crt_time="{row}">
+          <span>{{func.replaceDateNoHMS(row.crt_time)}}</span>
+        </template>
+        <template #state="{row}">
+          <span>{{row.state==0?'未审核':row.state==1?'审核通过':'审核驳回'}}</span>
+        </template>
+      </vxe-grid>
+      <div slot="footer">
+        <Button @click="is_oaDetail = false" style="margin-right: 10px">取消</Button>
+      </div>
+    </Modal>
   </div>
 </template>
 <script>
 export default {
   data() {
     return {
+      oaGridOptions:{
+        border: true,
+        resizable: true,
+        showOverflow: true,
+        align: 'left',
+        columns: [
+          { field: 'sort', width: 80, title: '排序', showHeaderOverflow: true },
+          { field: 'crt_time', title: '时间', showHeaderOverflow: true, minWidth: 100, slots: { default: 'crt_time' } },
+          { field: 'state', title: '状态', showHeaderOverflow: true, minWidth: 100, slots: {default: 'state' } },
+          { field: 'remark', title: '原因', showHeaderOverflow: true, minWidth: 100 },
+        ],
+        data: [
+
+        ]
+      },
       employeeList: [],
       storehouseList: [],
       formData: {
-        crt_time: new Date()
+        // crt_time: new Date()
       },
       gridOptions1: {
         border: true,
@@ -251,6 +305,18 @@ export default {
       },
       type: "",
       menuList: [],
+      oa_state_in:'',
+      oa_id_in:'',
+      oa_state_out:'',
+      oa_id_out:'',
+      oa_state:"",
+      oa_id:'',
+      oa_remark:'',
+      is_o:true,
+      is_oa:false,
+      is_oaDetail:false,
+      oa_state_m:'',
+      is_which:''
     }
   },
   created() {
@@ -274,25 +340,74 @@ export default {
     }
   },
   methods: {
+    handleOaModal(e){
+      let menu_id = e;
+      this.axios.post('/api/oaOrderList',{menu_id,order_no:this.$route.query.order_number}).then(res=>{
+        this.oaGridOptions.data = res.data;
+        this.is_oaDetail = true;
+      })
+    },
+    handlePassModal(e,name){
+      this.oa_state_m  = e;
+      this.oa_remark = '';
+      this.is_oa = true;
+      this.is_which = name;
+    },
+    handlePass(){
+      if (this.is_o) {
+        this.is_o = false
+        let id = this.is_which === 'status' ? this.oa_id : this.is_which === 'out' ? this.oa_id_out : this.oa_id_in
+        let data = {
+          id,
+          state:this.oa_state_m,
+          remark:this.oa_remark
+        }
+        this.axios.post('/api/oaCheck',data).then(res=>{
+          if(res.code === 200){
+            this.$Message.success(res.msg)
+            this.is_oa=false
+            this.initData()
+          }
+          setTimeout(()=>{
+            this.is_o = true
+          },2000)
+        })
+      }
+    },
     handleClick(e) {
-      let menu_id = this.menuList.find(v => v.uri == '/cms/BusinessManagement/InventorySheet/index').id;
-      this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id }).then(res => {
+    if(e==10){
+      this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id:249 }).then(res => {
         if (res.code == 200) {
           this.$Message.success(res.msg);
           this.initData();
         }
       })
+    }else if(e==11){
+      this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id:251 }).then(res => {
+        if (res.code == 200) {
+          this.$Message.success(res.msg);
+          this.initData();
+        }
+      })
+    }else {
+      this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id:250 }).then(res => {
+        if (res.code == 200) {
+          this.$Message.success(res.msg);
+          this.initData();
+        }
+      })
+    }
     },
-    handleCreate1(val, row) {
-      row.roll_film_number_arr.push({
-        roll_film_number: val,
-        inventory_id: 0,
-        number: 0
-      });
-    },
+    // handleCreate1(val, row) {
+    //   row.roll_film_number_arr.push({
+    //     roll_film_number: val,
+    //     inventory_id: 0,
+    //     number: 0
+    //   });
+    // },
     initData() {
       this.axios.post('/api/inventoryDetail', { order_number: this.$route.query.order_number }).then(res => {
-        res.data.crt_time = this.func.replaceDateNoHMS(res.data.crt_time);
+        // res.data.crt_time = this.func.replaceDateNoHMS(res.data.crt_time);
         this.formData = JSON.parse(JSON.stringify(res.data));
         delete this.formData.sub;
         delete this.formData.out;
@@ -310,6 +425,30 @@ export default {
             { field: 'counts', title: '已贴车数', showHeaderOverflow: true, minWidth: 100 }
           ]
         }
+        if(res.data.status==1){
+          this.axios.post('/api/oaOrderState',{menu_id:249,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state = res.data.state;
+              this.oa_id = res.data.id
+            }
+          })
+        }
+        if(res.data.out_status==1){
+          this.axios.post('/api/oaOrderState',{menu_id:250,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state_out = res.data.state;
+              this.oa_id_out = res.data.id
+            }
+          })
+        }
+        if(res.data.in_status==1){
+          this.axios.post('/api/oaOrderState',{menu_id:251,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state_in = res.data.state;
+              this.oa_id_in = res.data.id
+            }
+          })
+        }
         this.gridOptions2.data = res.data.in;
         this.gridOptions3.data = res.data.out;
         //获取卷膜型号
@@ -341,10 +480,10 @@ export default {
       console.log(row);
       if (row.inventory_number != '') {
         if ((row.book_number * 1 - row.inventory_number * 1) > 0) {
-          row.inventory_loss_number = Math.abs(row.book_number * 1 - row.inventory_number * 1);
+          row.inventory_loss_number = Math.abs(row.book_number * 1 - row.inventory_number * 1).toFixed(2);
           row.loss_gain_number = 0;
         } else if ((row.book_number * 1 - row.inventory_number * 1) < 0) {
-          row.loss_gain_number = Math.abs(row.book_number * 1 - row.inventory_number * 1);
+          row.loss_gain_number = Math.abs(row.book_number * 1 - row.inventory_number * 1).toFixed(2);
           row.inventory_loss_number = 0;
         } else {
           row.loss_gain_number = 0;
@@ -367,14 +506,14 @@ export default {
       }
       if (e) {
         row.book_number = row.roll_film_number_arr.find(v => v.roll_film_number == e).number;
-        row.inventory_id = row.roll_film_number_arr.find(v => v.roll_film_number == e).inventory_id;
+        // row.inventory_id = row.roll_film_number_arr.find(v => v.roll_film_number == e).inventory_id;
         row.inventory_number = row.book_number;
         row.inventory_loss_number = 0;
         row.loss_gain_number = 0;
         row.counts = row.roll_film_number_arr.find(v => v.roll_film_number == e).counts;
         console.log(row);
       } else {
-        row.inventory_id = '';
+        // row.inventory_id = '';
         row.book_number = '';
         row.inventory_loss_number = '';
         row.inventory_number = '';
@@ -433,7 +572,7 @@ export default {
     },
     handleSave() {
       let data = JSON.parse(JSON.stringify(this.formData));
-      data.crt_time = data.crt_time ? Date.parse(data.crt_time).toString().slice(0, 10) : '';
+      // data.crt_time = data.crt_time ? Date.parse(data.crt_time).toString().slice(0, 10) : '';
       data.sub = JSON.parse(JSON.stringify(this.gridOptions1.data)).filter(v => v.roll_film_number);
       data.out = JSON.parse(JSON.stringify(this.gridOptions3.data));
       data.in = JSON.parse(JSON.stringify(this.gridOptions2.data));

+ 24 - 17
src/views/BusinessManagement/InventorySheet/index.vue

@@ -244,25 +244,32 @@ export default {
     },
 
     handleDel(row) {
-      let order_number;
-      if (row) {
-        order_number = [row.order_number];
-      } else {
-        order_number = this.selectData.map(v => {
-          return v.order_number;
-        })
-      }
-
-      this.axios.post('/api/inventoryDel', { order_number }).then(res => {
-        if (res.code == 200) {
-          this.$Message.success(res.msg);
-          if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
-            this.pageIndex--;
+      this.$Modal.confirm({
+        title:'删除',
+        content:'确认删除嘛?',
+        onOk:()=>{
+          let order_number;
+          if (row) {
+            order_number = [row.order_number];
+          } else {
+            order_number = this.selectData.map(v => {
+              return v.order_number;
+            })
           }
-          this.selectData = [];
-          this.initData(this.proxyData);
+
+          this.axios.post('/api/inventoryDel', { order_number }).then(res => {
+            if (res.code == 200) {
+              this.$Message.success(res.msg);
+              if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
+                this.pageIndex--;
+              }
+              this.selectData = [];
+              this.initData(this.proxyData);
+            }
+          })
         }
       })
+
     },
     handleSearch() {
       this.pageIndex = 1;
@@ -295,4 +302,4 @@ export default {
 .table_content {
   height: calc(100% - 250px);
 }
-</style>
+</style>

+ 107 - 17
src/views/BusinessManagement/MaterialReturn/detail.vue

@@ -2,13 +2,7 @@
   <div>
     <Toptitle>
       <template #right>
-        <Button
-          type="primary"
-          @click="handleCheck"
-          style="margin-right: 10px"
-          v-show="type != 1"
-          >审核</Button
-        >
+        <span v-show="oa_state === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
         <Button
           ghost
           style="margin-right: 10px"
@@ -17,14 +11,20 @@
           v-show="type != 3 && !formData.status"
           >保存</Button
         >
-        <Button
-          @click="
-            $router.push({
-              path: '/cms/BusinessManagement/MaterialReturn/index',
-            })
-          "
-          >返回</Button
+<!--        <Button-->
+<!--          @click="-->
+<!--            $router.push({-->
+<!--              path: '/cms/BusinessManagement/MaterialReturn/index',-->
+<!--            })-->
+<!--          "-->
+<!--          >返回</Button-->
+<!--        >-->
+        <Button style="margin-right:10px" type="primary" @click="handleCheck" v-show="type != 1&& formData.status==0"
+        >审核</Button
         >
+        <Button style="margin-right: 10px" type="success" ghost v-show="type != 1&&oa_state==1&& formData.status==1" @click="handlePassModal(1)">通过</Button>
+        <Button style="margin-right: 10px" type="error" ghost v-show="type != 1&&oa_state==1&& formData.status==1" @click="handlePassModal(0)">驳回</Button>
+        <Button type="warning" ghost v-show="type != 1 && formData.status==1" @click="handleOaModal">审核详情</Button>
       </template>
     </Toptitle>
     <div class="content">
@@ -291,12 +291,53 @@
         </FormItem> -->
       </Form>
     </div>
+    <Modal v-model="is_oa" width="30" title="原因" :closable="false" :mask-closable="false">
+      <Form>
+        <FormItem :label-width="60" label="原因">
+          <Input clearable v-model="oa_remark" placeholder="请输入"/>
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button @click="is_oa = false" style="margin-right: 10px">取消</Button>
+        <Button type="primary" ghost @click="handlePass">确认</Button>
+      </div>
+    </Modal>
+    <Modal v-model="is_oaDetail" width="80" title="审核详情" :closable="false" :mask-closable="false">
+      <vxe-grid
+          v-bind="oaGridOptions"
+      >
+        <template #crt_time="{row}">
+          <span>{{func.replaceDateNoHMS(row.crt_time)}}</span>
+        </template>
+        <template #state="{row}">
+          <span>{{row.state==0?'未审核':row.state==1?'审核通过':'审核驳回'}}</span>
+        </template>
+      </vxe-grid>
+      <div slot="footer">
+        <Button @click="is_oaDetail = false" style="margin-right: 10px">取消</Button>
+      </div>
+    </Modal>
   </div>
 </template>
 <script>
 export default {
   data() {
     return {
+      oaGridOptions:{
+        border: true,
+        resizable: true,
+        showOverflow: true,
+        align: 'left',
+        columns: [
+          { field: 'sort', width: 80, title: '排序', showHeaderOverflow: true },
+          { field: 'crt_time', title: '时间', showHeaderOverflow: true, minWidth: 100, slots: { default: 'crt_time' } },
+          { field: 'state', title: '状态', showHeaderOverflow: true, minWidth: 100, slots: {default: 'state' } },
+          { field: 'remark', title: '原因', showHeaderOverflow: true, minWidth: 100 },
+        ],
+        data: [
+
+        ]
+      },
       type: '',
       rollFilmList: [],
       fourShopList: [],
@@ -333,13 +374,20 @@ export default {
       storehouseList: [],
       companyList: [],
       areaList: [],
-      menuList: []
+      menuList: [],
+      oa_state:'',
+      oa_state_m:'',
+      oa_id:"",
+      oa_remark:'',
+      is_oa:false,
+      is_oaDetail:false,
+      is_o:true
     }
   },
   created() {
 
     //获取人员
-    this.axios.post('/api/employeeList').then(res => {
+    this.axios.post('/api/employeeList',{ all_emp:1 }).then(res => {
       this.employeeList = res.data.data;
     })
     //获取退料类型
@@ -374,6 +422,39 @@ export default {
     }
   },
   methods: {
+    handleOaModal(){
+      let menu_id = this.menuList.find(v => v.uri == '/cms/BusinessManagement/MaterialReturn/index').id;
+      this.axios.post('/api/oaOrderList',{menu_id,order_no:this.$route.query.order_number}).then(res=>{
+        this.oaGridOptions.data = res.data;
+        this.is_oaDetail = true;
+      })
+
+    },
+    handlePassModal(e){
+      this.oa_state_m  = e;
+      this.oa_remark = '';
+      this.is_oa = true;
+    },
+    handlePass(){
+      if (this.is_o) {
+        this.is_o = false
+        let data = {
+          id:this.oa_id,
+          state:this.oa_state_m,
+          remark:this.oa_remark
+        }
+        this.axios.post('/api/oaCheck',data).then(res=>{
+          if(res.code === 200){
+            this.$Message.success(res.msg)
+            this.is_oa=false
+            this.initData()
+          }
+          setTimeout(()=>{
+            this.is_o = true
+          },2000)
+        })
+      }
+    },
     handleChangeRollFilm(e, row) {
       if (this.gridOptions.data.filter(v => v.roll_film_id == row.roll_film_id).length) {
         if (this.gridOptions.data.filter(v => v.roll_film_id == row.roll_film_id).filter(c => c.roll_film_number == e).length == 2) {
@@ -395,6 +476,15 @@ export default {
       this.axios.post('/api/materialReturnDetail', { order_number: this.$route.query.order_number }).then(res => {
         res.data.return_time = this.func.replaceDateNoHMS(res.data.return_time);
         this.formData = JSON.parse(JSON.stringify(res.data));
+        if ( this.formData.status === 1 ) {
+          let menu_id = this.menuList.find(v => v.uri == '/cms/BusinessManagement/MaterialReturn/index').id;
+          this.axios.post('/api/oaOrderState',{menu_id,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state = res.data.state;
+              this.oa_id = res.data.id
+            }
+          })
+        }
         delete this.formData.sub;
         this.gridOptions.data = JSON.parse(JSON.stringify(res.data.sub));
         //获取卷膜型号
@@ -579,4 +669,4 @@ export default {
   top: 0px;
   color: red;
 }
-</style>
+</style>

+ 24 - 17
src/views/BusinessManagement/MaterialReturn/index.vue

@@ -286,25 +286,32 @@ export default {
     },
 
     handleDel(row) {
-      let order_number;
-      if (row) {
-        order_number = [row.order_number];
-      } else {
-        order_number = this.selectData.map(v => {
-          return v.order_number;
-        })
-      }
-
-      this.axios.post('/api/materialReturnDel', { order_number }).then(res => {
-        if (res.code == 200) {
-          this.$Message.success(res.msg);
-          if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
-            this.pageIndex--;
+      this.$Modal.confirm({
+        title:'删除',
+        content:'确认删除嘛?',
+        onOk:()=>{
+          let order_number;
+          if (row) {
+            order_number = [row.order_number];
+          } else {
+            order_number = this.selectData.map(v => {
+              return v.order_number;
+            })
           }
-          this.selectData = [];
-          this.initData(this.proxyData);
+
+          this.axios.post('/api/materialReturnDel', { order_number }).then(res => {
+            if (res.code == 200) {
+              this.$Message.success(res.msg);
+              if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
+                this.pageIndex--;
+              }
+              this.selectData = [];
+              this.initData(this.proxyData);
+            }
+          })
         }
       })
+
     },
     handleSearch() {
       this.pageIndex = 1;
@@ -337,4 +344,4 @@ export default {
 .table_content {
   height: calc(100% - 250px);
 }
-</style>
+</style>

+ 113 - 0
src/views/BusinessManagement/Opening/detail.vue

@@ -0,0 +1,113 @@
+<template>
+  <div>
+    <Toptitle>
+      <template #right>
+        <Button
+            style="margin-right: 10px"
+            type="primary"
+            ghost
+            :disabled="status ? true : false"
+            @click="handleClick(14)"
+        >审核</Button
+        >
+        <Button
+            style="margin-right: 10px"
+            @click="$router.push('/cms/BusinessManagement/Opening/index')"
+        >返回</Button
+        >
+      </template>
+    </Toptitle>
+    <div class="content">
+      <div class="content_title">期初列表</div>
+        <div style="max-height: 430px; border: 1px solid #ffffff">
+          <vxe-grid v-bind="gridOptions"></vxe-grid>
+        </div>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      gridOptions: {
+        border: true,
+        resizable: true,
+        maxHeight: 'auto',
+        showOverflow: true,
+        align: 'left',
+        columns: [
+          { type: 'seq', width: 80, title: '序号', showHeaderOverflow: true },
+          { field: 'order_number', title: '订单编号', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'basic_roll_film_name', title: '卷膜分类', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'roll_film_code', title: '卷膜代码', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'roll_film_name', title: '卷膜型号', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'roll_film_number', title: '卷膜编号', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'storehouse_name', title: '仓库名称', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'crt_time', title: '创建时间', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'number', title: '米数', showHeaderOverflow: true, minWidth: 100 }
+        ],
+        data: [
+          { basic_roll_film_name: '', basic_roll_film_id: "", roll_film_id: '', roll_film_name: '', roll_film_number: '', book_number: '', inventory_number: '', loss_gain_number: '', inventory_loss_number: '', roll_film_number_arr: [], sub_id: 0 }
+        ]
+      },
+      menuList: [],
+      status:''
+    }
+  },
+  created() {
+    //获取列表
+    this.axios.post('/api/menuList').then(res => {
+      this.menuList = res.data;
+    })
+  },
+  mounted() {
+    this.initData();
+  },
+  methods: {
+    handleClick(e) {
+      let menu_id = this.menuList.find(v => v.uri == '/cms/BusinessManagement/Opening/index').id;
+      this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id }).then(res => {
+        if (res.code == 200) {
+          this.$Message.success(res.msg);
+          this.initData();
+        }
+      })
+    },
+    initData() {
+      this.axios.post('/api/openingReceiptDetail', { order_number: this.$route.query.order_number }).then(res => {
+        this.status = res.data[0]?res.data[0].status:1
+      this.gridOptions.data = res.data;
+      }
+      )
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.content {
+  height: calc(100% - 40px);
+  overflow: auto;
+  .content_title {
+    font-size: 26px;
+    letter-spacing: 20px;
+    font-weight: bold;
+    text-align: center;
+  }
+}
+.form {
+  display: flex;
+  flex-wrap: wrap;
+  .item {
+    width: 25%;
+  }
+}
+.bdy {
+  border: 1px solid #e2e2e2;
+  margin-top: 10px;
+  padding: 10px;
+}
+.box_title {
+  display: flex;
+  align-items: center;
+}
+</style>

+ 243 - 0
src/views/BusinessManagement/Opening/index.vue

@@ -0,0 +1,243 @@
+<template>
+  <div>
+    <Toptitle>
+      <template #left>
+        <Button type="primary" @click="is_open = !is_open">{{
+            is_open ? "收缩" : "展开"
+          }}</Button>
+      </template>
+      <template #right>
+        <Upload
+            style="display: inline"
+            name="file"
+            :show-upload-list="false"
+            :headers="headers"
+            :on-error="uploadError"
+            :on-success="uploadSuccess"
+            :action="$store.state.ip + '/api/openingReceiptImport'"
+        >
+          <Button type="primary">导入</Button>
+        </Upload>
+        <Button
+            type="success"
+            ghost
+            style="margin-left: 10px"
+            @click="handleLoadDown"
+        >下载导入文件</Button
+        >
+        <Dropdown style="margin-left: 10px" @on-click="handleClick">
+          <Button type="primary">
+            操作
+            <Icon type="ios-arrow-down"></Icon>
+          </Button>
+          <DropdownMenu slot="list">
+            <DropdownItem :name="2">批量删除</DropdownItem>
+          </DropdownMenu>
+        </Dropdown>
+      </template>
+    </Toptitle>
+    <div
+        :style="
+        is_open
+          ? 'max-height:200px;transition: all .5s;'
+          : 'max-height:0px;overflow: hidden;transition: all .5s;'
+      "
+    >
+      <Form :label-width="120" style="display: flex; flex-wrap: wrap">
+        <FormItem label="单据编号">
+          <Input
+              v-model="searchData.order_number"
+              clearable
+              style="width: 200px"
+              placeholder="请输入"
+          />
+        </FormItem>
+        <FormItem label="制单日期">
+          <DatePicker
+              v-model="searchData.crt_time"
+              clearable
+              type="daterange"
+              style="width: 200px"
+              placeholder="年/月/日"
+          />
+        </FormItem>
+
+        <FormItem :label-width="40">
+          <Button type="primary" @click="handleSearch">查询</Button>
+        </FormItem>
+      </Form>
+    </div>
+    <div class="table_content">
+      <vxe-grid
+          v-bind="gridOptions"
+          @checkbox-all="selectAllEvent"
+          @checkbox-change="selectChangeEvent"
+      >
+        <template #set="{ row }">
+          <a style="margin-right: 10px" @click="handleSet(3, row)">详情</a>
+          <a @click="handleDel(row)">删除</a>
+        </template>
+      </vxe-grid>
+    </div>
+
+    <Footer
+        :pageSize="pageSize"
+        :pageIndex="pageIndex"
+        :total="total"
+        @changeSize="changeSize"
+        @changePage="changePage"
+    ></Footer>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      is_open: false,
+      pageSize: 10,
+      pageIndex: 1,
+      total: 0,
+      sort: null,
+      is_show: false,
+      headers: { 'Authorization': localStorage.getItem('token') },
+      selectData: [],
+      searchData: {},
+      proxyData: {},
+      gridOptions: {
+        border: true,
+        resizable: true,
+        maxHeight: 'auto',
+        showOverflow: true,
+        align: 'left',
+        columns: [
+          { type: 'checkbox', width: 50, fixed: 'left' },
+          { field: 'set', title: '操作', showHeaderOverflow: true, slots: { default: 'set' }, fixed: 'left', width: 160, align: 'center' },
+          { field: 'crt_time', title: '制单日期', showHeaderOverflow: true, minWidth: 100, showOverflow: 'tooltip' },
+          { field: 'order_number', title: '单据编号', showHeaderOverflow: true, minWidth: 100, showOverflow: 'tooltip' },
+          { field: 'crt_name', title: '制单人', showHeaderOverflow: true, minWidth: 100 },
+          { field: 'status', title: '状态', showHeaderOverflow: true, minWidth: 100 }
+        ],
+        data: []
+      },
+    }
+  },
+  created() {},
+  mounted() {
+    this.initData();
+  },
+  methods: {
+    uploadError(err) {
+      this.$Message.error(err.msg || "上传失败");
+    },
+    uploadSuccess(res) {
+      if (res.code == 200) {
+        this.$Message.success(res.msg || "上传成功");
+        this.pageIndex = 1;
+        this.initData(this.proxyData);
+      } else {
+        this.$Message.warning(res.msg || "上传失败");
+      }
+    },
+    getArr(arr) {
+      let data = [];
+      arr.forEach(ele => {
+
+        if (ele.children.length != 0) {
+          data = [...data, ...this.getArr(ele.children)];
+        } else {
+          data.push(ele);
+        }
+      });
+      return data;
+    },
+    handleSet(num, row) {
+      switch (num) {
+        case 3://详情
+          this.$router.push({ path: '/cms/BusinessManagement/Opening/detail', query: { type: 3, title: '期初详情', order_number: row.order_number } })
+          break;
+      }
+    },
+    handleClick(name) {
+
+      if (name == 1) {//新增
+        this.handleSet(1)
+      } else if (name == 2) {//批量删除
+        if (this.selectData.length == 0) {
+          return this.$Message.warning('请选择数据!')
+        }
+        this.handleDel();
+      }
+    },
+    handleLoadDown() {
+
+      let url = `${this.$store.state.ip}//download/opening_receipt_import.xlsx`;
+      location.href = url;
+    },
+    selectAllEvent(e) {
+      this.selectData = e.records;
+
+    },
+    selectChangeEvent(e) {
+      this.selectData = e.records;
+
+    },
+
+    handleDel(row) {
+      this.$Modal.confirm({
+        title:'删除',
+        content:'确认删除嘛?',
+        onOk:()=>{
+          let order_number;
+          if (row) {
+            order_number = [row.order_number];
+          } else {
+            order_number = this.selectData.map(v => {
+              return v.order_number;
+            })
+          }
+
+          this.axios.post('/api/openingReceiptDel', { order_number }).then(res => {
+            if (res.code == 200) {
+              this.$Message.success(res.msg);
+              if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
+                this.pageIndex--;
+              }
+              this.selectData = [];
+              this.initData(this.proxyData);
+            }
+          })
+        }
+      })
+    },
+    handleSearch() {
+      this.pageIndex = 1;
+      this.proxyData = JSON.parse(JSON.stringify(this.searchData));
+      this.proxyData.crt_time = [this.proxyData.crt_time[0] ? Date.parse(this.proxyData.crt_time[0]).toString().slice(0, 10) : '', this.proxyData.crt_time[1] ? Date.parse(this.proxyData.crt_time[1]).toString().slice(0, 10) : '']
+      this.initData(this.proxyData);
+    },
+    initData(row) {
+      this.axios.post('/api/openingReceiptList', { ...row, page_size: this.pageSize, page_index: this.pageIndex }).then(res => {
+        this.gridOptions.data = res.data.data;
+        this.total = res.data.total;
+      })
+    },
+    changePage(e) {
+      this.pageIndex = e;
+      this.initData(this.proxyData);
+    },
+    changeSize(e) {
+      this.pageSize = e;
+      this.pageIndex = 1;
+      this.initData(this.proxyData);
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+.form_item {
+  margin-bottom: 15px !important;
+}
+.table_content {
+  height: calc(100% - 250px);
+}
+</style>

+ 172 - 8
src/views/BusinessManagement/Picking/detail.vue

@@ -116,6 +116,10 @@
             @click="handleClick(1)"
             >审核</Button
           >
+          <span v-show="oa_state_apply === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
+          <Button style="margin-right: 10px" size="small" type="success" ghost v-show="type != 1&&oa_state_apply==1&& formData.apply_status==1" @click="handlePassModal(1,'apply')">通过</Button>
+          <Button style="margin-right: 10px" size="small" type="error" ghost v-show="type != 1&&oa_state_apply==1&& formData.apply_status==1" @click="handlePassModal(0,'apply')">驳回</Button>
+          <Button type="warning" size="small" ghost v-show="type != 1 && formData.apply_status==1" @click="handleOaModal(241)">审核详情</Button>
         </div>
         <Form :label-width="80" class="form">
           <FormItem label="申领时间">
@@ -280,6 +284,10 @@
             @click="handleClick(2)"
             >审核</Button
           >
+          <span v-show="oa_state_send === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
+          <Button style="margin-right: 10px" size="small" type="success" ghost v-show="type != 1&&oa_state_send==1&& formData.send_status==1" @click="handlePassModal(1,'send')">通过</Button>
+          <Button style="margin-right: 10px" size="small" type="error" ghost v-show="type != 1&&oa_state_send==1&& formData.send_status==1" @click="handlePassModal(0,'send')">驳回</Button>
+          <Button type="warning" size="small" ghost v-show="type != 1 && formData.send_status==1" @click="handleOaModal(242)">审核详情</Button>
         </div>
         <Form :label-width="80" class="form">
           <FormItem label="发货时间">
@@ -422,6 +430,10 @@
             @click="handleClick(3)"
             >审核</Button
           >
+          <span v-show="oa_state_take === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
+          <Button style="margin-right: 10px" size="small" type="success" ghost v-show="type !=1&&oa_state_take==1&& formData.take_status==1" @click="handlePassModal(1,'take')">通过</Button>
+          <Button style="margin-right: 10px" size="small" type="error" ghost v-show="type != 1&&oa_state_take==1&& formData.take_status==1" @click="handlePassModal(0,'take')">驳回</Button>
+          <Button type="warning" size="small" ghost v-show="type != 1 && formData.take_status==1" @click="handleOaModal(243)">审核详情</Button>
         </div>
         <Form :label-width="80" class="form">
           <FormItem label="收货时间">
@@ -495,6 +507,10 @@
             @click="handleClick(4)"
             >审核</Button
           >
+          <span v-show="oa_state_in === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
+          <Button style="margin-right: 10px" size="small" type="success" ghost v-show="type != 1&&oa_state_in==1&& formData.in_status==1" @click="handlePassModal(1,'in')">通过</Button>
+          <Button style="margin-right: 10px" size="small" type="error" ghost v-show="type != 1&&oa_state_in==1&& formData.in_status==1" @click="handlePassModal(0,'in')">驳回</Button>
+          <Button type="warning" size="small" ghost v-show="type != 1 && formData.in_status==1" @click="handleOaModal(244)">审核详情</Button>
         </div>
         <Form :label-width="80" class="form">
           <FormItem label="入库时间">
@@ -557,12 +573,53 @@
         </Form> -->
       </div>
     </div>
+    <Modal v-model="is_oa" width="30" title="原因" :closable="false" :mask-closable="false">
+      <Form>
+        <FormItem :label-width="60" label="原因">
+          <Input clearable v-model="oa_remark" placeholder="请输入"/>
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button @click="is_oa = false" style="margin-right: 10px">取消</Button>
+        <Button type="primary" ghost @click="handlePass">确认</Button>
+      </div>
+    </Modal>
+    <Modal v-model="is_oaDetail" width="80" title="审核详情" :closable="false" :mask-closable="false">
+      <vxe-grid
+          v-bind="oaGridOptions"
+      >
+        <template #crt_time="{row}">
+          <span>{{func.replaceDateNoHMS(row.crt_time)}}</span>
+        </template>
+        <template #state="{row}">
+          <span>{{row.state==0?'未审核':row.state==1?'审核通过':'审核驳回'}}</span>
+        </template>
+      </vxe-grid>
+      <div slot="footer">
+        <Button @click="is_oaDetail = false" style="margin-right: 10px">取消</Button>
+      </div>
+    </Modal>
   </div>
 </template>
 <script>
 export default {
   data() {
     return {
+      oaGridOptions:{
+        border: true,
+        resizable: true,
+        showOverflow: true,
+        align: 'left',
+        columns: [
+          { field: 'sort', width: 80, title: '排序', showHeaderOverflow: true },
+          { field: 'crt_time', title: '时间', showHeaderOverflow: true, minWidth: 100, slots: { default: 'crt_time' } },
+          { field: 'state', title: '状态', showHeaderOverflow: true, minWidth: 100, slots: {default: 'state' } },
+          { field: 'remark', title: '原因', showHeaderOverflow: true, minWidth: 100 },
+        ],
+        data: [
+
+        ]
+      },
       gridOptions1: {
         border: true,
         resizable: true,
@@ -687,7 +744,21 @@ export default {
       areaList: [],
       menuList: [],
       basicRollFilmList: [],
-      companyList: []
+      companyList: [],
+      oa_state_apply:'',
+      oa_id_apply:'',
+      oa_state_send:'',
+      oa_id_send:'',
+      oa_state_take:'',
+      oa_id_take:'',
+      oa_state_in:'',
+      oa_id_in:'',
+      oa_remark:'',
+      is_o:true,
+      is_oa:false,
+      is_oaDetail:false,
+      oa_state_m:'',
+      is_which:''
     }
   },
   created() {
@@ -740,6 +811,41 @@ export default {
     }
   },
   methods: {
+    handleOaModal(e){
+      let menu_id = e;
+      this.axios.post('/api/oaOrderList',{menu_id,order_no:this.$route.query.order_number}).then(res=>{
+        this.oaGridOptions.data = res.data;
+        this.is_oaDetail = true;
+      })
+
+    },
+    handlePassModal(e,name){
+      this.oa_state_m  = e;
+      this.oa_remark = '';
+      this.is_oa = true;
+      this.is_which = name;
+    },
+    handlePass(){
+      if (this.is_o) {
+        this.is_o = false
+        let id = this.is_which === 'apply' ? this.oa_id_apply : this.is_which === 'send' ? this.oa_id_send : this.is_which === 'take' ? this.oa_id_take : this.oa_id_in
+        let data = {
+          id,
+          state:this.oa_state_m,
+          remark:this.oa_remark
+        }
+        this.axios.post('/api/oaCheck',data).then(res=>{
+          if(res.code === 200){
+            this.$Message.success(res.msg)
+            this.is_oa=false
+            this.initData()
+          }
+          setTimeout(()=>{
+            this.is_o = true
+          },2000)
+        })
+      }
+    },
     handleSelectCompany(e) {
       this.formData.four_shop_id = '';
       if (e) {
@@ -778,13 +884,35 @@ export default {
       this.gridOptions4.data.splice(index, 1);
     },
     handleClick(e) {
-      let menu_id = this.menuList.find(v => v.uri == '/cms/BusinessManagement/Picking/index').id;
-      this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id }).then(res => {
-        if (res.code == 200) {
-          this.$Message.success(res.msg);
-          this.initData();
-        }
-      })
+      if(e==1){
+        this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id:241 }).then(res => {
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.initData();
+          }
+        })
+      }else if(e==2){
+        this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id:242 }).then(res => {
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.initData();
+          }
+        })
+      }else if(e==3){
+        this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id:243 }).then(res => {
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.initData();
+          }
+        })
+      }else {
+        this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id:244 }).then(res => {
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.initData();
+          }
+        })
+      }
     },
     getArr(arr) {
       let data = [];
@@ -807,30 +935,58 @@ export default {
           this.gridOptions1.columns = [
             { type: 'seq', width: 80, title: '序号', showHeaderOverflow: true },
             { field: 'b_r_f_name', title: '卷膜分类', showHeaderOverflow: true, minWidth: 100 },
+            { field: 'code', title: '卷膜代码', showHeaderOverflow: true, minWidth: 100 },
             { field: 'title', title: '卷膜型号', showHeaderOverflow: true, minWidth: 100 },
             { field: 'apply_number', title: '申领数量', showHeaderOverflow: true, minWidth: 100 }, {field: 'mark',title:'备注',showHeaderOverflow: true,minWidth: 100}]
         }
+        if(res.data.apply_status==1){
+          this.axios.post('/api/oaOrderState',{menu_id:241,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state_apply = res.data.state;
+              this.oa_id_apply = res.data.id
+            }
+          })
+        }
         if (res.data.send_status != 0) {
           this.gridOptions2.columns = [
             { type: 'seq', width: 80, title: '序号', showHeaderOverflow: true },
             { field: 'b_r_f_name', title: '卷膜分类', showHeaderOverflow: true, minWidth: 100 },
+            { field: 'code', title: '卷膜代码', showHeaderOverflow: true, minWidth: 100 },
             { field: 'title', title: '卷膜型号', showHeaderOverflow: true, minWidth: 100 },
             { field: 'roll_film_number', title: '卷膜编号', showHeaderOverflow: true, minWidth: 100 },
             { field: 'apply_number', title: '申领数量', showHeaderOverflow: true, minWidth: 100 },
             { field: 'send_number', title: '发货数量', showHeaderOverflow: true, minWidth: 100 }, {field: 'mark',title:'备注',showHeaderOverflow: true,minWidth: 100}]
         }
+        if(res.data.send_status==1){
+          this.axios.post('/api/oaOrderState',{menu_id:242,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state_send = res.data.state;
+              this.oa_id_send = res.data.id
+            }
+          })
+        }
         if (res.data.take_status != 0) {
           this.gridOptions3.columns = [{ field: 'b_r_f_name', title: '卷膜分类', showHeaderOverflow: true, minWidth: 100 },
+            { field: 'code', title: '卷膜代码', showHeaderOverflow: true, minWidth: 100 },
           { field: 'title', title: '卷膜型号', showHeaderOverflow: true, minWidth: 100 },
           { field: 'roll_film_number', title: '卷膜编号', showHeaderOverflow: true, minWidth: 100 },
           { field: 'apply_number', title: '申领数量', showHeaderOverflow: true, minWidth: 100 },
           { field: 'send_number', title: '发货数量', showHeaderOverflow: true, minWidth: 100 },
           { field: 'take_number', title: '收货数量', showHeaderOverflow: true, minWidth: 100 }, {field: 'mark',title:'备注',showHeaderOverflow: true,minWidth: 100}]
         }
+        if(res.data.take_status==1){
+          this.axios.post('/api/oaOrderState',{menu_id:243,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state_take = res.data.state;
+              this.oa_id_take = res.data.id
+            }
+          })
+        }
         if (res.data.in_status != 0) {
           this.gridOptions4.columns = [
             { type: 'seq', width: 80, title: '序号', showHeaderOverflow: true },
             { field: 'b_r_f_name', title: '卷膜分类', showHeaderOverflow: true, minWidth: 100 },
+            { field: 'code', title: '卷膜代码', showHeaderOverflow: true, minWidth: 100 },
             { field: 'title', title: '卷膜型号', showHeaderOverflow: true, minWidth: 100 },
             { field: 'roll_film_number', title: '卷膜编号', showHeaderOverflow: true, minWidth: 100 },
             { field: 'apply_number', title: '申领数量', showHeaderOverflow: true, minWidth: 100 },
@@ -840,6 +996,14 @@ export default {
             {field: 'mark',title:'备注',showHeaderOverflow: true,minWidth: 100}
           ]
         }
+        if(res.data.in_status==1){
+          this.axios.post('/api/oaOrderState',{menu_id:244,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state_in = res.data.state;
+              this.oa_id_in = res.data.id
+            }
+          })
+        }
         this.gridOptions1.data.forEach(v => {
           v.id = v.roll_film_id;
           v.disable = true;

+ 24 - 17
src/views/BusinessManagement/Picking/index.vue

@@ -192,25 +192,32 @@ export default {
     },
 
     handleDel(row) {
-      let order_number;
-      if (row) {
-        order_number = [row.order_number];
-      } else {
-        order_number = this.selectData.map(v => {
-          return v.order_number;
-        })
-      }
-
-      this.axios.post('/api/materialOrderDel', { order_number }).then(res => {
-        if (res.code == 200) {
-          this.$Message.success(res.msg);
-          if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
-            this.pageIndex--;
+      this.$Modal.confirm({
+        title:'删除',
+        content:'确认删除嘛?',
+        onOk:()=>{
+          let order_number;
+          if (row) {
+            order_number = [row.order_number];
+          } else {
+            order_number = this.selectData.map(v => {
+              return v.order_number;
+            })
           }
-          this.selectData = [];
-          this.initData(this.proxyData);
+
+          this.axios.post('/api/materialOrderDel', { order_number }).then(res => {
+            if (res.code == 200) {
+              this.$Message.success(res.msg);
+              if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
+                this.pageIndex--;
+              }
+              this.selectData = [];
+              this.initData(this.proxyData);
+            }
+          })
         }
       })
+
     },
     handleSearch() {
       this.pageIndex = 1;
@@ -243,4 +250,4 @@ export default {
 .table_content {
   height: calc(100% - 150px);
 }
-</style>
+</style>

+ 177 - 26
src/views/BusinessManagement/TransferOrder/detail.vue

@@ -27,14 +27,14 @@
             disabled
           />
         </FormItem>
-        <FormItem label="制单日期" class="item">
-          <DatePicker
-            style="width: 100%"
-            v-model="formData.crt_time"
-            placeholder="年/月/日"
-            type="date"
-          />
-        </FormItem>
+<!--        <FormItem label="制单日期" class="item">-->
+<!--          <DatePicker-->
+<!--            style="width: 100%"-->
+<!--            v-model="formData.crt_time"-->
+<!--            placeholder="年/月/日"-->
+<!--            type="date"-->
+<!--          />-->
+<!--        </FormItem>-->
         <FormItem label="调拨人" class="item">
           <Select clearable filterable transfer v-model="formData.transfer_id">
             <Option
@@ -114,6 +114,10 @@
             @click="handleClick(7)"
             >审核</Button
           >
+          <span v-show="oa_state === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
+          <Button style="margin-right: 10px" size="small" type="success" ghost v-show="type != 1&&oa_state==1&& formData.status==1" @click="handlePassModal(1,'status')">通过</Button>
+          <Button style="margin-right: 10px" size="small" type="error" ghost v-show="type != 1&&oa_state==1&& formData.status==1" @click="handlePassModal(0,'status')">驳回</Button>
+          <Button type="warning" size="small" ghost v-show="type != 1 && formData.status==1" @click="handleOaModal(246)">审核详情</Button>
         </div>
         <vxe-grid v-bind="gridOptions1">
           <template #set="{ row, rowIndex }">
@@ -162,8 +166,8 @@
               />
             </Select>
           </template>
-          <template #number="{ row }">
-            <Input clearable v-model="row.number" placeholder="请输入" />
+          <template #number="{ row,rowIndex }">
+            <Input clearable v-model="row.number" placeholder="请输入" @on-blur="handleChangeNumber( row, rowIndex)"/>
           </template>
         </vxe-grid>
       </div>
@@ -180,6 +184,10 @@
             @click="handleClick(8)"
             >审核</Button
           >
+          <span v-show="oa_state_out === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
+          <Button style="margin-right: 10px" size="small" type="success" ghost v-show="type != 1&&oa_state_out==1&& formData.out_status==1" @click="handlePassModal(1,'out')">通过</Button>
+          <Button style="margin-right: 10px" size="small" type="error" ghost v-show="type != 1&&oa_state_out==1&& formData.out_status==1" @click="handlePassModal(0,'out')">驳回</Button>
+          <Button type="warning" size="small" ghost v-show="type != 1 && formData.out_status==1" @click="handleOaModal(248)">审核详情</Button>
         </div>
         <vxe-grid v-bind="gridOptions2">
           <template #number="{ row }">
@@ -200,6 +208,10 @@
             @click="handleClick(9)"
             >审核</Button
           >
+          <span v-show="oa_state_in === 0" style="color:#22a92c;height: 30px;line-height: 30px;margin-right: 10px;font-size: 16px">审核中...</span>
+          <Button style="margin-right: 10px" size="small" type="success" ghost v-show="type != 1&&oa_state_in==1&& formData.in_status==1" @click="handlePassModal(1,'in')">通过</Button>
+          <Button style="margin-right: 10px" size="small" type="error" ghost v-show="type != 1&&oa_state_in==1&& formData.in_status==1" @click="handlePassModal(0,'in')">驳回</Button>
+          <Button type="warning" size="small" ghost v-show="type != 1 && formData.in_status==1" @click="handleOaModal(247)">审核详情</Button>
         </div>
         <vxe-grid v-bind="gridOptions3">
           <template #number="{ row }">
@@ -208,16 +220,57 @@
         </vxe-grid>
       </div>
     </div>
+    <Modal v-model="is_oa" width="30" title="原因" :closable="false" :mask-closable="false">
+      <Form>
+        <FormItem :label-width="60" label="原因">
+          <Input clearable v-model="oa_remark" placeholder="请输入"/>
+        </FormItem>
+      </Form>
+      <div slot="footer">
+        <Button @click="is_oa = false" style="margin-right: 10px">取消</Button>
+        <Button type="primary" ghost @click="handlePass">确认</Button>
+      </div>
+    </Modal>
+    <Modal v-model="is_oaDetail" width="80" title="审核详情" :closable="false" :mask-closable="false">
+      <vxe-grid
+          v-bind="oaGridOptions"
+      >
+        <template #crt_time="{row}">
+          <span>{{func.replaceDateNoHMS(row.crt_time)}}</span>
+        </template>
+        <template #state="{row}">
+          <span>{{row.state==0?'未审核':row.state==1?'审核通过':'审核驳回'}}</span>
+        </template>
+      </vxe-grid>
+      <div slot="footer">
+        <Button @click="is_oaDetail = false" style="margin-right: 10px">取消</Button>
+      </div>
+    </Modal>
   </div>
 </template>
 <script>
 export default {
   data() {
     return {
+      oaGridOptions:{
+        border: true,
+        resizable: true,
+        showOverflow: true,
+        align: 'left',
+        columns: [
+          { field: 'sort', width: 80, title: '排序', showHeaderOverflow: true },
+          { field: 'crt_time', title: '时间', showHeaderOverflow: true, minWidth: 100, slots: { default: 'crt_time' } },
+          { field: 'state', title: '状态', showHeaderOverflow: true, minWidth: 100, slots: {default: 'state' } },
+          { field: 'remark', title: '原因', showHeaderOverflow: true, minWidth: 100 },
+        ],
+        data: [
+
+        ]
+      },
       companyList: [],
       type: '',
       formData: {
-        crt_time: new Date()
+        // crt_time: new Date()
       },
       employeeList: [],
       gridOptions1: {
@@ -286,7 +339,19 @@ export default {
       },
       rollFilmList: [],
       storehouseList: [],
-      menuList: []
+      menuList: [],
+      oa_state_in:'',
+      oa_id_in:'',
+      oa_state_out:'',
+      oa_id_out:'',
+      oa_state:"",
+      oa_id:'',
+      oa_remark:'',
+      is_o:true,
+      is_oa:false,
+      is_oaDetail:false,
+      oa_state_m:'',
+      is_which:''
     }
   },
   created() {
@@ -310,6 +375,40 @@ export default {
     }
   },
   methods: {
+    handleOaModal(e){
+      let menu_id = e;
+      this.axios.post('/api/oaOrderList',{menu_id,order_no:this.$route.query.order_number}).then(res=>{
+        this.oaGridOptions.data = res.data;
+        this.is_oaDetail = true;
+      })
+    },
+    handlePassModal(e,name){
+      this.oa_state_m  = e;
+      this.oa_remark = '';
+      this.is_oa = true;
+      this.is_which = name;
+    },
+    handlePass(){
+      if (this.is_o) {
+        this.is_o = false
+        let id = this.is_which === 'status' ? this.oa_id : this.is_which === 'out' ? this.oa_id_out : this.oa_id_in
+        let data = {
+          id,
+          state:this.oa_state_m,
+          remark:this.oa_remark
+        }
+        this.axios.post('/api/oaCheck',data).then(res=>{
+          if(res.code === 200){
+            this.$Message.success(res.msg)
+            this.is_oa=false
+            this.initData()
+          }
+          setTimeout(()=>{
+            this.is_o = true
+          },2000)
+        })
+      }
+    },
     handleSelectCompany(e) {
       this.formData.to_storehouse_id = '';
       this.formData.from_storehouse_id = '';
@@ -323,19 +422,37 @@ export default {
 
     },
     handleClick(e) {
-      let menu_id = this.menuList.find(v => v.uri == '/cms/BusinessManagement/TransferOrder/index').id;
-      this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id }).then(res => {
-        if (res.code == 200) {
-          this.$Message.success(res.msg);
-          this.initData();
-        }
-      })
+      if(e==7){
+
+        this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id: 246}).then(res => {
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.initData();
+          }
+        })
+      }else if(e==8){
+
+        this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id:248 }).then(res => {
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.initData();
+          }
+        })
+      }else{
+
+        this.axios.post('/api/checkAll', { order_number: this.$route.query.order_number, opt_case: e, menu_id:247 }).then(res => {
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.initData();
+          }
+        })
+      }
     },
     handleSelectStore(e) {
       if (e) {
         //获取卷膜型号
-        this.axios.post('/api/rollFilmList', { storehouse_id: e }).then(res => {
-          this.rollFilmList = res.data.data;
+        this.axios.post('/api/getRollFilmEffectiveList', { storehouse_id: e }).then(res => {
+          this.rollFilmList = res.data;
         })
       }
       this.gridOptions1.data = [{ basic_roll_film_name: '', roll_film_name: '', roll_film_number: '', roll_film_id: '', number: '', basic_roll_film_id: '' }];
@@ -344,11 +461,14 @@ export default {
     },
     initData() {
       this.axios.post('/api/transferDetail', { order_number: this.$route.query.order_number }).then(res => {
-        res.data.crt_time = this.func.replaceDateNoHMS(res.data.crt_time);
+        // res.data.crt_time = this.func.replaceDateNoHMS(res.data.crt_time);
         this.formData = JSON.parse(JSON.stringify(res.data));
         delete this.formData.sub;
         delete this.formData.out;
         delete this.formData.in;
+        this.axios.post('/api/companyAndStoreHouse',{id:this.formData.company_id}).then(res=>{
+          this.storehouseList = res.data;
+        })
         if (res.data.status != 0) {
           this.gridOptions1.columns = [
             { type: 'seq', width: 80, title: '序号', showHeaderOverflow: true },
@@ -358,6 +478,14 @@ export default {
             { field: 'number', title: '调拨数量', showHeaderOverflow: true, minWidth: 100 },
           ]
         }
+        if(res.data.status==1){
+          this.axios.post('/api/oaOrderState',{menu_id:246,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state = res.data.state;
+              this.oa_id = res.data.id
+            }
+          })
+        }
         if (res.data.out_status != 0) {
           this.gridOptions2.columns = [
             { type: 'seq', width: 80, title: '序号', showHeaderOverflow: true },
@@ -367,6 +495,14 @@ export default {
             { field: 'number', title: '调拨出库数量', showHeaderOverflow: true, minWidth: 100 },
           ]
         }
+        if(res.data.out_status==1){
+          this.axios.post('/api/oaOrderState',{menu_id:248,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state_out = res.data.state;
+              this.oa_id_out = res.data.id
+            }
+          })
+        }
         if (res.data.in_status != 0) {
           this.gridOptions3.columns = [
             { type: 'seq', width: 80, title: '序号', showHeaderOverflow: true },
@@ -376,12 +512,20 @@ export default {
             { field: 'number', title: '调拨入库数量', showHeaderOverflow: true, minWidth: 100 },
           ]
         }
+        if(res.data.in_status==1){
+          this.axios.post('/api/oaOrderState',{menu_id:247,order_no:this.$route.query.order_number}).then(res=>{
+            if (res.code === 200) {
+              this.oa_state_in = res.data.state;
+              this.oa_id_in = res.data.id
+            }
+          })
+        }
         this.gridOptions1.data = JSON.parse(JSON.stringify(res.data.sub));
         this.gridOptions2.data = res.data.out;
         this.gridOptions3.data = res.data.in;
         //获取卷膜型号
-        this.axios.post('/api/rollFilmList', { storehouse_id: this.formData.from_storehouse_id }).then(req => {
-          this.rollFilmList = req.data.data;
+        this.axios.post('/api/getRollFilmEffectiveList', { storehouse_id: this.formData.from_storehouse_id }).then(req => {
+          this.rollFilmList = req.data;
           this.gridOptions1.data.forEach(v => {
             v.roll_film_number_arr = this.rollFilmList.find(c => c.id == v.roll_film_id).roll_film_number_arr;
           })
@@ -402,7 +546,7 @@ export default {
     },
     handleSave() {
       let data = JSON.parse(JSON.stringify(this.formData));
-      data.crt_time = data.crt_time ? Date.parse(data.crt_time).toString().slice(0, 10) : '';
+      // data.crt_time = data.crt_time ? Date.parse(data.crt_time).toString().slice(0, 10) : '';
       data.sub = JSON.parse(JSON.stringify(this.gridOptions1.data));
       data.out = JSON.parse(JSON.stringify(this.gridOptions2.data));
       data.in = JSON.parse(JSON.stringify(this.gridOptions3.data));
@@ -422,11 +566,18 @@ export default {
         })
       }
     },
+    handleChangeNumber(row, index){
+      this.gridOptions2.data[index] && (this.gridOptions2.data[index].number = row.number);
+      this.gridOptions3.data[index] && (this.gridOptions3.data[index].number = row.number);
+    },
     handleChangeRollFilm(e, row, index) {
       if (this.gridOptions1.data.filter(v => v.roll_film_id == row.roll_film_id).filter(v => v.roll_film_number == e).length == 2) {
         row.roll_film_number = '';
         return this.$Message.warning('相同卷膜型号的卷膜编号不能重复!');
       }
+     this.gridOptions1.data[index].number = row.roll_film_number_arr.find(v=>v.roll_film_number === e).number;
+      this.gridOptions2.data[index] && (this.gridOptions2.data[index].number = this.gridOptions1.data[index].number);
+      this.gridOptions3.data[index] && (this.gridOptions3.data[index].number = this.gridOptions1.data[index].number);
       this.gridOptions2.data[index] && (this.gridOptions2.data[index].roll_film_number = row.roll_film_number);
       this.gridOptions3.data[index] && (this.gridOptions3.data[index].roll_film_number = row.roll_film_number);
     },
@@ -492,4 +643,4 @@ export default {
     align-items: center;
   }
 }
-</style>
+</style>

+ 23 - 17
src/views/BusinessManagement/TransferOrder/index.vue

@@ -226,23 +226,29 @@ export default {
     },
 
     handleDel(row) {
-      let order_number;
-      if (row) {
-        order_number = [row.order_number];
-      } else {
-        order_number = this.selectData.map(v => {
-          return v.order_number;
-        })
-      }
-
-      this.axios.post('/api/transferDel', { order_number }).then(res => {
-        if (res.code == 200) {
-          this.$Message.success(res.msg);
-          if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
-            this.pageIndex--;
+      this.$Modal.confirm({
+        title:'删除',
+        content:'确认删除嘛?',
+        onOk:()=>{
+          let order_number;
+          if (row) {
+            order_number = [row.order_number];
+          } else {
+            order_number = this.selectData.map(v => {
+              return v.order_number;
+            })
           }
-          this.selectData = [];
-          this.initData(this.proxyData);
+
+          this.axios.post('/api/transferDel', { order_number }).then(res => {
+            if (res.code == 200) {
+              this.$Message.success(res.msg);
+              if ((this.gridOptions.data.length - order_number.length) == 0 && this.pageIndex != 1) {
+                this.pageIndex--;
+              }
+              this.selectData = [];
+              this.initData(this.proxyData);
+            }
+          })
         }
       })
     },
@@ -277,4 +283,4 @@ export default {
 .table_content {
   height: calc(100% - 250px);
 }
-</style>
+</style>

Різницю між файлами не показано, бо вона завелика
+ 385 - 431
src/views/BusinessManagement/warranty/detail.vue


+ 1 - 1
vue.config.js

@@ -1,7 +1,7 @@
 const axios_default_ip =
   process.env.NODE_ENV == "dev"
     ? "https://zhapi.qingyaokeji.com"//jiufang2.1
-    // http://192.168.0.125:8080
+   // ? "http://192.168.0.126:8078"
     : process.env.NODE_ENV == "test-prd"
       ? "https://zhapi.qingyaokeji.com" //
       : process.env.NODE_ENV == "prd_other"

Деякі файли не було показано, через те що забагато файлів було змінено