1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-72e66010"],{2787:function(t,e,a){"use strict";a("6365")},"2c15":function(t,e,a){},3181:function(t,e,a){"use strict";a("2c15")},"424e":function(t,e,a){"use strict";a.d(e,"k",(function(){return r})),a.d(e,"m",(function(){return o})),a.d(e,"e",(function(){return i})),a.d(e,"r",(function(){return u})),a.d(e,"a",(function(){return l})),a.d(e,"i",(function(){return c})),a.d(e,"c",(function(){return s})),a.d(e,"n",(function(){return d})),a.d(e,"b",(function(){return p})),a.d(e,"s",(function(){return m})),a.d(e,"h",(function(){return f})),a.d(e,"d",(function(){return b})),a.d(e,"o",(function(){return h})),a.d(e,"p",(function(){return g})),a.d(e,"g",(function(){return v})),a.d(e,"j",(function(){return y})),a.d(e,"q",(function(){return _})),a.d(e,"l",(function(){return O})),a.d(e,"f",(function(){return j}));var n=a("b775");function r(t){return Object(n["a"])({url:"/document/pageDocument",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/document/search",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/document/export",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/document/update",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/document/create",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/document/info",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/document/delete",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/document/category/search",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/document/category/create",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/document/category/update",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/document/category/info",method:"post",data:t})}function b(t){return Object(n["a"])({url:"/document/category/delete",method:"post",data:t})}function h(t){return Object(n["a"])({url:"/template/searchList",method:"post",data:t})}function g(t){return Object(n["a"])({url:"/document/searchlistDoc",method:"post",data:t})}function v(t){return Object(n["a"])({url:"document/exportToPDF",method:"post",data:t})}function y(t){return Object(n["a"])({url:"/document/htmlWordNew",method:"post",data:t})}function _(t){return Object(n["a"])({url:"/document/searchlistDocTemplate",method:"post",data:t})}function O(t){return Object(n["a"])({url:"/document/content/query",method:"get",params:t})}function j(t){return Object(n["a"])({url:"/document/content/export_qa_to_excel/",method:"post",data:t,headers:{"Content-Type":"application/json"}})}},"4d636":function(t,e,a){"use strict";a("a984")},6365:function(t,e,a){},"6ee3":function(t,e,a){"use strict";a("ffb9")},"8bbf":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"project-search"},[a("dataSearch",{on:{bindSetQuery:t.setQuery}}),a("dataList",{attrs:{queryForm:t.queryForm}})],1)},r=[],o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-search"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.queryForm}},[a("el-form-item",{attrs:{label:"产品名称:"}},[a("el-input",{attrs:{placeholder:"请选择产品名称"},model:{value:t.queryForm.name,callback:function(e){t.$set(t.queryForm,"name",e)},expression:"queryForm.name"}})],1),a("el-form-item",{attrs:{label:"产品分类:"}},[a("el-cascader",{attrs:{options:t.allCategories,"show-all-levels":!1},model:{value:t.queryForm.category_id,callback:function(e){t.$set(t.queryForm,"category_id",e)},expression:"queryForm.category_id"}})],1),a("el-form-item",{attrs:{label:"品牌:"}},[a("el-select",{staticClass:"m-2",attrs:{placeholder:"请选择",size:"large"},model:{value:t.queryForm.brand_id,callback:function(e){t.$set(t.queryForm,"brand_id",e)},expression:"queryForm.brand_id"}},t._l(t.brandList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),a("el-form-item",{attrs:{label:"供应商:"}},[a("el-select",{staticClass:"m-2",attrs:{placeholder:"请选择",size:"large"},model:{value:t.queryForm.supplier_id,callback:function(e){t.$set(t.queryForm,"supplier_id",e)},expression:"queryForm.supplier_id"}},t._l(t.supplierList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),a("el-form-item",{attrs:{label:"套餐商品:"}},[a("el-select",{staticClass:"m-2",attrs:{placeholder:"请选择",size:"large"},model:{value:t.queryForm.is_package,callback:function(e){t.$set(t.queryForm,"is_package",e)},expression:"queryForm.is_package"}},t._l(t.packageList,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{label:"状态:"}},[a("el-select",{staticClass:"m-2",attrs:{placeholder:"请选择状态",size:"large"},model:{value:t.queryForm.status,callback:function(e){t.$set(t.queryForm,"status",e)},expression:"queryForm.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.onSubmit}},[a("svg-icon",{attrs:{"icon-class":"search"}}),t._v(" 搜索")],1),a("el-button",{attrs:{type:"success"},on:{click:t.onCreate}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v(" 创建产品")],1)],1)],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"",width:"60%","custom-class":"prod-verify",title:"创建产品"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("dataInfo",{on:{onClose:t.onClose}})],1)],1)},i=[],u=a("2909"),l=(a("99af"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-info"},[a("el-form",{attrs:{model:t.dataForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"产品名称:"}},[a("el-input",{staticClass:"w_input",model:{value:t.dataForm.name,callback:function(e){t.$set(t.dataForm,"name",e)},expression:"dataForm.name"}})],1),a("el-form-item",{attrs:{label:"所属分类:"}},[a("el-cascader",{staticClass:"w_input",attrs:{options:t.allCategories,props:t.props,"show-all-levels":!1},on:{change:t.onChangeCategory},model:{value:t.category,callback:function(e){t.category=e},expression:"category"}})],1),a("el-form-item",{attrs:{label:"所属品牌:"}},[a("el-select",{staticClass:"w_input",attrs:{placeholder:"请选择品牌",size:"large"},model:{value:t.dataForm.brand_id,callback:function(e){t.$set(t.dataForm,"brand_id",e)},expression:"dataForm.brand_id"}},t._l(t.brandList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),a("el-form-item",{attrs:{label:"所属供应商:"}},[a("el-select",{staticClass:"w_input",attrs:{placeholder:"请选择供应商",size:"large"},model:{value:t.dataForm.supplier_id,callback:function(e){t.$set(t.dataForm,"supplier_id",e)},expression:"dataForm.supplier_id"}},t._l(t.supplierList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),a("el-form-item",{attrs:{label:"产品状态:"}},[a("el-select",{staticClass:"w_input",attrs:{placeholder:"请选择状态",size:"large"},on:{change:t.onChangeStatus},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{label:"市场价格:"}},[a("el-input",{staticClass:"w_input",model:{value:t.dataForm.price,callback:function(e){t.$set(t.dataForm,"price",e)},expression:"dataForm.price"}})],1),a("el-form-item",{attrs:{label:"产地:"}},[a("el-input",{staticClass:"w_input",model:{value:t.dataForm.product_area,callback:function(e){t.$set(t.dataForm,"product_area",e)},expression:"dataForm.product_area"}})],1)],1),a("div",{staticStyle:{"text-align":"right","margin-top":"20px"}},[a("el-button",{attrs:{type:"warning"},on:{click:t.btnSave}},[t._v("确认保存")])],1)],1)}),c=[],s=(a("4de4"),a("b0c0"),a("e9c4"),a("a9e3"),a("b64b"),a("d3b7"),a("8256")),d=a("c4c8"),p=a("9add"),m=a("a6b9"),f=(a("424e"),a("6fe4")),b={components:{Tinymce:s["default"],ProductAttrItem:f["default"]},emits:["onClose"],props:{id:{type:Number,default:0}},watch:{id:{handler:function(t){var e=this;null==t||t<=0||e.getInfo(t)},immediate:!0,deep:!0}},data:function(){return{activeName:"base",currentCategory:[],allCategories:[],brandList:[],supplierList:[],category:[],documentList:[],dataForm:{id:0,name:"",price:"",product_area:"",category_id:"",brand_id:"",supplier_id:"",is_package:"否",package_intro:"无",is_safe:"否",safe_time:"无",intro:"",qualifications:"",attrs:[]},extAttrs:[{name:"属性1",type:1,value:"",valueItems:""}],packageList:[{value:"",label:"请选择"},{value:"是",label:"是"},{value:"否",label:"否"}],safeTime:[{value:"",label:"请选择"},{value:"一年",label:"一年"},{value:"两年",label:"两年"}],statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"使用中"},{value:6,label:"已停用"}],cateAttr:[],props:{value:"id",label:"label",children:"children",checkStrictly:!0}}},mounted:function(){this.initBrand(),this.initSupplier(),this.initCategories()},methods:{onSetAttr:function(t){this.dataForm.attrs=t},btnSave:function(t){var e=this;e.category.length>=1&&(e.dataForm.category_id=e.category[0]),e.dataForm.attrs=JSON.stringify(this.extAttrs),e.dataForm.links=JSON.stringify(this.dataForm.linkDocument),e.dataForm.id>0?Object(d["j"])(e.dataForm).then((function(t){200==t.status&&(e.$message.success("产品信息更新成功"),e.$emit("onClose",!0))})):Object(d["a"])(e.dataForm).then((function(t){200==t.status&&(e.$message.success("产品信息创建成功"),e.$emit("onClose",!0))}))},getInfo:function(t){var e=this,a={id:t};Object(d["f"])(a).then((function(t){t&&200==t.status&&(e.dataForm=t.data,e.extAttrs=JSON.parse(t.data.attrs),e.extAttrs.length<=0&&(e.extAttrs=[{name:"属性1",type:1,value:"",valueItems:""}]),e.category=[t.data.category.parent_id,t.data.category.id])}))},onChangeStatus:function(t){this.dataForm.status=t},onChangeCategory:function(t){var e=this;console.log(t);var a=e.allCategories.filter((function(e){return e.id==t[0]})),n=a[0].children.filter((function(e){return e.id==t[1]}));if(n.length>0){e.cateAttr=JSON.parse(n[0].attrs),e.extAttrs=[];for(var r=0;r<e.cateAttr.length;r++)e.extAttrs.push({name:e.cateAttr[r].name,type:1,value:"",valueItems:""});console.log(e.extAttrs)}},initCategories:function(){var t=this;Object(d["g"])().then((function(e){200==e.status&&(t.allCategories=e.data)}))},initSupplier:function(){var t=this;Object(m["d"])({page:1,pageSize:999,status:5}).then((function(e){200==e.status&&(t.supplierList=[{id:0,name:"请选择"}].concat(Object(u["a"])(e.data.dataList)))}))},initBrand:function(){var t=this;Object(p["d"])({page:1,pageSize:999,status:5}).then((function(e){200==e.status&&(t.brandList=[{id:0,name:"请选择"}].concat(Object(u["a"])(e.data.dataList)))}))}}},h=b,g=(a("4d636"),a("2877")),v=Object(g["a"])(h,l,c,!1,null,null,null),y=v.exports,_=a("a888"),O={components:{dataInfo:y},directives:{elDragDialog:_["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,name:"",category_id:"",brand_id:"",supplier_id:"",is_package:"",status:""}}}},data:function(){return{statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"使用中"},{value:6,label:"已停用"}],packageList:[{value:"",label:"请选择"},{value:"是",label:"是"},{value:"否",label:"否"}],supplierList:[],brandList:[],allCategories:[],dialogVisible:!1}},created:function(){this.initBrand(),this.initSupplier(),this.initCategories()},methods:{onCreate:function(t){this.dialogVisible=!0},onClose:function(t){this.dialogVisible=!1,this.$emit("bindSetQuery",this.$props.queryForm)},initCategories:function(){var t=this;Object(d["g"])().then((function(e){200==e.status&&(console.log("searchAllCategories",e),t.allCategories=e.data)}))},initSupplier:function(){var t=this;Object(m["d"])({page:1,pageSize:999,status:5}).then((function(e){200==e.status&&(t.supplierList=[{id:0,name:"请选择"}].concat(Object(u["a"])(e.data.dataList)))}))},initBrand:function(){var t=this;Object(p["d"])({page:1,pageSize:999,status:5}).then((function(e){200==e.status&&(t.brandList=[{id:0,name:"请选择"}].concat(Object(u["a"])(e.data.dataList)))}))},onSubmit:function(){this.$emit("bindSetQuery",this.$props.queryForm)}}},j=O,F=(a("6ee3"),Object(g["a"])(j,o,i,!1,null,null,null)),C=F.exports,k=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-list"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.dataList,"header-row-class-name":"headerBg","empty-text":"没有项目信息"}},[a("el-table-column",{attrs:{prop:"id",label:"ID",align:"center",width:"80"}}),a("el-table-column",{attrs:{prop:"name",label:"产品名称",align:"left","min-width":"180"}}),a("el-table-column",{attrs:{prop:"brand.name",label:"品牌",align:"center","min-width":"180"}}),a("el-table-column",{attrs:{prop:"supplier.name",label:"供应商",align:"center","min-width":"180"}}),a("el-table-column",{attrs:{prop:"price",label:"价格",align:"center","min-width":"180"}}),a("el-table-column",{attrs:{prop:"product_area",label:"产地",align:"center","min-width":"180"}}),a("el-table-column",{attrs:{prop:"category.name",label:"分类",align:"center","min-width":"180"}}),a("el-table-column",{attrs:{prop:"createTime",label:"创建时间",align:"center",width:"180"}}),a("el-table-column",{attrs:{prop:"status",label:"分类状态",align:"center",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[5==e.row.status?a("div",[t._v("已使用")]):t._e(),6==e.row.status?a("div",[t._v("已停用")]):t._e()]}}])}),a("el-table-column",{attrs:{label:"操作",fixed:"right",align:"center",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"btns"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(a){return t.btnEdit(e.row)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v("编辑")],1),a("el-button",{attrs:{type:"danger",size:"small"},on:{click:function(a){return t.btnDelete(e.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"delete"}}),t._v("删除")],1)],1)]}}])})],1),a("div",{staticClass:"page-info"},[a("el-pagination",{attrs:{currentPage:t.queryForm.page,"page-size":t.queryForm.pageSize,total:t.recordCount,"page-count":t.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":t.ChangePage}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"",width:"50%","custom-class":"prod-verify",title:"创建产品信息"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("dataInfo",{attrs:{id:t.currentDataId},on:{onClose:t.onClose}})],1)],1)},w=[],x=(a("ac1f"),a("841c"),{components:{dataInfo:y},directives:{elDragDialog:_["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,name:"",category_id:"",brand_id:"",supplier_id:"",is_package:"",status:""}}}},watch:{queryForm:{handler:function(t){this.search()},immediate:!0,deep:!0}},data:function(){return{dialogVisible:!1,currentDataId:0,recordCount:0,pageTotal:1,dataList:[],currentData:{}}},mounted:function(){this.search()},methods:{searchData:function(){var t=this;t.dialogVisible=!1,t.search()},btnDelete:function(t){var e=this,a={id:t};e.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(t){Object(d["c"])(a).then((function(t){e.search()}))})).catch((function(){}))},btnEdit:function(t){var e=this;e.currentDataId=t.id,e.dialogVisible=!0},onClose:function(t){var e=this;e.currentDataId=0,e.dialogVisible=!1,t&&e.search()},search:function(){var t=this;Object(d["h"])(t.queryForm).then((function(e){e&&(t.dataList=e.data.dataList,t.recordCount=e.data.totalRecord,t.pageTotal=e.data.totalPage)}))},ChangePage:function(t){var e=this;e.queryForm.page=t,e.search()}}}),q=x,S=(a("2787"),Object(g["a"])(q,k,w,!1,null,null,null)),L=S.exports,$={components:{dataSearch:C,dataList:L},data:function(){return{queryForm:{page:1,pageSize:10,name:"",category_id:"",brand_id:"",supplier_id:"",is_package:"",status:""}}},methods:{setQuery:function(t){this.queryForm=t}}},z=$,D=(a("3181"),Object(g["a"])(z,n,r,!1,null,null,null));e["default"]=D.exports},"9add":function(t,e,a){"use strict";a.d(e,"d",(function(){return r})),a.d(e,"a",(function(){return o})),a.d(e,"e",(function(){return i})),a.d(e,"c",(function(){return u})),a.d(e,"b",(function(){return l}));var n=a("b775");function r(t){return Object(n["a"])({url:"/brand/search",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/brand/create",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/brand/update",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/brand/info",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/brand/delete",method:"post",data:t})}},a6b9:function(t,e,a){"use strict";a.d(e,"d",(function(){return r})),a.d(e,"a",(function(){return o})),a.d(e,"e",(function(){return i})),a.d(e,"c",(function(){return u})),a.d(e,"b",(function(){return l}));var n=a("b775");function r(t){return Object(n["a"])({url:"/supplier/search",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/supplier/create",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/supplier/update",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/supplier/info",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/supplier/delete",method:"post",data:t})}},a984:function(t,e,a){},c4c8:function(t,e,a){"use strict";a.d(e,"i",(function(){return r})),a.d(e,"b",(function(){return o})),a.d(e,"k",(function(){return i})),a.d(e,"e",(function(){return u})),a.d(e,"d",(function(){return l})),a.d(e,"g",(function(){return c})),a.d(e,"h",(function(){return s})),a.d(e,"a",(function(){return d})),a.d(e,"j",(function(){return p})),a.d(e,"f",(function(){return m})),a.d(e,"c",(function(){return f}));var n=a("b775");function r(t){return Object(n["a"])({url:"/product/category/search",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/product/category/create",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/product/category/update",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/product/category/info",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/product/category/delete",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/product/category/all",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/product/search",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/product/create",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/product/update",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/product/info",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/product/delete",method:"post",data:t})}},ffb9:function(t,e,a){}}]);
|